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 MethodThis interface makes available common method properties and a matching method There are 2 known implementors:BuiltInMethodandSourceMethod- Author:
- Sjaak Derksen
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description Stringdescribe()AccessibilitygetAccessibility()Returns theAccessibilityof this method.default ConditionMethodOptionsgetConditionOptions()List<Parameter>getContextParameters()returns the list of mapping context parameters, i.e. those parameters that are annotated withContext.ParameterProvidedMethodsgetContextProvidedMethods()TypegetDeclaringMapper()Returns the mapper type declaring this method if it is not declared by the mapper interface currently processed but by another mapper imported viaMapper#users().TypegetDefiningType()ExecutableElementgetExecutable()default TypegetMappingSourceType()ParametergetMappingTargetParameter()Returns the parameter designated as mapping target (if present)MappingTargetStringgetName()Returns then name of the method.MappingMethodOptionsgetOptions()List<String>getParameterNames()List<Parameter>getParameters()In contrast togetSourceParameters()this method returns all parametersTypegetResultType()Returns the type of the result.TypegetReturnType()Returns the return type of the methodList<Parameter>getSourceParameters()returns the list of 'true' source parameters excluding the parameter(s) that are designated as target, target type or context parameter.ParametergetTargetTypeParameter()Returns the parameter designated as target type (if present)TargetTypeList<Type>getThrownTypes()Returns all exceptions thrown by this methodList<Type>getTypeParameters()Returns the formal type parameters of this method in declaration order.booleanisDefault()Whether this method is Java 8 default methodbooleanisLifecycleCallbackMethod()default booleanisMappingTargetAssignableToReturnType()booleanisObjectFactory()Returns whether the meethod is designated as bean factory for mapping targetObjectFactorybooleanisStatic()Whether this method is static or an instance methodbooleanisUpdateMethod()booleanmatches(List<Type> sourceTypes, Type targetType)Checks whether the provided sourceType and provided targetType match with the parameter respectively return type of the method.booleanoverridesMethod()Whether this method overrides an abstract method.
-
-
-
Method Detail
-
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 parametertargetType- 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 viaMapper#users().- Returns:
- The declaring mapper type
-
getName
String getName()
Returns then name of the method.- Returns:
- method name
-
getParameters
List<Parameter> getParameters()
In contrast togetSourceParameters()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 withContext.- 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 meethod is designated as bean factory for mapping targetObjectFactory- 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 theAccessibilityof this method.- Returns:
- the
Accessibilityof 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 withMappingTarget, 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()
-
isMappingTargetAssignableToReturnType
default boolean isMappingTargetAssignableToReturnType()
- Returns:
- true when @MappingTarget annotated parameter is the same type as the return type. The method has to be an update method in order for this to be true.
-
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
-
-