public abstract class AssignmentWrapper extends ModelElement implements Assignment
Assignment.AssignmentType
Writable.Context
Modifier and Type | Field and Description |
---|---|
protected boolean |
fieldAssignment |
Constructor and Description |
---|
AssignmentWrapper(Assignment decoratedAssignment,
boolean fieldAssignment) |
Modifier and Type | Method and Description |
---|---|
String |
createUniqueVarName(String desiredName)
Creates an unique safe (local) variable name.
|
Assignment |
getAssignment() |
Set<Type> |
getImportTypes()
Returns a set containing those
Type s referenced by this model element for which an import statement needs
to be declared. |
String |
getSourceLocalVarName()
|
String |
getSourceLoopVarName()
See
Assignment.getSourceLoopVarName() (java.lang.String) } |
String |
getSourceParameterName()
Returns the source parameter name, to which this assignment applies.
|
String |
getSourcePresenceCheckerReference()
the source presence checker reference
|
String |
getSourceReference()
the source reference being a source-getter, a constant, nested method call, etc.
|
Type |
getSourceType()
the source type used in the matching process
|
List<Type> |
getThrownTypes()
returns all types exception types thrown by this assignment.
|
Assignment.AssignmentType |
getType()
Returns whether the type of assignment
|
boolean |
isCallingUpdateMethod() |
boolean |
isFieldAssignment() |
boolean |
isSourceReferenceParameter() |
void |
setAssignment(Assignment assignment)
An assignment in itself can wrap another assignment.
|
void |
setSourceLocalVarName(String sourceLocalVarName)
Replaces the sourceReference at the call site in the assignment in the template with this sourceLocalVarName.
|
void |
setSourceLoopVarName(String sourceLoopVarName)
Replaces the sourceLocalVar or sourceReference at the call site in the assignment in the template with this
sourceLoopVarName.
|
getTemplateName, getTemplateNameForClass, write
public AssignmentWrapper(Assignment decoratedAssignment, boolean fieldAssignment)
public Set<Type> getImportTypes()
ModelElement
Type
s referenced by this model element for which an import statement needs
to be declared.getImportTypes
in interface Assignment
getImportTypes
in class ModelElement
null
.public List<Type> getThrownTypes()
Assignment
getThrownTypes
in interface Assignment
public void setAssignment(Assignment assignment)
Assignment
setAssignment
in interface Assignment
assignment
- the assignment to setpublic Assignment getAssignment()
public String getSourceReference()
Assignment
getSourceReference
in interface Assignment
public boolean isSourceReferenceParameter()
isSourceReferenceParameter
in interface Assignment
public String getSourcePresenceCheckerReference()
Assignment
getSourcePresenceCheckerReference
in interface Assignment
public Type getSourceType()
Assignment
getSourceType
in interface Assignment
public String getSourceLocalVarName()
Assignment
getSourceLocalVarName
in interface Assignment
public void setSourceLocalVarName(String sourceLocalVarName)
Assignment
setSourceLocalVarName
in interface Assignment
sourceLocalVarName
- source local variable namepublic String getSourceLoopVarName()
Assignment
Assignment.getSourceLoopVarName()
(java.lang.String) }getSourceLoopVarName
in interface Assignment
public void setSourceLoopVarName(String sourceLoopVarName)
Assignment
setSourceLoopVarName
in interface Assignment
sourceLoopVarName
- loop variablepublic String getSourceParameterName()
Assignment
getSourceParameterName
in interface Assignment
public Assignment.AssignmentType getType()
Assignment
getType
in interface Assignment
Assignment.AssignmentType
public boolean isCallingUpdateMethod()
isCallingUpdateMethod
in interface Assignment
public String createUniqueVarName(String desiredName)
Assignment
createUniqueVarName
in interface Assignment
desiredName
- the desired namepublic boolean isFieldAssignment()
true
if the wrapper is for field assignmentCopyright © 2012-2021 MapStruct Authors; All rights reserved. Released under the Apache Software License 2.0.