01: /*
02: * Copyright 2005-2007 the original author or authors.
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS,
12: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13: * See the License for the specific language governing permissions and
14: * limitations under the License.
15: */
16: package net.sf.dozer.util.mapping.propertydescriptor;
17:
18: import net.sf.dozer.util.mapping.MappingException;
19: import net.sf.dozer.util.mapping.fieldmap.FieldMap;
20:
21: /**
22: * Internal class used for copy by reference mappings. Only intended for internal use.
23: *
24: * @author garsombke.franz
25: */
26: public class SelfPropertyDescriptor implements
27: DozerPropertyDescriptorIF {
28:
29: private final Class self;
30:
31: public SelfPropertyDescriptor(Class self) {
32: this .self = self;
33: }
34:
35: public Class getPropertyType() throws MappingException {
36: return self;
37: }
38:
39: public void setPropertyValue(Object bean, Object value,
40: FieldMap fieldMap) throws MappingException {
41: // do nothing
42: }
43:
44: public Object getPropertyValue(Object bean) throws MappingException {
45: return bean;
46: }
47:
48: }
|