Module org.eclipse.xtend.lib.macro
Interface MutableFieldDeclaration
- All Superinterfaces:
AnnotationTarget,Declaration,Element,FieldDeclaration,MemberDeclaration,MutableAnnotationTarget,MutableDeclaration,MutableElement,MutableMemberDeclaration,MutableNamedElement,NamedElement
- Author:
- Sven Efftinge
-
Method Summary
Modifier and TypeMethodDescriptionvoidmarkAsInitializedBy(ConstructorDeclaration constructorDeclaration) Indicate that this field is properly initialized by the given constructor.voidsetConstantValueAsBoolean(boolean value) sets the 'constant' value of this field.voidsetConstantValueAsByte(byte value) sets the 'constant' value of this field.voidsetConstantValueAsChar(char value) sets the 'constant' value of this field.voidsetConstantValueAsDouble(double value) sets the 'constant' value of this field.voidsetConstantValueAsFloat(float value) sets the 'constant' value of this field.voidsetConstantValueAsInt(int value) sets the 'constant' value of this field.voidsetConstantValueAsLong(long value) sets the 'constant' value of this field.voidsetConstantValueAsShort(short value) sets the 'constant' value of this field.voidsetConstantValueAsString(String value) sets the 'constant' value of this field.voidsetFinal(boolean isFinal) sets the 'final' propertyvoidsetInitializer(CompilationStrategy initializer) sets the 'initializer' expression of this field declaration.voidsetInitializer(Expression initializer) sets the 'initializer' expression of this field declaration.voidsetInitializer(org.eclipse.xtend2.lib.StringConcatenationClient template) sets the 'initializer' expression of this field declaration.voidsetStatic(boolean isStatic) sets the 'static' propertyvoidsetTransient(boolean isTransient) sets the 'transient' propertyvoidsetType(TypeReference type) sets the 'type' of this field declarationvoidsetVolatile(boolean isVolatile) sets the 'volatile' propertyMethods inherited from interface org.eclipse.xtend.lib.macro.declaration.AnnotationTarget
findAnnotation, getAnnotationsMethods inherited from interface org.eclipse.xtend.lib.macro.declaration.FieldDeclaration
getInitializer, getType, isFinal, isStatic, isTransient, isVolatileMethods inherited from interface org.eclipse.xtend.lib.macro.declaration.MemberDeclaration
getDocComment, getModifiers, getVisibility, isDeprecatedMethods inherited from interface org.eclipse.xtend.lib.macro.declaration.MutableAnnotationTarget
addAnnotation, removeAnnotationMethods inherited from interface org.eclipse.xtend.lib.macro.declaration.MutableDeclaration
markAsReadMethods inherited from interface org.eclipse.xtend.lib.macro.declaration.MutableElement
removeMethods inherited from interface org.eclipse.xtend.lib.macro.declaration.MutableMemberDeclaration
getDeclaringType, setDeprecated, setDocComment, setVisibilityMethods inherited from interface org.eclipse.xtend.lib.macro.declaration.MutableNamedElement
setSimpleNameMethods inherited from interface org.eclipse.xtend.lib.macro.declaration.NamedElement
getCompilationUnit, getSimpleName
-
Method Details
-
setFinal
void setFinal(boolean isFinal) sets the 'final' property- Parameters:
isFinal-
-
setStatic
void setStatic(boolean isStatic) sets the 'static' property- Parameters:
isStatic-
-
setTransient
void setTransient(boolean isTransient) sets the 'transient' property- Parameters:
isTransient-
-
setVolatile
void setVolatile(boolean isVolatile) sets the 'volatile' property- Parameters:
isVolatile-
-
setInitializer
sets the 'initializer' expression of this field declaration. Automatically detaches any previously assigned initializers from this field declaration. If the given expression is assigned to anotherMutableExecutableDeclarationorMutableFieldDeclaration, it will be detached from there as well.- Parameters:
initializer-
-
setInitializer
sets the 'initializer' expression of this field declaration. Automatically detaches any previously assigned initializers from this field declaration. The givenCompilationStrategywill be executed later during code generation, not immediately.- Parameters:
initializer- the compilation strategy, must not benull- Throws:
IllegalArgumentException- if theinitializerisnull
-
setInitializer
void setInitializer(org.eclipse.xtend2.lib.StringConcatenationClient template) sets the 'initializer' expression of this field declaration. Automatically detaches any previously assigned initializers from this field declaration. The givenStringConcatenationClientwill be executed later during code generation, not immediately.- Parameters:
template- the compilation template, must not benull- Throws:
IllegalArgumentException- if theinitializerisnull
-
setConstantValueAsLong
void setConstantValueAsLong(long value) sets the 'constant' value of this field. Automatically detaches any previously assigned initializers from this field declaration. Also marks this field as 'static' and 'final'- Parameters:
value- the constant value- Since:
- 2.8
-
setConstantValueAsInt
void setConstantValueAsInt(int value) sets the 'constant' value of this field. Automatically detaches any previously assigned initializers from this field declaration. Also marks this field as 'static' and 'final'- Parameters:
value- the constant value- Since:
- 2.8
-
setConstantValueAsShort
void setConstantValueAsShort(short value) sets the 'constant' value of this field. Automatically detaches any previously assigned initializers from this field declaration. Also marks this field as 'static' and 'final'- Parameters:
value- the constant value- Since:
- 2.8
-
setConstantValueAsByte
void setConstantValueAsByte(byte value) sets the 'constant' value of this field. Automatically detaches any previously assigned initializers from this field declaration. Also marks this field as 'static' and 'final'- Parameters:
value- the constant value- Since:
- 2.8
-
setConstantValueAsDouble
void setConstantValueAsDouble(double value) sets the 'constant' value of this field. Automatically detaches any previously assigned initializers from this field declaration. Also marks this field as 'static' and 'final'- Parameters:
value- the constant value- Since:
- 2.8
-
setConstantValueAsFloat
void setConstantValueAsFloat(float value) sets the 'constant' value of this field. Automatically detaches any previously assigned initializers from this field declaration. Also marks this field as 'static' and 'final'- Parameters:
value- the constant value- Since:
- 2.8
-
setConstantValueAsChar
void setConstantValueAsChar(char value) sets the 'constant' value of this field. Automatically detaches any previously assigned initializers from this field declaration. Also marks this field as 'static' and 'final'- Parameters:
value- the constant value- Since:
- 2.8
-
setConstantValueAsBoolean
void setConstantValueAsBoolean(boolean value) sets the 'constant' value of this field. Automatically detaches any previously assigned initializers from this field declaration. Also marks this field as 'static' and 'final'- Parameters:
value- the constant value- Since:
- 2.8
-
setConstantValueAsString
sets the 'constant' value of this field. Automatically detaches any previously assigned initializers from this field declaration. Also marks this field as 'static' and 'final'- Parameters:
value- the constant value, must not benull- Throws:
IllegalArgumentException- if thevalueisnull- Since:
- 2.8
-
markAsInitializedBy
Indicate that this field is properly initialized by the given constructor.- Parameters:
constructorDeclaration- a constructor that initializes this field- Since:
- 2.7
-
setType
sets the 'type' of this field declaration- Parameters:
type- the type, must be notnull- Throws:
IllegalArgumentException- if thetypeisnulll
-