@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 |
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 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