public final class FieldDeclaration extends BodyDeclaration<FieldDeclaration> implements NodeWithJavaDoc<FieldDeclaration>, NodeWithElementType<FieldDeclaration>, NodeWithModifiers<FieldDeclaration>, NodeWithVariables<FieldDeclaration>
Node.ObserverRegistrationMode
ABSOLUTE_BEGIN_LINE, ABSOLUTE_END_LINE, NODE_BY_BEGIN_POSITION, prettyPrinterNoCommentsConfiguration
Constructor and Description |
---|
FieldDeclaration() |
FieldDeclaration(EnumSet<Modifier> modifiers,
NodeList<AnnotationExpr> annotations,
Type<?> elementType,
NodeList<ArrayBracketPair> arrayBracketPairsAfterElementType,
NodeList<VariableDeclarator> variables) |
FieldDeclaration(EnumSet<Modifier> modifiers,
Type<?> elementType,
NodeList<VariableDeclarator> variables) |
FieldDeclaration(EnumSet<Modifier> modifiers,
Type<?> type,
String name)
Creates a
FieldDeclaration . |
FieldDeclaration(EnumSet<Modifier> modifiers,
Type<?> elementType,
VariableDeclarator variable) |
FieldDeclaration(Range range,
EnumSet<Modifier> modifiers,
NodeList<AnnotationExpr> annotations,
Type<?> elementType,
NodeList<VariableDeclarator> variables,
NodeList<ArrayBracketPair> arrayBracketPairsAfterElementType) |
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
|
NodeList<ArrayBracketPair> |
getArrayBracketPairsAfterElementType()
Deprecated.
will be removed in 3.0
|
Type<?> |
getElementType()
Deprecated.
will be removed in 3.0
|
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 |
setArrayBracketPairsAfterElementType(NodeList<ArrayBracketPair> arrayBracketPairsAfterType)
Deprecated.
will be removed in 3.0
|
FieldDeclaration |
setElementType(Type<?> elementType)
Deprecated.
will be removed in 3.0
|
FieldDeclaration |
setModifiers(EnumSet<Modifier> modifiers) |
FieldDeclaration |
setVariables(NodeList<VariableDeclarator> variables) |
getAnnotations, setAnnotations
addOrphanComment, clone, containsWithin, equals, getAllContainedComments, getBegin, getChildNodes, getComment, getData, getEnd, getNodesByType, getOrphanComments, getParentNode, getParentNodeForChildren, getRange, hasComment, hashCode, isPositionedAfter, isPositionedBefore, isRegistered, notifyPropertyChange, register, register, registerForSubtree, remove, setAsParentNodeOf, setBlockComment, setComment, setData, setLineComment, setParentNode, setRange, toString, toString, tryAddImportToParentCompilationUnit, unregister
finalize, getClass, notify, notifyAll, wait, wait, wait
setJavaDocComment
setElementType, setElementType
addModifier, isAbstract, isFinal, isNative, isPrivate, isProtected, isPublic, isStatic, isStrictfp, isSynchronized, isTransient, isVolatile
getVariable
addAnnotation, addAnnotation, addMarkerAnnotation, addMarkerAnnotation, addSingleMemberAnnotation, addSingleMemberAnnotation, getAnnotation, getAnnotationByClass, getAnnotationByName, isAnnotationPresent, isAnnotationPresent
getAncestorOfType, setAsParentNodeOf, setAsParentNodeOf
public FieldDeclaration()
public FieldDeclaration(EnumSet<Modifier> modifiers, Type<?> elementType, VariableDeclarator variable)
public FieldDeclaration(EnumSet<Modifier> modifiers, Type<?> elementType, NodeList<VariableDeclarator> variables)
public FieldDeclaration(EnumSet<Modifier> modifiers, NodeList<AnnotationExpr> annotations, Type<?> elementType, NodeList<ArrayBracketPair> arrayBracketPairsAfterElementType, NodeList<VariableDeclarator> variables)
public FieldDeclaration(Range range, EnumSet<Modifier> modifiers, NodeList<AnnotationExpr> annotations, Type<?> elementType, NodeList<VariableDeclarator> variables, NodeList<ArrayBracketPair> arrayBracketPairsAfterElementType)
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
public EnumSet<Modifier> getModifiers()
getModifiers
in interface NodeWithModifiers<FieldDeclaration>
Modifier
public 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()
NodeWithJavaDoc
getJavaDoc
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 enum@Deprecated public Type<?> getElementType()
getElementType
in interface NodeWithElementType<FieldDeclaration>
@Deprecated public FieldDeclaration setElementType(Type<?> elementType)
setElementType
in interface NodeWithElementType<FieldDeclaration>
elementType
- the element elementType@Deprecated public NodeList<ArrayBracketPair> getArrayBracketPairsAfterElementType()
getArrayBracketPairsAfterElementType
in interface NodeWithElementType<FieldDeclaration>
class C { int[] abc; }
@Deprecated public FieldDeclaration setArrayBracketPairsAfterElementType(NodeList<ArrayBracketPair> arrayBracketPairsAfterType)
setArrayBracketPairsAfterElementType
in interface NodeWithElementType<FieldDeclaration>
public List<NodeList<?>> getNodeLists()
Node
getNodeLists
in class BodyDeclaration<FieldDeclaration>
Copyright © 2007–2016. All rights reserved.