KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > kilim > model > mapping > NullMapper


1 /**
2  * Copyright (C) 2002 Kelua SA
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 2 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
19 package org.objectweb.kilim.model.mapping;
20
21 import org.objectweb.kilim.KilimException;
22
23 /**
24  * This mapper does not perform any action. it is just an indirection to the next mapper, when piped to another mapper.
25  * @author horn
26  */

27 public class NullMapper implements Mapper {
28     private Mapper wrappedMapper;
29    
30     /**
31      * Method JavaLogMapper.
32      * @param aMapper :
33      */

34     public NullMapper(Mapper aMapper) {
35         wrappedMapper = aMapper;
36     }
37
38     /**
39      * @see org.objectweb.kilim.model.mapping.Mapper#enterContext(Object)
40      */

41     public void enterContext(MappingContext aContext) throws KilimException { }
42     
43     /**
44      * @see org.objectweb.kilim.model.mapping.Mapper#leaveContext()
45      */

46     public void leaveContext(MappingContext aContext) throws KilimException { }
47
48     /**
49      * @see org.objectweb.kilim.model.mapping.KilimMapper#getGetterValue(Object, boolean, String, MappingContext)
50      */

51     public Object JavaDoc getGetterValue (Object JavaDoc aSupport, boolean isStatic, String JavaDoc fieldName, MappingContext aContext) throws KilimException {
52         Object JavaDoc resultValue = null;
53         if (wrappedMapper != null) {
54             resultValue = wrappedMapper.getGetterValue (aSupport, isStatic, fieldName, aContext);
55         }
56         
57         return resultValue;
58     }
59     
60     /**
61      * @see org.objectweb.kilim.model.mapping.KilimMapper#executeSetter(Object, boolean, String, Object, MappingContext)
62      */

63     public void executeSetter(Object JavaDoc aSupport, boolean isStatic, String JavaDoc fieldName, Object JavaDoc toBeSet, MappingContext aContext) throws KilimException {
64         if (wrappedMapper != null) {
65             wrappedMapper.executeSetter(aSupport, isStatic, fieldName, toBeSet, aContext);
66         }
67     }
68
69     /**
70      * @see org.objectweb.kilim.model.mapping.KilimMapper#getMethodValue(Object, boolean, String, Object[], String[], MappingContext)
71      */

72     public Object JavaDoc getMethodValue(Object JavaDoc aSupport, boolean isStatic, String JavaDoc aMethodName, Object JavaDoc[] paramObjects, String JavaDoc[] typeNames, MappingContext aContext) throws KilimException {
73         Object JavaDoc resultValue = null;
74         if (wrappedMapper != null) {
75             resultValue = wrappedMapper.getMethodValue (aSupport, isStatic, aMethodName, paramObjects, typeNames, aContext);
76         }
77         
78         return resultValue;
79     }
80     
81     /**
82      * @see org.objectweb.kilim.model.mapping.KilimMapper#executeMethod(Object, boolean, String, Object[], String[], MappingContext)
83      */

84     public void executeMethod(Object JavaDoc aSupport, boolean isStatic, String JavaDoc aMethodName, Object JavaDoc[] paramObjects, String JavaDoc[] typeNames, MappingContext aContext) throws KilimException {
85         getMethodValue(aSupport, isStatic, aMethodName, paramObjects, typeNames, aContext);
86     }
87             
88     /**
89      * @see org.objectweb.kilim.model.mapping.KilimMapper#getConstructorValue(Class, Object[], String[], MappingContext)
90      */

91     public Object JavaDoc getConstructorValue(Class JavaDoc aClass, Object JavaDoc[] paramObjects, String JavaDoc[] typeNames, MappingContext aContext) throws KilimException {
92         Object JavaDoc resultValue = null;
93         if (wrappedMapper != null) {
94             resultValue = wrappedMapper.getConstructorValue(aClass, paramObjects, typeNames, aContext);
95         }
96                 
97         return resultValue;
98     }
99     
100     /**
101      * @see org.objectweb.kilim.model.mapping.KilimMapper#executeConstructor(Class, Object[], String[], MappingContext)
102      */

103     public void executeConstructor(Class JavaDoc aClass, Object JavaDoc[] paramObjects, String JavaDoc[] typeNames, MappingContext aContext) throws KilimException {
104         getConstructorValue(aClass, paramObjects, typeNames, aContext);
105     }
106             
107
108     /**
109      * @see org.objectweb.kilim.model.mapping.KilimMapper#getExternalValue(Object, MappingContext)
110      */

111     public Object JavaDoc getExternalValue(Object JavaDoc aValue, MappingContext aContext) throws KilimException {
112         Object JavaDoc resultValue = null;
113         if (wrappedMapper != null) {
114             resultValue = wrappedMapper.getExternalValue(aValue, aContext);
115         }
116         return resultValue;
117     }
118     
119     /**
120      * @see org.objectweb.kilim.model.mapping.KilimMapper#getPropertyValue(Object, MappingContext)
121      */

122     public Object JavaDoc getPropertyValue(Object JavaDoc aValue, MappingContext aContext) throws KilimException {
123         Object JavaDoc resultValue = null;
124         if (wrappedMapper != null) {
125             resultValue = wrappedMapper.getPropertyValue(aValue, aContext);
126         }
127         return resultValue;
128     }
129         
130     /**
131      * @see org.objectweb.kilim.model.mapping.KilimMapper#getClassValue(String, MappingContext)
132      */

133     public Object JavaDoc getClassValue(String JavaDoc aClassName, MappingContext aContext) throws KilimException {
134         Object JavaDoc resultValue = null;
135         if (wrappedMapper != null) {
136             resultValue = wrappedMapper.getClassValue(aClassName, aContext);
137         }
138         return resultValue;
139     }
140     
141     /**
142      * @see org.objectweb.kilim.model.mapping.KilimMapper#getEventSourceValue(MappingContext)
143      */

144     public Object JavaDoc getEventSourceValue(MappingContext aContext) throws KilimException {
145         Object JavaDoc resultValue = null;
146         if (wrappedMapper != null) {
147             resultValue = wrappedMapper.getEventSourceValue(aContext);
148         }
149         return resultValue;
150     }
151     
152     /**
153      * @see org.objectweb.kilim.model.mapping.KilimMapper#getNullElementValue(MappingContext)
154      */

155     public Object JavaDoc getNullElementValue(MappingContext aContext) throws KilimException {
156         Object JavaDoc resultValue = null;
157         if (wrappedMapper != null) {
158             resultValue = wrappedMapper.getNullElementValue(aContext);
159         }
160         return resultValue;
161
162     }
163
164     /**
165      * @see org.objectweb.kilim.model.mapping.Mapper#executeNullElement(MappingContext)
166      */

167     public void executeNullElement(MappingContext aContext) throws KilimException {
168         if (wrappedMapper != null) {
169             wrappedMapper.executeNullElement(aContext);
170         }
171     }
172 }
Popular Tags