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;
17:
18: import net.sf.dozer.util.mapping.classmap.ClassMap;
19: import net.sf.dozer.util.mapping.fieldmap.FieldMap;
20:
21: /**
22: * Public custom field mapper interface. A custom field mapper should only be used in very rare and unusual cases
23: * because it is invoked for ALL field mappings. For custom mappings of particular fields, using a CustomConverter is a
24: * much better choice.
25: *
26: * <p>
27: * If a custom field mapper is specified, Dozer will invoke this class when performing all field mappings. If false is
28: * returned from the call to mapField(), then the field will be subsequently mapped by Dozer as normal.
29: *
30: * @author Gerard Toonstra
31: */
32: public interface CustomFieldMapperIF {
33:
34: public boolean mapField(Object source, Object destination,
35: Object sourceFieldValue, ClassMap classMap,
36: FieldMap fieldMapping);
37:
38: }
|