public final class FieldDeclaration extends BodyDeclaration<FieldDeclaration> implements NodeWithJavadoc<FieldDeclaration>, NodeWithVariables<FieldDeclaration>, NodeWithAccessModifiers<FieldDeclaration>, NodeWithStaticModifier<FieldDeclaration>, NodeWithFinalModifier<FieldDeclaration>
class X { private static
int a=15*15; }
Node.ObserverRegistrationMode, Node.Parsedness
ABSOLUTE_BEGIN_LINE, ABSOLUTE_END_LINE, NODE_BY_BEGIN_POSITION, prettyPrinterNoCommentsConfiguration
Constructor and Description |
---|
FieldDeclaration() |
FieldDeclaration(EnumSet<Modifier> modifiers,
NodeList<AnnotationExpr> annotations,
NodeList<VariableDeclarator> variables) |
FieldDeclaration(EnumSet<Modifier> modifiers,
NodeList<VariableDeclarator> variables) |
FieldDeclaration(EnumSet<Modifier> modifiers,
Type type,
String name)
Creates a
FieldDeclaration . |
FieldDeclaration(EnumSet<Modifier> modifiers,
VariableDeclarator variable) |
FieldDeclaration(TokenRange tokenRange,
EnumSet<Modifier> modifiers,
NodeList<AnnotationExpr> annotations,
NodeList<VariableDeclarator> variables)
This constructor is used by the parser and is considered private.
|
Modifier and Type | Method and Description |
---|---|
<R,A> R |
accept(GenericVisitor<R,A> v,
A arg)
Accept method for visitor support.
|
<A> void |
accept(VoidVisitor<A> v,
A arg)
Accept method for visitor support.
|
FieldDeclaration |
clone() |
MethodDeclaration |
createGetter()
Create a getter for this field, will only work if this field declares only 1 identifier and if this field is
already added to a ClassOrInterfaceDeclaration
|
MethodDeclaration |
createSetter()
Create a setter for this field, will only work if this field declares only 1 identifier and if this field is
already added to a ClassOrInterfaceDeclaration
|
FieldDeclarationMetaModel |
getMetaModel() |
EnumSet<Modifier> |
getModifiers()
Return the modifiers of this member declaration.
|
List<NodeList<?>> |
getNodeLists()
The list of NodeLists owned by this node.
|
NodeList<VariableDeclarator> |
getVariables() |
boolean |
isTransient() |
boolean |
isVolatile() |
boolean |
remove(Node node) |
boolean |
replace(Node node,
Node replacementNode) |
FieldDeclaration |
setModifiers(EnumSet<Modifier> modifiers) |
FieldDeclaration |
setTransient(boolean set) |
FieldDeclaration |
setVariables(NodeList<VariableDeclarator> variables) |
FieldDeclaration |
setVolatile(boolean set) |
getAnnotations, setAnnotations
addOrphanComment, customInitialization, equals, getAllContainedComments, getChildNodes, getChildNodesByType, getComment, getData, getNodesByType, getOrphanComments, getParentNode, getParentNodeForChildren, getParsed, getRange, getTokenRange, hasComment, hashCode, isRegistered, notifyPropertyChange, register, register, registerForSubtree, remove, removeComment, removeForced, removeOrphanComment, replace, setAsParentNodeOf, setAsParentNodeOf, setBlockComment, setComment, setData, setLineComment, setParentNode, setParsed, setRange, setTokenRange, toString, toString, tryAddImportToParentCompilationUnit, unregister
finalize, getClass, notify, notifyAll, wait, wait, wait
getComment, getJavadoc, getJavadocComment, hasJavaDocComment, removeJavaDocComment, setComment, setJavadocComment, setJavadocComment, setJavadocComment
addVariable, calculateMaximumCommonType, getCommonType, getElementType, getMaximumCommonType, getVariable, setVariable
isPublic, setPublic
isPrivate, setPrivate
isProtected, setProtected
addModifier, removeModifier, setModifier
isStatic, setStatic
isFinal, setFinal
addAndGetAnnotation, addAndGetAnnotation, addAnnotation, addAnnotation, addAnnotation, addMarkerAnnotation, addMarkerAnnotation, addSingleMemberAnnotation, addSingleMemberAnnotation, addSingleMemberAnnotation, getAnnotation, getAnnotationByClass, getAnnotationByName, isAnnotationPresent, isAnnotationPresent, setAnnotation, tryAddImportToParentCompilationUnit
getAncestorOfType
containsWithin, getBegin, getEnd, isPositionedAfter, isPositionedBefore
public FieldDeclaration()
public FieldDeclaration(EnumSet<Modifier> modifiers, VariableDeclarator variable)
public FieldDeclaration(EnumSet<Modifier> modifiers, NodeList<VariableDeclarator> variables)
public FieldDeclaration(EnumSet<Modifier> modifiers, NodeList<AnnotationExpr> annotations, NodeList<VariableDeclarator> variables)
@Generated(value="com.github.javaparser.generator.core.node.MainConstructorGenerator") public FieldDeclaration(TokenRange tokenRange, EnumSet<Modifier> modifiers, NodeList<AnnotationExpr> annotations, NodeList<VariableDeclarator> variables)
public FieldDeclaration(EnumSet<Modifier> modifiers, Type type, String name)
FieldDeclaration
.modifiers
- modifierstype
- typename
- field namepublic <R,A> R accept(GenericVisitor<R,A> v, A arg)
Visitable
accept
in interface Visitable
R
- the type of the return value of the visitorA
- the type the user argument passed to the visitorv
- the visitor implementationarg
- the argument passed to the visitor (of type A)public <A> void accept(VoidVisitor<A> v, A arg)
Visitable
@Generated(value="com.github.javaparser.generator.core.node.PropertyGenerator") public EnumSet<Modifier> getModifiers()
getModifiers
in interface NodeWithModifiers<FieldDeclaration>
Modifier
@Generated(value="com.github.javaparser.generator.core.node.PropertyGenerator") public NodeList<VariableDeclarator> getVariables()
getVariables
in interface NodeWithVariables<FieldDeclaration>
@Generated(value="com.github.javaparser.generator.core.node.PropertyGenerator") public FieldDeclaration setModifiers(EnumSet<Modifier> modifiers)
setModifiers
in interface NodeWithModifiers<FieldDeclaration>
@Generated(value="com.github.javaparser.generator.core.node.PropertyGenerator") public FieldDeclaration setVariables(NodeList<VariableDeclarator> variables)
setVariables
in interface NodeWithVariables<FieldDeclaration>
public MethodDeclaration createGetter()
MethodDeclaration
createdIllegalStateException
- if there is more than 1 variable identifier or if this field isn't attached to a
class or enumpublic MethodDeclaration createSetter()
MethodDeclaration
createdIllegalStateException
- if there is more than 1 variable identifier or if this field isn't attached to a
class or enumpublic boolean isTransient()
public boolean isVolatile()
public FieldDeclaration setTransient(boolean set)
public FieldDeclaration setVolatile(boolean set)
@Generated(value="com.github.javaparser.generator.core.node.GetNodeListsGenerator") public List<NodeList<?>> getNodeLists()
Node
getNodeLists
in class BodyDeclaration<FieldDeclaration>
@Generated(value="com.github.javaparser.generator.core.node.RemoveMethodGenerator") public boolean remove(Node node)
remove
in class BodyDeclaration<FieldDeclaration>
@Generated(value="com.github.javaparser.generator.core.node.CloneGenerator") public FieldDeclaration clone()
clone
in class BodyDeclaration<FieldDeclaration>
@Generated(value="com.github.javaparser.generator.core.node.GetMetaModelGenerator") public FieldDeclarationMetaModel getMetaModel()
getMetaModel
in class BodyDeclaration<FieldDeclaration>
@Generated(value="com.github.javaparser.generator.core.node.ReplaceMethodGenerator") public boolean replace(Node node, Node replacementNode)
replace
in class BodyDeclaration<FieldDeclaration>
Copyright © 2007–2017. All rights reserved.