Package org.dozer.fieldmap

Examples of org.dozer.fieldmap.DozerField


    return findCustomConverter(converterByDestTypeCache, customConverterContainer, srcClass, destClass);
  }

  public static void reverseFields(FieldMap source, FieldMap reversed) {
    DozerField destField = source.getSrcFieldCopy();
    DozerField sourceField = source.getDestFieldCopy();

    reversed.setDestField(destField);
    reversed.setSrcField(sourceField);

    reversed.setCustomConverter(source.getCustomConverter());
View Full Code Here


      if (srcProperty == null || srcProperty.getReadMethod() == null) {
        continue;
      }

      FieldMap map;
      DozerField field = new DozerField(destFieldName, null);
      if (field.isCustomGetterSetterField()) {
        map = new CustomGetSetMethodFieldMap(classMap);
      } else {
        map = new GenericFieldMap(classMap);
      }
      map.setSrcField(new DozerField(destFieldName, null));
      map.setDestField(new DozerField(destFieldName, null));
      // add CopyByReferences per defect #1728159
      MappingUtils.applyGlobalCopyByReference(globalConfiguration, map, classMap);
      classMap.addFieldMapping(map);
    }
  }
View Full Code Here

    }
  }

  private static void addListDefaultMappings(ClassMap classMap) {
    FieldMap fieldMap = new GenericFieldMap(classMap);
    DozerField selfReference = new DozerField(DozerConstants.SELF_KEYWORD, null);
    fieldMap.setSrcField(selfReference);
    fieldMap.setDestField(selfReference);
    classMap.addFieldMapping(fieldMap);
  }
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);
View Full Code Here

    return findCustomConverter(converterByDestTypeCache, customConverterContainer, srcClass, destClass);
  }

  public static void reverseFields(FieldMap source, FieldMap reversed) {
    DozerField destField = source.getSrcFieldCopy();
    DozerField sourceField = source.getDestFieldCopy();

    reversed.setDestField(destField);
    reversed.setSrcField(sourceField);

    reversed.setCustomConverter(source.getCustomConverter());
View Full Code Here

      fieldName = name;
    }
    if (StringUtils.isNotEmpty(type)) {
      fieldType = type;
    }
    DozerField field = new DozerField(fieldName, fieldType);
    if (isIndexed(name)) {
      field.setIndexed(true);
      field.setIndex(getIndexOfIndexedField(name));
    }
    return field;
  }
View Full Code Here

    public void type(MappingDirection type) {
      fieldMap.setType(type);
    }

    public FieldDefinitionBuilder a(String name, String type) {
      DozerField field = prepareField(name, type);
      fieldMap.setSrcField(field);
      return new FieldDefinitionBuilder(field);
    }
View Full Code Here

      fieldMap.setSrcField(field);
      return new FieldDefinitionBuilder(field);
    }

    public FieldDefinitionBuilder b(String name, String type) {
      DozerField field = prepareField(name, type);
      fieldMap.setDestField(field);
      return new FieldDefinitionBuilder(field);
    }
View Full Code Here

    public FieldMappingBuilder(ClassMap classMap) {
      this.classMap = classMap;
    }

    public FieldDefinitionBuilder a(String name, String type) {
      DozerField field = DozerBuilder.prepareField(name, type);
      this.srcField = field;
      return new FieldDefinitionBuilder(field);
    }
View Full Code Here

      this.srcField = field;
      return new FieldDefinitionBuilder(field);
    }

    public FieldDefinitionBuilder b(String name, String type) {
      DozerField field = prepareField(name, type);
      this.destField = field;
      return new FieldDefinitionBuilder(field);
    }
View Full Code Here

TOP

Related Classes of org.dozer.fieldmap.DozerField

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.