Class ParameterBinding
- java.lang.Object
-
- org.mapstruct.ap.internal.model.common.ParameterBinding
-
public class ParameterBinding extends Object
Represents how one parameter of a method to be called is populated.- Author:
- Andreas Gudian
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ParameterBinding
forMappingTargetBinding(Type resultType)
static ParameterBinding
forSourcePropertyNameBinding(Type classTypeOf)
static ParameterBinding
forSourceTypeBinding(Type sourceType)
static ParameterBinding
forTargetPropertyNameBinding(Type classTypeOf)
static ParameterBinding
forTargetTypeBinding(Type classTypeOf)
static ParameterBinding
fromParameter(Parameter parameter)
static List<ParameterBinding>
fromParameters(List<Parameter> parameters)
static ParameterBinding
fromSourceRHS(SourceRHS sourceRHS)
static ParameterBinding
fromTypeAndName(Type parameterType, String parameterName)
Set<Type>
getImportTypes()
SourceRHS
getSourceRHS()
Type
getType()
String
getVariableName()
boolean
isForSourceRhs()
boolean
isMappingContext()
boolean
isMappingTarget()
boolean
isSourceParameter()
boolean
isSourcePropertyName()
boolean
isTargetPropertyName()
boolean
isTargetType()
-
-
-
Method Detail
-
getVariableName
public String getVariableName()
- Returns:
- the name of the variable (or parameter) that is being used as argument for the parameter being bound.
-
isSourceParameter
public boolean isSourceParameter()
-
isTargetType
public boolean isTargetType()
- Returns:
true
, if the parameter being bound is a@TargetType
parameter.
-
isMappingTarget
public boolean isMappingTarget()
- Returns:
true
, if the parameter being bound is a@MappingTarget
parameter.
-
isMappingContext
public boolean isMappingContext()
- Returns:
true
, if the parameter being bound is a@MappingContext
parameter.
-
isForSourceRhs
public boolean isForSourceRhs()
-
isSourcePropertyName
public boolean isSourcePropertyName()
- Returns:
true
, if the parameter being bound is a@SourcePropertyName
parameter.
-
isTargetPropertyName
public boolean isTargetPropertyName()
- Returns:
true
, if the parameter being bound is a@TargetPropertyName
parameter.
-
getType
public Type getType()
- Returns:
- the type of the parameter that is bound
-
getSourceRHS
public SourceRHS getSourceRHS()
- Returns:
- the sourceRHS that this parameter is bound to
-
fromParameter
public static ParameterBinding fromParameter(Parameter parameter)
- Parameters:
parameter
- parameter- Returns:
- a parameter binding reflecting the given parameter as being used as argument for a method call
-
fromParameters
public static List<ParameterBinding> fromParameters(List<Parameter> parameters)
-
fromTypeAndName
public static ParameterBinding fromTypeAndName(Type parameterType, String parameterName)
-
forTargetTypeBinding
public static ParameterBinding forTargetTypeBinding(Type classTypeOf)
- Parameters:
classTypeOf
- the type representingClass<X>
for the target typeX
- Returns:
- a parameter binding representing a target type parameter
-
forTargetPropertyNameBinding
public static ParameterBinding forTargetPropertyNameBinding(Type classTypeOf)
- Returns:
- a parameter binding representing a target property name parameter
-
forSourcePropertyNameBinding
public static ParameterBinding forSourcePropertyNameBinding(Type classTypeOf)
- Returns:
- a parameter binding representing a source property name parameter
-
forMappingTargetBinding
public static ParameterBinding forMappingTargetBinding(Type resultType)
- Parameters:
resultType
- type of the mapping target- Returns:
- a parameter binding representing a mapping target parameter
-
forSourceTypeBinding
public static ParameterBinding forSourceTypeBinding(Type sourceType)
- Parameters:
sourceType
- type of the parameter- Returns:
- a parameter binding representing a mapping source type
-
fromSourceRHS
public static ParameterBinding fromSourceRHS(SourceRHS sourceRHS)
-
-