Class Parameter
- java.lang.Object
-
- org.mapstruct.ap.internal.writer.FreeMarkerWritable
-
- org.mapstruct.ap.internal.model.common.ModelElement
-
- org.mapstruct.ap.internal.model.common.Parameter
-
- All Implemented Interfaces:
Writable
public class Parameter extends ModelElement
A parameter of a mapping method.- Author:
- Gunnar Morling
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.mapstruct.ap.internal.writer.Writable
Writable.Context
-
-
Method Summary
-
Methods inherited from class org.mapstruct.ap.internal.writer.FreeMarkerWritable
getTemplateName, getTemplateNameForClass, write
-
-
-
-
Method Detail
-
getElement
public Element getElement()
-
getName
public String getName()
-
getOriginalName
public String getOriginalName()
-
getType
public Type getType()
-
isMappingTarget
public boolean isMappingTarget()
-
describe
public String describe()
-
getImportTypes
public Set<Type> getImportTypes()
Description copied from class:ModelElement
Returns a set containing thoseType
s referenced by this model element for which an import statement needs to be declared.- Specified by:
getImportTypes
in classModelElement
- Returns:
- A set with type referenced by this model element. Must not be
null
.
-
isTargetType
public boolean isTargetType()
-
isMappingContext
public boolean isMappingContext()
-
isVarArgs
public boolean isVarArgs()
-
forElementAndType
public static Parameter forElementAndType(VariableElement element, Type parameterType, boolean isVarArgs)
-
getSourceParameters
public static List<Parameter> getSourceParameters(List<Parameter> parameters)
- Parameters:
parameters
- the parameters to filter- Returns:
- the parameters from the given list that are considered 'source parameters'
-
getSourceParameter
public static Parameter getSourceParameter(List<Parameter> parameters, String sourceParameterName)
- Parameters:
parameters
- the parameters to scansourceParameterName
- the source parameter name to match- Returns:
- the parameters from the given list that are considered 'source parameters'
-
getContextParameters
public static List<Parameter> getContextParameters(List<Parameter> parameters)
- Parameters:
parameters
- the parameters to filter- Returns:
- the parameters from the given list that are marked as 'mapping context parameters'
-
getMappingTargetParameter
public static Parameter getMappingTargetParameter(List<Parameter> parameters)
-
-