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 Summary
Modifier and TypeMethodDescriptiondescribe()Returns theAccessibilityof this method.default ConditionMethodOptionsreturns the list of mapping context parameters, i.e. those parameters that are annotated withContext.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().default TypeReturns the parameter designated as mapping target (if present)MappingTargetgetName()Returns then name of the method.In contrast togetSourceParameters()this method returns all parametersReturns the type of the result.Returns the return type of the methodreturns the list of 'true' source parameters excluding the parameter(s) that are designated as target, target type or context parameter.Returns the parameter designated as target type (if present)TargetTypeReturns all exceptions thrown by this methodReturns the formal type parameters of this method in declaration order.booleanWhether this method is Java 8 default methodbooleanbooleanReturns whether the method is designated as bean factory for mapping targetObjectFactorybooleanisStatic()Whether this method is static or an instance methodbooleanbooleanChecks whether the provided sourceType and provided targetType match with the parameter respectively return type of the method.booleanWhether this method overrides an abstract method.
-
Method Details
-
matches
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
In contrast togetSourceParameters()this method returns all parameters- Returns:
- all parameters
-
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
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 method 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
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
- 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
-
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
Returns the formal type parameters of this method in declaration order.- Returns:
- the formal type parameters, or an empty list if there are none
-