1 18 19 package org.objectweb.kilim.model.mapping; 20 21 import org.objectweb.kilim.KilimException; 22 23 27 public class NullMapper implements Mapper { 28 private Mapper wrappedMapper; 29 30 34 public NullMapper(Mapper aMapper) { 35 wrappedMapper = aMapper; 36 } 37 38 41 public void enterContext(MappingContext aContext) throws KilimException { } 42 43 46 public void leaveContext(MappingContext aContext) throws KilimException { } 47 48 51 public Object getGetterValue (Object aSupport, boolean isStatic, String fieldName, MappingContext aContext) throws KilimException { 52 Object resultValue = null; 53 if (wrappedMapper != null) { 54 resultValue = wrappedMapper.getGetterValue (aSupport, isStatic, fieldName, aContext); 55 } 56 57 return resultValue; 58 } 59 60 63 public void executeSetter(Object aSupport, boolean isStatic, String fieldName, Object toBeSet, MappingContext aContext) throws KilimException { 64 if (wrappedMapper != null) { 65 wrappedMapper.executeSetter(aSupport, isStatic, fieldName, toBeSet, aContext); 66 } 67 } 68 69 72 public Object getMethodValue(Object aSupport, boolean isStatic, String aMethodName, Object [] paramObjects, String [] typeNames, MappingContext aContext) throws KilimException { 73 Object resultValue = null; 74 if (wrappedMapper != null) { 75 resultValue = wrappedMapper.getMethodValue (aSupport, isStatic, aMethodName, paramObjects, typeNames, aContext); 76 } 77 78 return resultValue; 79 } 80 81 84 public void executeMethod(Object aSupport, boolean isStatic, String aMethodName, Object [] paramObjects, String [] typeNames, MappingContext aContext) throws KilimException { 85 getMethodValue(aSupport, isStatic, aMethodName, paramObjects, typeNames, aContext); 86 } 87 88 91 public Object getConstructorValue(Class aClass, Object [] paramObjects, String [] typeNames, MappingContext aContext) throws KilimException { 92 Object resultValue = null; 93 if (wrappedMapper != null) { 94 resultValue = wrappedMapper.getConstructorValue(aClass, paramObjects, typeNames, aContext); 95 } 96 97 return resultValue; 98 } 99 100 103 public void executeConstructor(Class aClass, Object [] paramObjects, String [] typeNames, MappingContext aContext) throws KilimException { 104 getConstructorValue(aClass, paramObjects, typeNames, aContext); 105 } 106 107 108 111 public Object getExternalValue(Object aValue, MappingContext aContext) throws KilimException { 112 Object resultValue = null; 113 if (wrappedMapper != null) { 114 resultValue = wrappedMapper.getExternalValue(aValue, aContext); 115 } 116 return resultValue; 117 } 118 119 122 public Object getPropertyValue(Object aValue, MappingContext aContext) throws KilimException { 123 Object resultValue = null; 124 if (wrappedMapper != null) { 125 resultValue = wrappedMapper.getPropertyValue(aValue, aContext); 126 } 127 return resultValue; 128 } 129 130 133 public Object getClassValue(String aClassName, MappingContext aContext) throws KilimException { 134 Object resultValue = null; 135 if (wrappedMapper != null) { 136 resultValue = wrappedMapper.getClassValue(aClassName, aContext); 137 } 138 return resultValue; 139 } 140 141 144 public Object getEventSourceValue(MappingContext aContext) throws KilimException { 145 Object resultValue = null; 146 if (wrappedMapper != null) { 147 resultValue = wrappedMapper.getEventSourceValue(aContext); 148 } 149 return resultValue; 150 } 151 152 155 public Object getNullElementValue(MappingContext aContext) throws KilimException { 156 Object resultValue = null; 157 if (wrappedMapper != null) { 158 resultValue = wrappedMapper.getNullElementValue(aContext); 159 } 160 return resultValue; 161 162 } 163 164 167 public void executeNullElement(MappingContext aContext) throws KilimException { 168 if (wrappedMapper != null) { 169 wrappedMapper.executeNullElement(aContext); 170 } 171 } 172 } | Popular Tags |