@Beta public interface MutableFieldDeclaration extends MutableMemberDeclaration, FieldDeclaration
Modifier and Type | Method and Description |
---|---|
void |
markAsInitializedBy(ConstructorDeclaration constructorDeclaration)
Indicate that this field is properly initialized by the given constructor.
|
void |
setConstantValueAsBoolean(boolean value)
sets the 'constant' value of this field.
|
void |
setConstantValueAsByte(byte value)
sets the 'constant' value of this field.
|
void |
setConstantValueAsChar(char value)
sets the 'constant' value of this field.
|
void |
setConstantValueAsDouble(double value)
sets the 'constant' value of this field.
|
void |
setConstantValueAsFloat(float value)
sets the 'constant' value of this field.
|
void |
setConstantValueAsInt(int value)
sets the 'constant' value of this field.
|
void |
setConstantValueAsLong(long value)
sets the 'constant' value of this field.
|
void |
setConstantValueAsShort(short value)
sets the 'constant' value of this field.
|
void |
setConstantValueAsString(java.lang.String value)
sets the 'constant' value of this field.
|
void |
setFinal(boolean isFinal)
sets the 'final' property
|
void |
setInitializer(CompilationStrategy initializer)
sets the 'initializer' expression of this field declaration.
|
void |
setInitializer(Expression initializer)
sets the 'initializer' expression of this field declaration.
|
void |
setInitializer(StringConcatenationClient template)
sets the 'initializer' expression of this field declaration.
|
void |
setStatic(boolean isStatic)
sets the 'static' property
|
void |
setTransient(boolean isTransient)
sets the 'transient' property
|
void |
setType(TypeReference type)
sets the 'type' of this field declaration
|
void |
setVolatile(boolean isVolatile)
sets the 'volatile' property
|
getDeclaringType, setDeprecated, setDocComment, setVisibility
markAsRead
addAnnotation, removeAnnotation
setSimpleName
remove
getInitializer, getType, isFinal, isStatic, isTransient, isVolatile
getDocComment, getModifiers, getVisibility, isDeprecated
findAnnotation, getAnnotations
getCompilationUnit, getSimpleName
void setFinal(boolean isFinal)
isFinal
- void setStatic(boolean isStatic)
isStatic
- void setTransient(boolean isTransient)
isTransient
- void setVolatile(boolean isVolatile)
isVolatile
- void setInitializer(Expression initializer)
MutableExecutableDeclaration
or MutableFieldDeclaration
, it
will be detached from there as well.initializer
- void setInitializer(CompilationStrategy initializer)
CompilationStrategy
will be executed later during code generation, not immediately.initializer
- the compilation strategy, must not be null
java.lang.IllegalArgumentException
- if the initializer
is null
void setInitializer(StringConcatenationClient template)
StringConcatenationClient
will be executed later during code generation, not immediately.template
- the compilation template, must not be null
java.lang.IllegalArgumentException
- if the initializer
is null
void setConstantValueAsLong(long value)
value
- the constant valuevoid setConstantValueAsInt(int value)
value
- the constant valuevoid setConstantValueAsShort(short value)
value
- the constant valuevoid setConstantValueAsByte(byte value)
value
- the constant valuevoid setConstantValueAsDouble(double value)
value
- the constant valuevoid setConstantValueAsFloat(float value)
value
- the constant valuevoid setConstantValueAsChar(char value)
value
- the constant valuevoid setConstantValueAsBoolean(boolean value)
value
- the constant valuevoid setConstantValueAsString(java.lang.String value)
value
- the constant value, must not be null
java.lang.IllegalArgumentException
- if the value
is null
void markAsInitializedBy(ConstructorDeclaration constructorDeclaration)
constructorDeclaration
- a constructor that initializes this fieldvoid setType(TypeReference type)
type
- the type, must be not null
java.lang.IllegalArgumentException
- if the type
is null
l