Interface MutableFieldDeclaration
-
- All Superinterfaces:
AnnotationTarget,Declaration,Element,FieldDeclaration,MemberDeclaration,MutableAnnotationTarget,MutableDeclaration,MutableElement,MutableMemberDeclaration,MutableNamedElement,NamedElement
@Beta public interface MutableFieldDeclaration extends MutableMemberDeclaration, FieldDeclaration
- Noimplement:
- This interface is not intended to be implemented by clients.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidmarkAsInitializedBy(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(java.lang.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' property-
Methods inherited from interface org.eclipse.xtend.lib.macro.declaration.AnnotationTarget
findAnnotation, getAnnotations
-
Methods inherited from interface org.eclipse.xtend.lib.macro.declaration.FieldDeclaration
getInitializer, getType, isFinal, isStatic, isTransient, isVolatile
-
Methods inherited from interface org.eclipse.xtend.lib.macro.declaration.MemberDeclaration
getDocComment, getModifiers, getVisibility, isDeprecated
-
Methods inherited from interface org.eclipse.xtend.lib.macro.declaration.MutableAnnotationTarget
addAnnotation, removeAnnotation
-
Methods inherited from interface org.eclipse.xtend.lib.macro.declaration.MutableDeclaration
markAsRead
-
Methods inherited from interface org.eclipse.xtend.lib.macro.declaration.MutableElement
remove
-
Methods inherited from interface org.eclipse.xtend.lib.macro.declaration.MutableMemberDeclaration
getDeclaringType, setDeprecated, setDocComment, setVisibility
-
Methods inherited from interface org.eclipse.xtend.lib.macro.declaration.MutableNamedElement
setSimpleName
-
Methods inherited from interface org.eclipse.xtend.lib.macro.declaration.NamedElement
getCompilationUnit, getSimpleName
-
-
-
-
Method Detail
-
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
void setInitializer(Expression initializer)
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
void setInitializer(CompilationStrategy initializer)
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:
java.lang.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:
java.lang.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
void setConstantValueAsString(java.lang.String 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, must not benull- Throws:
java.lang.IllegalArgumentException- if thevalueisnull- Since:
- 2.8
-
markAsInitializedBy
void markAsInitializedBy(ConstructorDeclaration constructorDeclaration)
Indicate that this field is properly initialized by the given constructor.- Parameters:
constructorDeclaration- a constructor that initializes this field- Since:
- 2.7
-
setType
void setType(TypeReference type)
sets the 'type' of this field declaration- Parameters:
type- the type, must be notnull- Throws:
java.lang.IllegalArgumentException- if thetypeisnulll
-
-