Interface ClassMappingMetadata

  • All Known Implementing Classes:
    DozerClassMappingMetadata

    public interface ClassMappingMetadata
    This interface provides read-only access to all important aspects of the mapping metadata that specifies how two classes are mapped to one another. The interface also holds methods to query the individual field mappings that are part of the class mapping definition. This covers custom field mappings as well as implicit field mappings automatically introduced by the dozer framework.
    • Method Detail

      • getSourceClassName

        String getSourceClassName()
        Obtains the name of the source class in the mapping definition.
        Returns:
        The name of the source class.
      • getDestinationClassName

        String getDestinationClassName()
        Obtains the name of the destination class in the mapping definition.
        Returns:
        The name of the destination class.
      • getSourceClass

        Class<?> getSourceClass()
        Obtains the Class object that represents the source class in the mapping definition.
        Returns:
        The Class object of the source class.
      • getDestinationClass

        Class<?> getDestinationClass()
        Obtains the Class object that represents the destination class in the mapping definition.
        Returns:
        The Class object of the destination class.
      • isStopOnErrors

        boolean isStopOnErrors()
        Whether to stop if an exception occurs while mapping
        Returns:
        true if the mapping will be stopped upon errors.
      • isTrimStrings

        boolean isTrimStrings()
        Whether strings should be trimmed
        Returns:
        true if strings are trimmed during mapping.
      • isWildcard

        boolean isWildcard()
        Whether wildcard policy is enabled
        Returns:
        The wildcard policy. True means that fields with the same name are automatically mapped.
      • isSourceMapNull

        boolean isSourceMapNull()
        Whether source should map null
        Returns:
        true if null values are mapped from the source class.
      • isDestinationMapNull

        boolean isDestinationMapNull()
        Whether destination should map null
        Returns:
        true if null values are mapped from the destination class.
      • isSourceMapEmptyString

        boolean isSourceMapEmptyString()
        Whether source should map empty strings
        Returns:
        true if empty are mapped from the source class.
      • isDestinationMapEmptyString

        boolean isDestinationMapEmptyString()
        Whether destination should map empty strings
        Returns:
        true if empty are mapped from the destination class.
      • getDateFormat

        String getDateFormat()
        Obtains the date format that is used during date conversions.
        Returns:
        The date format as a string.
      • getMappingDirection

        MappingDirection getMappingDirection()
        Used to check if a mapping is bi- or unidirectional.
        Returns:
        The MappingDirection object that specifies the direction of the map.
      • getMapId

        String getMapId()
        Returns the map id of this mapping definition used for contextual mapping selection.
        Returns:
        The identifier as a string.
      • getFieldMappingBySource

        FieldMappingMetadata getFieldMappingBySource​(String sourceFieldName)
        Gets a single field mapping definition by looking up the name of the source field.
        Parameters:
        sourceFieldName - The name of the source field.
        Returns:
        A FieldMappingMetadata object.
        Throws:
        MetadataLookupException - If no field map could be found.
      • getFieldMappingByDestination

        FieldMappingMetadata getFieldMappingByDestination​(String destinationFieldName)
        Gets a single field mapping definition by looking up the name of the destination field.
        Parameters:
        destinationFieldName - The name of the destination field.
        Returns:
        A FieldMappingMetadata object.
        Throws:
        MetadataLookupException - If no field map could be found.