public final class FieldDeclaration extends BodyDeclaration<FieldDeclaration> implements NodeWithJavadoc<FieldDeclaration>, NodeWithModifiers<FieldDeclaration>, NodeWithVariables<FieldDeclaration>
class X { private static
int a=15*15; }Node.ObserverRegistrationModeABSOLUTE_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(Range range,
EnumSet<Modifier> modifiers,
NodeList<AnnotationExpr> annotations,
NodeList<VariableDeclarator> variables) |
| 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.
|
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
|
JavadocComment |
getJavaDoc()
Gets the JavaDoc for this node.
|
EnumSet<Modifier> |
getModifiers()
Return the modifiers of this member declaration.
|
List<NodeList<?>> |
getNodeLists()
The list of NodeLists owned by this node.
|
NodeList<VariableDeclarator> |
getVariables() |
FieldDeclaration |
setModifiers(EnumSet<Modifier> modifiers) |
FieldDeclaration |
setVariables(NodeList<VariableDeclarator> variables) |
getAnnotations, setAnnotationsaddOrphanComment, clone, containsWithin, equals, getAllContainedComments, getBegin, getChildNodes, getComment, getData, getEnd, getNodesByType, getOrphanComments, getParentNode, getParentNodeForChildren, getRange, hasComment, hashCode, hasJavaDocComment, isPositionedAfter, isPositionedBefore, isRegistered, notifyPropertyChange, register, register, registerForSubtree, remove, removeOrphanComment, setAsParentNodeOf, setBlockComment, setComment, setData, setLineComment, setParentNode, setRange, toString, toString, tryAddImportToParentCompilationUnit, unregisterfinalize, getClass, notify, notifyAll, wait, wait, waitremoveJavaDocComment, setJavaDocCommentaddModifier, isAbstract, isFinal, isNative, isPrivate, isProtected, isPublic, isStatic, isStrictfp, isSynchronized, isTransient, isVolatileaddVariable, getCommonType, getElementType, getVariable, setVariableaddAnnotation, addAnnotation, addAnnotation, addMarkerAnnotation, addMarkerAnnotation, addSingleMemberAnnotation, addSingleMemberAnnotation, getAnnotation, getAnnotationByClass, getAnnotationByName, isAnnotationPresent, isAnnotationPresent, setAnnotationgetAncestorOfType, setAsParentNodeOf, setAsParentNodeOfpublic 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)
public FieldDeclaration(Range range, 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)
Visitableaccept in interface VisitableR - 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)
Visitablepublic EnumSet<Modifier> getModifiers()
getModifiers in interface NodeWithModifiers<FieldDeclaration>Modifierpublic NodeList<VariableDeclarator> getVariables()
getVariables in interface NodeWithVariables<FieldDeclaration>public FieldDeclaration setModifiers(EnumSet<Modifier> modifiers)
setModifiers in interface NodeWithModifiers<FieldDeclaration>public FieldDeclaration setVariables(NodeList<VariableDeclarator> variables)
setVariables in interface NodeWithVariables<FieldDeclaration>public JavadocComment getJavaDoc()
NodeWithJavadocgetJavaDoc in interface NodeWithJavadoc<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 List<NodeList<?>> getNodeLists()
NodegetNodeLists in class BodyDeclaration<FieldDeclaration>Copyright © 2007–2017. All rights reserved.