Interface Method

All Known Implementing Classes:
AbstractToXmlGregorianCalendar, BuiltInMethod, CalendarToXmlGregorianCalendar, CalendarToZonedDateTime, CreateDecimalFormat, DateToXmlGregorianCalendar, ForgedMethod, HelperMethod, JodaDateTimeToXmlGregorianCalendar, JodaLocalDateTimeToXmlGregorianCalendar, JodaLocalDateToXmlGregorianCalendar, JodaLocalTimeToXmlGregorianCalendar, LocalDateTimeToXmlGregorianCalendar, LocalDateToXmlGregorianCalendar, SourceMethod, StringToXmlGregorianCalendar, XmlGregorianCalendarToCalendar, XmlGregorianCalendarToDate, XmlGregorianCalendarToJodaDateTime, XmlGregorianCalendarToJodaLocalDate, XmlGregorianCalendarToJodaLocalDateTime, XmlGregorianCalendarToJodaLocalTime, XmlGregorianCalendarToLocalDate, XmlGregorianCalendarToLocalDateTime, XmlGregorianCalendarToString, ZonedDateTimeToCalendar, ZonedDateTimeToXmlGregorianCalendar

public interface Method
This interface makes available common method properties and a matching method There are 2 known implementors: BuiltInMethod and SourceMethod
Author:
Sjaak Derksen
  • Method Details

    • matches

      boolean matches(List<Type> sourceTypes, Type targetType)
      Checks whether the provided sourceType and provided targetType match with the parameter respectively return type of the method. The check also should incorporate wild card and generic type variables
      Parameters:
      sourceTypes - the sourceTypes to match to the parameter
      targetType - the targetType to match to the returnType
      Returns:
      true when match
    • getDeclaringMapper

      Type getDeclaringMapper()
      Returns the mapper type declaring this method if it is not declared by the mapper interface currently processed but by another mapper imported via Mapper#users().
      Returns:
      The declaring mapper type
    • getName

      String getName()
      Returns then name of the method.
      Returns:
      method name
    • getParameters

      List<Parameter> getParameters()
      In contrast to getSourceParameters() this method returns all parameters
      Returns:
      all parameters
    • getSourceParameters

      List<Parameter> getSourceParameters()
      returns the list of 'true' source parameters excluding the parameter(s) that are designated as target, target type or context parameter.
      Returns:
      list of 'true' source parameters
    • getContextParameters

      List<Parameter> getContextParameters()
      returns the list of mapping context parameters, i.e. those parameters that are annotated with Context.
      Returns:
      list of context parameters
    • getContextProvidedMethods

      ParameterProvidedMethods getContextProvidedMethods()
      Returns:
      a mapping between getContextParameters() to factory and lifecycle methods provided by them.
    • getMappingTargetParameter

      Parameter getMappingTargetParameter()
      Returns the parameter designated as mapping target (if present) MappingTarget
      Returns:
      mapping target parameter (when present) null otherwise.
    • isObjectFactory

      boolean isObjectFactory()
      Returns whether the method is designated as bean factory for mapping target ObjectFactory
      Returns:
      true if it is a target bean factory.
    • getTargetTypeParameter

      Parameter getTargetTypeParameter()
      Returns the parameter designated as target type (if present) TargetType
      Returns:
      target type parameter (when present) null otherwise.
    • getAccessibility

      Accessibility getAccessibility()
      Returns the Accessibility of this method.
      Returns:
      the Accessibility of this method
    • getReturnType

      Type getReturnType()
      Returns the return type of the method
      Returns:
      return type
    • getThrownTypes

      List<Type> getThrownTypes()
      Returns all exceptions thrown by this method
      Returns:
      exceptions thrown
    • getResultType

      Type getResultType()
      Returns the type of the result. The result is defined as the type of the parameter designated with MappingTarget, or in absence the return type.
      Returns:
      result type
    • getParameterNames

      List<String> getParameterNames()
      Returns:
      the names of the parameters of this mapping method
    • overridesMethod

      boolean overridesMethod()
      Whether this method overrides an abstract method.
      Returns:
      true when an abstract method is overridden.
    • getExecutable

      ExecutableElement getExecutable()
    • isStatic

      boolean isStatic()
      Whether this method is static or an instance method
      Returns:
      true when static.
    • isDefault

      boolean isDefault()
      Whether this method is Java 8 default method
      Returns:
      true when Java 8 default method
    • getDefiningType

      Type getDefiningType()
      Returns:
      the Type (class or interface) that defines this method.
    • isLifecycleCallbackMethod

      boolean isLifecycleCallbackMethod()
      Returns:
      true, if the method represents a mapping lifecycle callback (Before/After mapping method)
    • isUpdateMethod

      boolean isUpdateMethod()
      Returns:
      true, if the method is an update method, i.e. it has a parameter annotated with @MappingTarget.
    • getOptions

      MappingMethodOptions getOptions()
      Returns:
      the mapping options for this method
    • getConditionOptions

      default ConditionMethodOptions getConditionOptions()
    • getMappingSourceType

      default Type getMappingSourceType()
      Returns:
      the first source type, intended for mapping methods from single source to target
    • describe

      String describe()
      Returns:
      the short name for error messages when verbose, full name when not
    • getTypeParameters

      List<Type> getTypeParameters()
      Returns the formal type parameters of this method in declaration order.
      Returns:
      the formal type parameters, or an empty list if there are none