Package org.mapstruct.ap.internal.model
Class Field
java.lang.Object
org.mapstruct.ap.internal.writer.FreeMarkerWritable
org.mapstruct.ap.internal.model.common.ModelElement
org.mapstruct.ap.internal.model.Field
- All Implemented Interfaces:
Writable
- Direct Known Subclasses:
MapperReference,SupportingField
A field of a mapper type, e.g. a reference to another mapper.
- Author:
- Gunnar Morling
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.mapstruct.ap.internal.writer.Writable
Writable.Context -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleangetFieldNames(Set<Field> fields) Returns a set containing thoseTypes referenced by this model element for which an import statement needs to be declared.getType()Returns the type of this field.Returns the variable name of this field.inthashCode()booleanfield needs to be importedbooleanisUsed()indicates whether the field is indeed usedvoidsetTypeRequiresImport(boolean typeRequiresImport) set field needs to be importedvoidsetUsed(boolean isUsed) sets the field as being usedMethods inherited from class org.mapstruct.ap.internal.writer.FreeMarkerWritable
getTemplateName, getTemplateNameForClass, write
-
Constructor Details
-
Field
-
Field
-
-
Method Details
-
getType
Returns the type of this field.- Returns:
- the type of this field
-
getVariableName
Returns the variable name of this field.- Returns:
- the variable name of this reference
-
getImportTypes
Description copied from class:ModelElementReturns a set containing thoseTypes referenced by this model element for which an import statement needs to be declared.- Specified by:
getImportTypesin classModelElement- Returns:
- A set with type referenced by this model element. Must not be
null.
-
isUsed
public boolean isUsed()indicates whether the field is indeed used- Returns:
- true when field is used
-
setUsed
public void setUsed(boolean isUsed) sets the field as being used- Parameters:
isUsed- must be true when being used.
-
isTypeRequiresImport
public boolean isTypeRequiresImport()field needs to be imported- Returns:
- true if the type should be included in the import of the generated type
-
setTypeRequiresImport
public void setTypeRequiresImport(boolean typeRequiresImport) set field needs to be imported- Parameters:
typeRequiresImport- needs to be imported
-
hashCode
public int hashCode() -
equals
-
getFieldNames
-