Package org.dozer.fieldmap

Examples of org.dozer.fieldmap.MapFieldMap


                      && !isSupportedMap(classMap.getDestClassToMap()))
                  || (isSupportedMap(fieldMap.getDestFieldType(classMap.getDestClassToMap()))
                      && !isSupportedMap(fieldMap.getSrcFieldType(classMap.getSrcClassToMap())))
                  || (isSupportedMap(fieldMap.getSrcFieldType(classMap.getSrcClassToMap())))
                      && !isSupportedMap(fieldMap.getDestFieldType(classMap.getDestClassToMap()))) {
                FieldMap fm = new MapFieldMap(fieldMap);
                classMap.removeFieldMapping(fieldMap);
                classMap.addFieldMapping(fm);
                fieldMap = fm;
              }
            }
View Full Code Here


        // already mapped
        if (!destinationIsMap && classMap.getFieldMapUsingDest(fieldName, true) != null) {
          continue;
        }

        FieldMap fieldMap = new MapFieldMap(classMap);
        DozerField srcField = new DozerField(MappingUtils.isSupportedMap(srcClass) ? DozerConstants.SELF_KEYWORD : fieldName, null);
        srcField.setKey(fieldName);

        if (StringUtils.isNotEmpty(classMap.getSrcClassMapGetMethod()) || StringUtils.isNotEmpty(classMap.getSrcClassMapSetMethod())) {
          srcField.setMapGetMethod(classMap.getSrcClassMapGetMethod());
          srcField.setMapSetMethod(classMap.getSrcClassMapSetMethod());
          srcField.setName(DozerConstants.SELF_KEYWORD);
        }

        DozerField destField = new DozerField(MappingUtils.isSupportedMap(destClass) ? DozerConstants.SELF_KEYWORD : fieldName, null);
        srcField.setKey(fieldName);

        if (StringUtils.isNotEmpty(classMap.getDestClassMapGetMethod())
                || StringUtils.isNotEmpty(classMap.getDestClassMapSetMethod())) {
          destField.setMapGetMethod(classMap.getDestClassMapGetMethod());
          destField.setMapSetMethod(classMap.getDestClassMapSetMethod());
          destField.setName(DozerConstants.SELF_KEYWORD);
        }

        fieldMap.setSrcField(srcField);
        fieldMap.setDestField(destField);

        classMap.addFieldMapping(fieldMap);
      }
      return true;
    }
View Full Code Here

    public void build() {
      // TODO Check Map to Map mapping
      FieldMap result;
      if (srcField.isMapTypeCustomGetterSetterField() || destField.isMapTypeCustomGetterSetterField()
          || classMap.isSrcClassMapTypeCustomGetterSetter() || classMap.isDestClassMapTypeCustomGetterSetter()) {
        result = new MapFieldMap(classMap);
      } else if (srcField.isCustomGetterSetterField() || destField.isCustomGetterSetterField()) {
        result = new CustomGetSetMethodFieldMap(classMap);
      } else {
        result = new GenericFieldMap(classMap);
      }
View Full Code Here

      if (!destinationIsMap && classMap.getFieldMapUsingDest(fieldName, true) != null) {
        continue;
      }

      FieldMap map = new MapFieldMap(classMap);
      DozerField srcField = new DozerField(MappingUtils.isSupportedMap(srcClass) ? DozerConstants.SELF_KEYWORD : fieldName, null);
      srcField.setKey(fieldName);

      if (StringUtils.isNotEmpty(classMap.getSrcClassMapGetMethod()) || StringUtils.isNotEmpty(classMap.getSrcClassMapSetMethod())) {
        srcField.setMapGetMethod(classMap.getSrcClassMapGetMethod());
        srcField.setMapSetMethod(classMap.getSrcClassMapSetMethod());
        srcField.setName(DozerConstants.SELF_KEYWORD);
      }

      DozerField destField = new DozerField(MappingUtils.isSupportedMap(destClass) ? DozerConstants.SELF_KEYWORD : fieldName, null);
      srcField.setKey(fieldName);

      if (StringUtils.isNotEmpty(classMap.getDestClassMapGetMethod())
          || StringUtils.isNotEmpty(classMap.getDestClassMapSetMethod())) {
        destField.setMapGetMethod(classMap.getDestClassMapGetMethod());
        destField.setMapSetMethod(classMap.getDestClassMapSetMethod());
        destField.setName(DozerConstants.SELF_KEYWORD);
      }

      map.setSrcField(srcField);
      map.setDestField(destField);

      classMap.addFieldMapping(map);
    }
  }
View Full Code Here

    public void build() {
      // TODO Check Map to Map mapping
      FieldMap result;
      if (srcField.isMapTypeCustomGetterSetterField() || destField.isMapTypeCustomGetterSetterField()
          || classMap.isSrcClassMapTypeCustomGetterSetter() || classMap.isDestClassMapTypeCustomGetterSetter()) {
        result = new MapFieldMap(classMap);
      } else if (srcField.isCustomGetterSetterField() || destField.isCustomGetterSetterField()) {
        result = new CustomGetSetMethodFieldMap(classMap);
      } else {
        result = new GenericFieldMap(classMap);
      }
View Full Code Here

            if (!(fieldMap instanceof ExcludeFieldMap)) {
              if (MappingUtils.isSupportedMap(classMap.getDestClassToMap())
                  || MappingUtils.isSupportedMap(classMap.getSrcClassToMap())
                  || MappingUtils.isSupportedMap(fieldMap.getDestFieldType(classMap.getDestClassToMap()))
                  || MappingUtils.isSupportedMap(fieldMap.getSrcFieldType(classMap.getSrcClassToMap()))) {
                FieldMap fm = new MapFieldMap(fieldMap);
                classMap.removeFieldMapping(fieldMap);
                classMap.addFieldMapping(fm);
                fieldMap = fm;
              }
            }
View Full Code Here

        // already mapped
        if (!destinationIsMap && classMap.getFieldMapUsingDest(fieldName, true) != null) {
          continue;
        }

        FieldMap fieldMap = new MapFieldMap(classMap);
        DozerField srcField = new DozerField(MappingUtils.isSupportedMap(srcClass) ? DozerConstants.SELF_KEYWORD : fieldName, null);
        srcField.setKey(fieldName);

        if (StringUtils.isNotEmpty(classMap.getSrcClassMapGetMethod())
            || StringUtils.isNotEmpty(classMap.getSrcClassMapSetMethod())) {
          srcField.setMapGetMethod(classMap.getSrcClassMapGetMethod());
          srcField.setMapSetMethod(classMap.getSrcClassMapSetMethod());
          srcField.setName(DozerConstants.SELF_KEYWORD);
        }

        DozerField destField = new DozerField(MappingUtils.isSupportedMap(destClass) ? DozerConstants.SELF_KEYWORD : fieldName,
            null);
        srcField.setKey(fieldName);

        if (StringUtils.isNotEmpty(classMap.getDestClassMapGetMethod())
            || StringUtils.isNotEmpty(classMap.getDestClassMapSetMethod())) {
          destField.setMapGetMethod(classMap.getDestClassMapGetMethod());
          destField.setMapSetMethod(classMap.getDestClassMapSetMethod());
          destField.setName(DozerConstants.SELF_KEYWORD);
        }

        fieldMap.setSrcField(srcField);
        fieldMap.setDestField(destField);

        classMap.addFieldMapping(fieldMap);
      }
      return true;
    }
View Full Code Here

            // only apply transformation if it is map to non-map mapping.
            if (!(fieldMap instanceof ExcludeFieldMap)) {
              if ( ( isSupportedMap(classMap.getDestClassToMap()) ^ isSupportedMap(classMap.getSrcClassToMap()) )
               || ( isSupportedMap(fieldMap.getDestFieldType(classMap.getDestClassToMap()))
                    ^ isSupportedMap(fieldMap.getSrcFieldType(classMap.getSrcClassToMap())) ) ) {
                FieldMap fm = new MapFieldMap(fieldMap);
                classMap.removeFieldMapping(fieldMap);
                classMap.addFieldMapping(fm);
                fieldMap = fm;
              }
            }
View Full Code Here

TOP

Related Classes of org.dozer.fieldmap.MapFieldMap

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.