Class SupportingMappingMethod

All Implemented Interfaces:
Writable

public class SupportingMappingMethod extends MappingMethod
A mapping method which is not based on an actual method declared in the original mapper interface but is added as private method to map a certain source/target type combination. Based on a BuiltInMethod. Specific templates all point to this class, for instance: XmlGregorianCalendarToCalendar, but also used fields and constructor elements, e.g. FinalField and NewDatatypeFactoryConstructorFragment
Author:
Gunnar Morling
  • Constructor Details

    • SupportingMappingMethod

      public SupportingMappingMethod(BuiltInMethod method, Set<Field> existingFields)
    • SupportingMappingMethod

      public SupportingMappingMethod(HelperMethod method)
  • Method Details

    • getTemplateName

      public String getTemplateName()
      Description copied from class: FreeMarkerWritable
      Returns the name of the template to be used for a specific writable type. By default, FreeMarkerWritable.getTemplateNameForClass(Class) is called with getClass(), but this can be customized by overriding this method if required.
      Overrides:
      getTemplateName in class FreeMarkerWritable
      Returns:
      the name of the template. Must not be null.
    • getImportTypes

      public Set<Type> getImportTypes()
      Description copied from class: ModelElement
      Returns a set containing those Types referenced by this model element for which an import statement needs to be declared.
      Overrides:
      getImportTypes in class MappingMethod
      Returns:
      A set with type referenced by this model element. Must not be null.
    • findType

      public Type findType(String name)
      Finds a Type by a given name. The name will be compared to the fully-qualified and also simple names of the importTypes.
      Parameters:
      name - Fully-qualified or simple name of the type.
      Returns:
      Found type, never null.
      Throws:
      IllegalArgumentException - In case no Type was found for given name.
    • getSupportingField

      public Field getSupportingField()
    • getSupportingConstructorFragment

      public SupportingConstructorFragment getSupportingConstructorFragment()
    • getTemplateParameter

      public Map<String,Object> getTemplateParameter()
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class MappingMethod
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class MappingMethod