Class Parameter

All Implemented Interfaces:
Writable

public class Parameter extends ModelElement
A parameter of a mapping method.
Author:
Gunnar Morling
  • Constructor Details

    • Parameter

      public Parameter(String name, Type type)
    • Parameter

      public Parameter(String name, String originalName, Type type)
  • Method Details

    • getElement

      public Element getElement()
    • getName

      public String getName()
    • getOriginalName

      public String getOriginalName()
    • getType

      public Type getType()
    • isMappingTarget

      public boolean isMappingTarget()
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • describe

      public String describe()
    • getImportTypes

      public Set<Type> getImportTypes()
      Description copied from class: ModelElement
      Returns a set containing those Types referenced by this model element for which an import statement needs to be declared.
      Specified by:
      getImportTypes in class ModelElement
      Returns:
      A set with type referenced by this model element. Must not be null.
    • isTargetType

      public boolean isTargetType()
    • isMappingContext

      public boolean isMappingContext()
    • isTargetPropertyName

      public boolean isTargetPropertyName()
    • isSourcePropertyName

      public boolean isSourcePropertyName()
    • isVarArgs

      public boolean isVarArgs()
    • isSourceParameter

      public boolean isSourceParameter()
    • withName

      public Parameter withName(String name)
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • forElementAndType

      public static Parameter forElementAndType(VariableElement element, Type parameterType, boolean isVarArgs)
    • forForgedMappingTarget

      public static Parameter forForgedMappingTarget(Type parameterType)
    • 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 scan
      sourceParameterName - 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)
    • getTargetTypeParameter

      public static Parameter getTargetTypeParameter(List<Parameter> parameters)
    • getSourcePropertyNameParameter

      public static Parameter getSourcePropertyNameParameter(List<Parameter> parameters)
    • getTargetPropertyNameParameter

      public static Parameter getTargetPropertyNameParameter(List<Parameter> parameters)