
| Constructor and Description |
|---|
ForgedMethod(String name,
ForgedMethod forgedMethod)
creates a new ForgedMethod with the same arguments but with a new name
|
| Modifier and Type | Method and Description |
|---|---|
void |
addThrownTypes(List<Type> thrownTypesToAdd) |
String |
describe() |
boolean |
equals(Object o) |
static ForgedMethod |
forElementMapping(String name,
Type sourceType,
Type returnType,
Method basedOn,
ForgedMethodHistory history,
boolean forgedNameBased)
Creates a new forged method for mapping a collection element, map key/value or stream element
|
static ForgedMethod |
forParameterMapping(String name,
Type sourceType,
Type returnType,
Method basedOn)
Creates a new forged method with the given name for mapping a method parameter to a property.
|
static ForgedMethod |
forPropertyMapping(String name,
Type sourceType,
Type returnType,
List<Parameter> parameters,
Method basedOn,
ForgedMethodHistory history,
MappingReferences mappingReferences,
boolean forgedNameBased)
Creates a new forged method for mapping a bean property to a property
|
Accessibility |
getAccessibility()
Returns the
Accessibility of this method. |
List<Parameter> |
getContextParameters()
returns the list of mapping context parameters, i.e. those parameters that are annotated with
Context. |
ParameterProvidedMethods |
getContextProvidedMethods() |
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(). |
Type |
getDefiningType() |
ExecutableElement |
getExecutable() |
ForgedMethodHistory |
getHistory() |
MappingReferences |
getMappingReferences() |
Parameter |
getMappingTargetParameter()
Returns the parameter designated as mapping target (if present)
MappingTarget |
String |
getName()
Returns then name of the method.
|
MappingMethodOptions |
getOptions() |
List<String> |
getParameterNames() |
List<Parameter> |
getParameters()
In contrast to
Method.getSourceParameters() this method returns all parameters |
Type |
getResultType()
Returns the type of the result.
|
Type |
getReturnType()
Returns the return type of the method
|
List<Parameter> |
getSourceParameters()
returns the list of 'true' source parameters excluding the parameter(s) that are designated as target, target
type or context parameter.
|
Parameter |
getTargetTypeParameter()
Returns the parameter designated as target type (if present)
TargetType |
List<Type> |
getThrownTypes()
Returns all exceptions thrown by this method
|
int |
hashCode() |
boolean |
isDefault()
Whether this method is Java 8 default method
|
boolean |
isForgedNamedBased() |
boolean |
isLifecycleCallbackMethod() |
boolean |
isObjectFactory()
object factory mechanism not supported for forged methods
|
boolean |
isStatic()
Whether this method is static or an instance method
|
boolean |
isUpdateMethod() |
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.
|
boolean |
overridesMethod()
Whether this method overrides an abstract method.
|
String |
toString() |
clone, finalize, getClass, notify, notifyAll, wait, wait, waitgetMappingSourceType, isMappingTargetAssignableToReturnTypepublic ForgedMethod(String name, ForgedMethod forgedMethod)
name - the new nameforgedMethod - existing forge methodpublic static ForgedMethod forParameterMapping(String name, Type sourceType, Type returnType, Method basedOn)
name - the (unique name) for this methodsourceType - the source typereturnType - the return type.basedOn - the method that (originally) triggered this nested method generation.public static ForgedMethod forPropertyMapping(String name, Type sourceType, Type returnType, List<Parameter> parameters, Method basedOn, ForgedMethodHistory history, MappingReferences mappingReferences, boolean forgedNameBased)
name - the (unique name) for this methodsourceType - the source typereturnType - the return type.parameters - other parameters (including the context + @MappingTargetbasedOn - the method that (originally) triggered this nested method generation.history - a parent forged method if this is a forged method within a forged methodmappingReferences - the mapping options for this methodforgedNameBased - forges a name based (matched) mapping methodpublic static ForgedMethod forElementMapping(String name, Type sourceType, Type returnType, Method basedOn, ForgedMethodHistory history, boolean forgedNameBased)
name - the (unique name) for this methodsourceType - the source typereturnType - the return type.basedOn - the method that (originally) triggered this nested method generation.history - a parent forged method if this is a forged method within a forged methodforgedNameBased - forges a name based (matched) mapping methodpublic boolean matches(List<Type> sourceTypes, Type targetType)
Methodpublic Type getDeclaringMapper()
MethodMapper#users().getDeclaringMapper in interface Methodpublic String getName()
Methodpublic List<Parameter> getParameters()
MethodMethod.getSourceParameters() this method returns all parametersgetParameters in interface Methodpublic List<Parameter> getSourceParameters()
MethodgetSourceParameters in interface Methodpublic List<Parameter> getContextParameters()
MethodContext.getContextParameters in interface Methodpublic ParameterProvidedMethods getContextProvidedMethods()
getContextProvidedMethods in interface MethodMethod.getContextParameters() to factory and lifecycle methods provided by them.public Parameter getMappingTargetParameter()
MethodMappingTargetgetMappingTargetParameter in interface Methodpublic Parameter getTargetTypeParameter()
MethodTargetTypegetTargetTypeParameter in interface Methodpublic Accessibility getAccessibility()
MethodAccessibility of this method.getAccessibility in interface MethodAccessibility of this methodpublic Type getReturnType()
MethodgetReturnType in interface Methodpublic List<Type> getThrownTypes()
MethodgetThrownTypes in interface Methodpublic ForgedMethodHistory getHistory()
public boolean isForgedNamedBased()
public Type getResultType()
MethodMappingTarget, or in absence the return type.getResultType in interface Methodpublic List<String> getParameterNames()
getParameterNames in interface Methodpublic boolean overridesMethod()
MethodoverridesMethod in interface Methodpublic ExecutableElement getExecutable()
getExecutable in interface Methodpublic boolean isLifecycleCallbackMethod()
isLifecycleCallbackMethod in interface Methodtrue, if the method represents a mapping lifecycle callback (Before/After mapping method)public boolean isStatic()
Methodpublic boolean isDefault()
Methodpublic Type getDefiningType()
getDefiningType in interface Methodpublic boolean isUpdateMethod()
isUpdateMethod in interface Methodtrue, if the method is an update method, i.e. it has a parameter annotated with
@MappingTarget.public boolean isObjectFactory()
isObjectFactory in interface Methodpublic MappingMethodOptions getOptions()
getOptions in interface Methodpublic String describe()
public MappingReferences getMappingReferences()
Copyright © 2012-2021 MapStruct Authors; All rights reserved. Released under the Apache Software License 2.0.