|
|||||||||
| Home >> All >> org >> eclipse >> jdt >> core >> [ dom overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
org.eclipse.jdt.core.dom
Class EnumConstantDeclaration

java.lang.Objectorg.eclipse.jdt.core.dom.ASTNode
org.eclipse.jdt.core.dom.BodyDeclaration
org.eclipse.jdt.core.dom.EnumConstantDeclaration
- public class EnumConstantDeclaration
- extends BodyDeclaration
Enumeration constant declaration AST node type (added in JLS3 API).
EnumConstantDeclaration:
[ Javadoc ] { ExtendedModifier } Identifier
[ ( [ Expression { , Expression } ] ) ]
[ { { ClassBodyDeclaration | ; } } ]
When a Javadoc comment is present, the source range begins with the first character of the "/**" comment delimiter. When there is no Javadoc comment, the source range begins with the first character of the identifier. If there are class body declarations, the source range extends through the last character of the last character of the "}" token following the body declarations. If there are arguments but no class body declarations, the source range extends through the last character of the ")" token following the arguments. If there are no arguments and no class body declarations, the source range extends through the last character of the identifier.
Note: This API element is only needed for dealing with Java code that uses new language features of J2SE 1.5. It is included in anticipation of J2SE 1.5 support, which is planned for the next release of Eclipse after 3.0, and may change slightly before reaching its final form.
- Since:
- 3.0
| Nested Class Summary |
| Nested classes inherited from class org.eclipse.jdt.core.dom.ASTNode |
ASTNode.NodeList |
| Field Summary | |
private ASTNode.NodeList |
arguments
The list of argument expressions (element type: Expression). |
static ChildListPropertyDescriptor |
ARGUMENTS_PROPERTY
The "arguments" structural property of this node type. |
static ChildListPropertyDescriptor |
BODY_DECLARATIONS_PROPERTY
The "bodyDeclarations" structural property of this node type. |
private ASTNode.NodeList |
bodyDeclarations
The body declarations (element type: BodyDeclaration). |
private SimpleName |
constantName
The constant name; lazily initialized; defaults to a unspecified, legal Java class identifier. |
static ChildPropertyDescriptor |
JAVADOC_PROPERTY
The "javadoc" structural property of this node type. |
static ChildListPropertyDescriptor |
MODIFIERS2_PROPERTY
The "modifiers" structural property of this node type). |
static ChildPropertyDescriptor |
NAME_PROPERTY
The "name" structural property of this node type. |
private static java.util.List |
PROPERTY_DESCRIPTORS
A list of property descriptors (element type: StructuralPropertyDescriptor), or null if uninitialized. |
| Fields inherited from class org.eclipse.jdt.core.dom.BodyDeclaration |
modifiers, optionalDocComment |
| Constructor Summary | |
(package private) |
EnumConstantDeclaration(AST ast)
Creates a new AST node for an enumeration constants declaration owned by the given AST. |
| Method Summary | |
(package private) void |
accept0(ASTVisitor visitor)
Accepts the given visitor on a type-specific visit of the current node. |
(package private) void |
appendDebugString(java.lang.StringBuffer buffer)
Appends a debug representation of this node to the given string buffer. |
java.util.List |
arguments()
Returns the live ordered list of argument expressions in this enumeration constant declaration. |
java.util.List |
bodyDeclarations()
Returns the live ordered list of body declarations of this enumeration constant declaration. |
(package private) ASTNode |
clone0(AST target)
Returns a deep copy of the subtree of AST nodes rooted at this node. |
SimpleName |
getName()
Returns the name of the constant declared in this enum declaration. |
(package private) int |
getNodeType0()
Returns an integer value identifying the type of this concrete AST node. |
(package private) java.util.List |
internalGetChildListProperty(ChildListPropertyDescriptor property)
Returns the list value of the given property for this node. |
(package private) ASTNode |
internalGetSetChildProperty(ChildPropertyDescriptor property,
boolean get,
ASTNode child)
Sets the child value of the given property for this node. |
(package private) ChildPropertyDescriptor |
internalJavadocProperty()
Returns structural property descriptor for the "javadoc" property of this node. |
(package private) ChildListPropertyDescriptor |
internalModifiers2Property()
Returns structural property descriptor for the "modifiers" property of this node. |
(package private) SimplePropertyDescriptor |
internalModifiersProperty()
Returns structural property descriptor for the "modifiers" property of this node. |
(package private) java.util.List |
internalStructuralPropertiesForType(int apiLevel)
Returns a list of property descriptors for this node type. |
(package private) int |
memSize()
Returns an estimate of the memory footprint of this node in bytes. |
static java.util.List |
propertyDescriptors(int apiLevel)
Returns a list of structural property descriptors for this node type. |
IVariableBinding |
resolveVariable()
Resolves and returns the field binding for this enum constant. |
void |
setName(SimpleName constantName)
Sets the name of the constant declared in this enum declaration to the given name. |
(package private) boolean |
subtreeMatch0(ASTMatcher matcher,
java.lang.Object other)
Returns whether the subtree rooted at the given node matches the given other object as decided by the given matcher. |
(package private) int |
treeSize()
Returns an estimate of the memory footprint in bytes of the entire subtree rooted at this node. |
| Methods inherited from class org.eclipse.jdt.core.dom.BodyDeclaration |
getJavadoc, getModifiers, internalJavadocPropertyFactory, internalModifiers2PropertyFactory, internalModifiersPropertyFactory, modifiers, setJavadoc, setModifiers |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
JAVADOC_PROPERTY
public static final ChildPropertyDescriptor JAVADOC_PROPERTY
- The "javadoc" structural property of this node type.
MODIFIERS2_PROPERTY
public static final ChildListPropertyDescriptor MODIFIERS2_PROPERTY
- The "modifiers" structural property of this node type).
NAME_PROPERTY
public static final ChildPropertyDescriptor NAME_PROPERTY
- The "name" structural property of this node type.
ARGUMENTS_PROPERTY
public static final ChildListPropertyDescriptor ARGUMENTS_PROPERTY
- The "arguments" structural property of this node type.
BODY_DECLARATIONS_PROPERTY
public static final ChildListPropertyDescriptor BODY_DECLARATIONS_PROPERTY
- The "bodyDeclarations" structural property of this node type.
PROPERTY_DESCRIPTORS
private static final java.util.List PROPERTY_DESCRIPTORS
- A list of property descriptors (element type:
StructuralPropertyDescriptor),
or null if uninitialized.
constantName
private SimpleName constantName
- The constant name; lazily initialized; defaults to a unspecified,
legal Java class identifier.
arguments
private ASTNode.NodeList arguments
- The list of argument expressions (element type:
Expression). Defaults to an empty list.
bodyDeclarations
private ASTNode.NodeList bodyDeclarations
- The body declarations (element type:
BodyDeclaration). Defaults to an empty list.
| Constructor Detail |
EnumConstantDeclaration
EnumConstantDeclaration(AST ast)
- Creates a new AST node for an enumeration constants declaration owned by
the given AST. By default, the enumeration constant has an unspecified,
but legal, name; no javadoc; an empty list of modifiers and annotations;
an empty list of arguments; and an empty list of body declarations.
N.B. This constructor is package-private; all subclasses must be declared in the same package; clients are unable to declare additional subclasses.
| Method Detail |
propertyDescriptors
public static java.util.List propertyDescriptors(int apiLevel)
- Returns a list of structural property descriptors for this node type.
Clients must not modify the result.
internalStructuralPropertiesForType
final java.util.List internalStructuralPropertiesForType(int apiLevel)
- Description copied from class:
ASTNode - Returns a list of property descriptors for this node type.
Clients must not modify the result. This abstract method
must be implemented in each concrete AST node type.
N.B. This method is package-private, so that the implementations of this method in each of the concrete AST node types do not clutter up the API doc.
- Specified by:
internalStructuralPropertiesForTypein classASTNode
internalGetSetChildProperty
final ASTNode internalGetSetChildProperty(ChildPropertyDescriptor property, boolean get, ASTNode child)
- Description copied from class:
ASTNode - Sets the child value of the given property for this node.
The default implementation of this method throws an exception explaining
that this node does not have such a property. This method should be
extended in subclasses that have at leasy one child property.
- Overrides:
internalGetSetChildPropertyin classASTNode
internalGetChildListProperty
final java.util.List internalGetChildListProperty(ChildListPropertyDescriptor property)
- Description copied from class:
ASTNode - Returns the list value of the given property for this node.
The default implementation of this method throws an exception explaining
that this noed does not have such a property. This method should be
extended in subclasses that have at leasy one child list property.
- Overrides:
internalGetChildListPropertyin classASTNode
internalJavadocProperty
final ChildPropertyDescriptor internalJavadocProperty()
- Description copied from class:
BodyDeclaration - Returns structural property descriptor for the "javadoc" property
of this node.
- Specified by:
internalJavadocPropertyin classBodyDeclaration
internalModifiers2Property
final ChildListPropertyDescriptor internalModifiers2Property()
- Description copied from class:
BodyDeclaration - Returns structural property descriptor for the "modifiers" property
of this node.
- Specified by:
internalModifiers2Propertyin classBodyDeclaration
internalModifiersProperty
final SimplePropertyDescriptor internalModifiersProperty()
- Description copied from class:
BodyDeclaration - Returns structural property descriptor for the "modifiers" property
of this node.
- Specified by:
internalModifiersPropertyin classBodyDeclaration
getNodeType0
final int getNodeType0()
- Description copied from class:
ASTNode - Returns an integer value identifying the type of this concrete AST node.
This internal method is implemented in each of the concrete node subclasses.
- Specified by:
getNodeType0in classASTNode
clone0
ASTNode clone0(AST target)
- Description copied from class:
ASTNode - Returns a deep copy of the subtree of AST nodes rooted at this node.
The resulting nodes are owned by the given AST, which may be different
from the AST of this node. Even if this node has a parent, the
result node will be unparented.
This method must be implemented in subclasses.
This method does not report pre- and post-clone events. All callers should instead call
clone(AST)to ensure that pre- and post-clone events are reported.N.B. This method is package-private, so that the implementations of this method in each of the concrete AST node types do not clutter up the API doc.
subtreeMatch0
final boolean subtreeMatch0(ASTMatcher matcher, java.lang.Object other)
- Description copied from class:
ASTNode - Returns whether the subtree rooted at the given node matches the
given other object as decided by the given matcher.
This internal method is implemented in each of the concrete node subclasses.
- Specified by:
subtreeMatch0in classASTNode
accept0
void accept0(ASTVisitor visitor)
- Description copied from class:
ASTNode - Accepts the given visitor on a type-specific visit of the current node.
This method must be implemented in all concrete AST node types.
General template for implementation on each concrete ASTNode class:
Note that the caller (boolean visitChildren = visitor.visit(this); if (visitChildren) { // visit children in normal left to right reading order acceptChild(visitor, getProperty1()); acceptChildren(visitor, rawListProperty); acceptChild(visitor, getProperty2()); } visitor.endVisit(this);accept) take cares of invokingvisitor.preVisit(this)andvisitor.postVisit(this).
getName
public SimpleName getName()
- Returns the name of the constant declared in this enum declaration.
setName
public void setName(SimpleName constantName)
- Sets the name of the constant declared in this enum declaration to the
given name.
arguments
public java.util.List arguments()
- Returns the live ordered list of argument expressions in this enumeration
constant declaration. Note that an empty list of arguments is equivalent
to not explicitly specifying arguments.
bodyDeclarations
public java.util.List bodyDeclarations()
- Returns the live ordered list of body declarations of this enumeration
constant declaration. Note that an empty list is equivalent to not
explicitly specifying any body declarations.
resolveVariable
public IVariableBinding resolveVariable()
- Resolves and returns the field binding for this enum constant.
Note that bindings are generally unavailable unless requested when the AST is being built.
appendDebugString
void appendDebugString(java.lang.StringBuffer buffer)
- Description copied from class:
ASTNode - Appends a debug representation of this node to the given string buffer.
The
ASTNodeimplementation of this method prints out the entire subtree. Subclasses may override to provide a more succinct representation.- Overrides:
appendDebugStringin classASTNode
memSize
int memSize()
- Description copied from class:
ASTNode - Returns an estimate of the memory footprint of this node in bytes.
The estimate does not include the space occupied by child nodes.
- Overrides:
memSizein classBodyDeclaration
treeSize
int treeSize()
- Description copied from class:
ASTNode - Returns an estimate of the memory footprint in bytes of the entire
subtree rooted at this node.
N.B. This method is package-private, so that the implementations of this method in each of the concrete AST node types do not clutter up the API doc.
|
|||||||||
| Home >> All >> org >> eclipse >> jdt >> core >> [ dom overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC