EMMA Coverage Report (generated Sun May 02 20:42:29 CEST 2010)
[all classes][hu.netmind.beankeeper.model.impl]

COVERAGE SUMMARY FOR SOURCE FILE [StrictNullHandler.java]

nameclass, %method, %block, %line, %
StrictNullHandler.java100% (1/1)67%  (6/9)33%  (21/63)73%  (8/11)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class StrictNullHandler100% (1/1)67%  (6/9)33%  (21/63)73%  (8/11)
getAttributeValue (Object, String): Object 0%   (0/1)0%   (0/17)0%   (0/1)
getSourceEntry (): ClassEntry 0%   (0/1)0%   (0/3)0%   (0/1)
setAttributeValue (Object, String, Object): void 0%   (0/1)0%   (0/22)0%   (0/1)
<static initializer> 100% (1/1)100% (4/4)100% (1/1)
StrictNullHandler (ClassEntry): void 100% (1/1)100% (6/6)100% (3/3)
getAttributeNames (): List 100% (1/1)100% (4/4)100% (1/1)
getAttributeTypes (): Map 100% (1/1)100% (4/4)100% (1/1)
hasChanged (): boolean 100% (1/1)100% (2/2)100% (1/1)
update (): void 100% (1/1)100% (1/1)100% (1/1)

1/**
2 * Copyright (C) 2006 NetMind Consulting Bt.
3 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 3 of the License, or (at your option) any later version.
8 *
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12 * Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
17 */
18 
19package hu.netmind.beankeeper.model.impl;
20 
21import org.apache.log4j.Logger;
22import java.util.List;
23import java.util.ArrayList;
24import java.util.Map;
25import java.util.HashMap;
26import hu.netmind.beankeeper.common.StoreException;
27import hu.netmind.beankeeper.model.*;
28 
29/**
30 * Null handler is a class handler for interfaces and reserved classes.
31 * It contains no attributes, so all methods return default values 
32 * statically.
33 * @author Brautigam Robert
34 * @version Revision: $Revision$
35 */
36public class StrictNullHandler implements StrictClassHandler
37{
38   private static Logger logger = Logger.getLogger(StrictNullHandler.class);
39   
40   private ClassEntry sourceEntry;
41 
42   StrictNullHandler(ClassEntry sourceEntry)
43   {
44      // Init
45      this.sourceEntry=sourceEntry;
46   }
47 
48   public ClassEntry getSourceEntry()
49   {
50      return sourceEntry;
51   }
52 
53   public boolean hasChanged()
54   {
55      return false;
56   }
57 
58   public void update()
59   {
60   }
61 
62   public Map getAttributeTypes()
63   {
64      return new HashMap();
65   }
66 
67   public List getAttributeNames()
68   {
69      return new ArrayList();
70   }
71 
72   /**
73    * Always throws exception.
74    */
75   public Object getAttributeValue(Object obj, String attributeName)
76   {
77      throw new StoreException("object value cannot be get, name: "+attributeName+" in nullhandler for: "+sourceEntry);
78   }
79 
80   /**
81    * Always returns exception.
82    */
83   public void setAttributeValue(Object obj, String attributeName, Object value)
84   {
85      throw new StoreException("object value cannot be set, objectclass: "+obj.getClass()+" name: "+attributeName+" on nullhandler for type: "+sourceEntry);
86   }
87 
88}
89 
90 

[all classes][hu.netmind.beankeeper.model.impl]
EMMA 2.0.5312debian (C) Vladimir Roubtsov