org.eclipse.jdt.core.dom

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » IDE Eclipse » jdt » org.eclipse.jdt.core.dom 
org.eclipse.jdt.core.dom
Package-level Javadoc The Java DOM/AST is the set of classes that model the source code of a Java program as a structured document.

Package Specification


This package contains the Java DOM/AST classes. An API for manipulating the source code of a Java program as a structured document. In particular, it provides a full abstract syntax tree for a Java compilation unit, which can be queried for resolved type information, and modified. The principal classes are {@link org.eclipse.jdt.core.dom.AST AST} {@link org.eclipse.jdt.core.dom.ASTNode ASTNode}, and {@link org.eclipse.jdt.core.dom.ASTParser ASTParser}.

Java Source File NameTypeComment
AbstractTypeDeclaration.javaClass Abstract subclass for type declaration, enum declaration, and annotation type declaration AST node types.
Annotation.javaClass Abstract base class of AST nodes that represent annotations.
AnnotationBinding.javaClass
AnnotationTypeDeclaration.javaClass Annotation type declaration AST node type (added in JLS3 API).
 AnnotationTypeDeclaration:
 [ Javadoc ] { ExtendedModifier } @ interface Identifier
 { { AnnotationTypeBodyDeclaration | ; } }
 AnnotationTypeBodyDeclaration:
 AnnotationTypeMemberDeclaration
 FieldDeclaration
 TypeDeclaration
 EnumDeclaration
 AnnotationTypeDeclaration
 

The thing to note is that method declaration are replaced by annotation type member declarations in this context.

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 first modifier keyword (if modifiers), or the first character of the "@interface" (if no modifiers).

AnnotationTypeMemberDeclaration.javaClass Annotation type member declaration AST node type (added in JLS3 API).
 AnnotationTypeMemberDeclaration:
 [ Javadoc ] { ExtendedModifier }
 Type Identifier ( ) [ default Expression ] ;
 

Note that annotation type member declarations are only meaningful as elements of AnnotationTypeDeclaration.bodyDeclarations .

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 first modifier keyword (if modifiers), or the first character of the member type (no modifiers).

AnonymousClassDeclaration.javaClass Anonymous class declaration AST node type.
ArrayAccess.javaClass Array access expression AST node type.
ArrayCreation.javaClass Array creation expression AST node type.
ArrayInitializer.javaClass Array initializer AST node type.
ArrayType.javaClass Type node for an array type.
AssertStatement.javaClass Assert statement AST node type.
Assignment.javaClass Assignment expression AST node type.
AST.javaClass Umbrella owner and abstract syntax tree node factory. An AST instance serves as the common owner of any number of AST nodes, and as the factory for creating new AST nodes owned by that instance.

Abstract syntax trees may be hand constructed by clients, using the newTYPE factory methods to create new nodes, and the various setCHILD methods (see org.eclipse.jdt.core.dom.ASTNode ASTNode and its subclasses) to connect them together.

Each AST node belongs to a unique AST instance, called the owning AST. The children of an AST node always have the same owner as their parent node. If a node from one AST is to be added to a different AST, the subtree must be cloned first to ensures that the added nodes have the correct owning AST.

There can be any number of AST nodes owned by a single AST instance that are unparented.

ASTConverter.javaClass Internal class for converting internal compiler ASTs into public ASTs.
ASTMatcher.javaClass Concrete superclass and default implementation of an AST subtree matcher.

For example, to compute whether two ASTs subtrees are structurally isomorphic, use n1.subtreeMatch(new ASTMatcher(), n2) where n1 and n2 are the AST root nodes of the subtrees.

For each different concrete AST node type T there is a public boolean match(T node, Object other) method that matches the given node against another object (typically another AST node, although this is not essential).

ASTNode.javaClass Abstract superclass of all Abstract Syntax Tree (AST) node types.

An AST node represents a Java source code construct, such as a name, type, expression, statement, or declaration.

Each AST node belongs to a unique AST instance, called the owning AST. The children of an AST node always have the same owner as their parent node. If a node from one AST is to be added to a different AST, the subtree must be cloned first to ensure that the added nodes have the correct owning AST.

When an AST node is part of an AST, it has a unique parent node. Clients can navigate upwards, from child to parent, as well as downwards, from parent to child.

ASTParser.javaClass A Java language parser for creating abstract syntax trees (ASTs).

Example: Create basic AST from source string

 char[] source = ...;
 ASTParser parser = ASTParser.newParser(AST.JLS3);  // handles JDK 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6
 parser.setSource(source);
 CompilationUnit result = (CompilationUnit) parser.createAST(null);
 
Once a configured parser instance has been used to create an AST, the settings are automatically reset to their defaults, ready for the parser instance to be reused.

There are a number of configurable features:

ASTRecoveryPropagator.javaClass Internal AST visitor for propagating syntax errors.
ASTRequestor.javaClass An AST requestor handles ASTs for compilation units passed to ASTParser.createASTs.
ASTSyntaxErrorPropagator.javaClass Internal AST visitor for propagating syntax errors.
ASTVisitor.javaClass A visitor for abstract syntax trees.

For each different concrete AST node type T there are a pair of methods:

  • public boolean visit(T node) - Visits the given node to perform some arbitrary operation.
BindingComparator.javaClass Internal helper class for comparing bindings.
BindingResolver.javaClass A binding resolver is an internal mechanism for figuring out the binding for a major declaration, type, or name reference.
Block.javaClass Block statement AST node type.
BlockComment.javaClass Block comment AST node type.

Block comments (also called "traditional" comments in JLS 3.7) begin with "/*", may contain line breaks, and must end with "*/".

BodyDeclaration.javaClass Abstract base class of all AST nodes that represent body declarations that may appear in the body of some kind of class or interface declaration, including anonymous class declarations, enumeration declarations, and enumeration constant declarations.

For JLS2:

 BodyDeclaration:
 ClassDeclaration
 InterfaceDeclaration
 MethodDeclaration
 ConstructorDeclaration
 FieldDeclaration
 Initializer
 
For JLS3, a number of new node types were introduced:
 BodyDeclaration:
 ClassDeclaration
 InterfaceDeclaration
 EnumDeclaration
 MethodDeclaration
 ConstructorDeclaration
 FieldDeclaration
 Initializer
 EnumConstantDeclaration
 AnnotationTypeDeclaration
 AnnotationTypeMemberDeclaration
 

All types of body declarations carry modifiers (and annotations), although they differ in which modifiers are allowed.

BooleanLiteral.javaClass Boolean literal node.
BreakStatement.javaClass Break statement AST node type.
CastExpression.javaClass Cast expression AST node type.
CatchClause.javaClass Catch clause AST node type.
CharacterLiteral.javaClass Character literal nodes.
ChildListPropertyDescriptor.javaClass Descriptor for a child list property of an AST node.
ChildPropertyDescriptor.javaClass Descriptor for a child property of an AST node.
ClassInstanceCreation.javaClass Class instance creation expression AST node type. For JLS2:
 ClassInstanceCreation:
 [ Expression . ] new Name
 ( [ Expression { , Expression } ] )
 [ AnonymousClassDeclaration ]
 
For JLS3, type arguments are added and the type name is generalized to a type so that parameterized types can be instantiated:
 ClassInstanceCreation:
 [ Expression . ]
 new [ < Type { , Type } > ]
 Type ( [ Expression { , Expression } ] )
 [ AnonymousClassDeclaration ]
 

Not all node arragements will represent legal Java constructs.

Comment.javaClass Abstract base class for all AST nodes that represent comments.
CompilationUnit.javaClass Java compilation unit AST node type.
CompilationUnitResolver.javaClass
ConditionalExpression.javaClass Conditional expression AST node type.
ConstructorInvocation.javaClass Alternate constructor invocation statement AST node type.
ContinueStatement.javaClass Continue statement AST node type.
DefaultASTVisitor.javaClass
DefaultBindingResolver.javaClass Internal class for resolving bindings using old ASTs.

IMPORTANT: The methods on this class are synchronized.

DefaultCommentMapper.javaClass Internal class for associating comments with AST nodes.
DefaultValuePairBinding.javaClass Member value pair which compose of default values.
DocCommentParser.javaClass Internal parser used for decoding doc comments.
DoStatement.javaClass Do statement AST node type.
EmptyStatement.javaClass Null statement AST node type.
EnhancedForStatement.javaClass Enhanced For statement AST node type (added in JLS3 API).
EnumConstantDeclaration.javaClass Enumeration constant declaration AST node type (added in JLS3 API).
 EnumConstantDeclaration:
 [ Javadoc ] { ExtendedModifier } Identifier
 [ ( [ Expression { , Expression } ] ) ]
 [ AnonymousClassDeclaration ]
 

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.

EnumDeclaration.javaClass Enum declaration AST node type (added in JLS3 API).
 EnumDeclaration:
 [ Javadoc ] { ExtendedModifier } enum Identifier
 [ implements Type { , Type } ]
 {
 [ EnumConstantDeclaration { , EnumConstantDeclaration } ] [ , ]
 [ ; { ClassBodyDeclaration | ; } ]
 }
 
The EnumDeclaration.enumConstants() list holds the enum constant declarations, while the EnumDeclaration.bodyDeclarations() list holds the class body declarations that appear after the semicolon.

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 first modifier or annotation (if present), or the first character of the "enum" keyword (if no modifiers or annotations).

Expression.javaClass Abstract base class of AST nodes that represent expressions.
ExpressionStatement.javaClass Expression statement AST node type.
FieldAccess.javaClass Field access expression AST node type.
 FieldAccess: 
 Expression . Identifier
 

Note that there are several kinds of expressions that resemble field access expressions: qualified names, this expressions, and super field access expressions.

FieldDeclaration.javaClass Field declaration node type.

This kind of node collects several variable declaration fragments (VariableDeclarationFragment) into a single body declaration (BodyDeclaration), all sharing the same modifiers and base type.

 FieldDeclaration:
 [Javadoc] { ExtendedModifier } Type VariableDeclarationFragment
 { , VariableDeclarationFragment } ;
 

When a Javadoc comment is present, the source range begins with the first character of the "/**" comment delimiter.

ForStatement.javaClass For statement AST node type.
IAnnotationBinding.javaInterface Represents an resolved annotation.
IBinding.javaInterface A binding represents a named entity in the Java language.
IDocElement.javaInterface Internal marker-type interface used to tag node types that can legitimately be included in TagElement.fragments TagElement.fragments() .
IExtendedModifier.javaInterface Common interface for AST nodes that represent modifiers or annotations.
IfStatement.javaClass If statement AST node type.
IMemberValuePairBinding.javaInterface Represents a resolved instance of an annotation's member value pair.
IMethodBinding.javaInterface A method binding represents a method or constructor of a class or interface.
ImportDeclaration.javaClass Import declaration AST node type.
InfixExpression.javaClass Infix expression AST node type.
Initializer.javaClass Static or instance initializer AST node type.
InstanceofExpression.javaClass Instanceof expression AST node type.
InternalASTRewrite.javaClass Internal class: not intended to be used by client.
IPackageBinding.javaInterface A package binding represents a named or unnamed package.
ITypeBinding.javaInterface A type binding represents fully-resolved type.
IVariableBinding.javaInterface A variable binding represents either a field of a class or interface, or a local variable declaration (including formal parameters, local variables, and exception variables).
Javadoc.javaClass AST node for a Javadoc-style doc comment.
LabeledStatement.javaClass Labeled statement AST node type.
LineComment.javaClass End-of-line comment AST node type.

End-of-line comments begin with "//", must end with a line delimiter (as per JLS 3.7), and must not contain line breaks.

Note that this node type is a comment placeholder, and is only useful for recording the source range where a comment was found in a source string.

MarkerAnnotation.javaClass Marker annotation node (added in JLS3 API).
MemberRef.javaClass AST node for a member reference within a doc comment ( Javadoc ).
MemberValuePair.javaClass Member value pair node (added in JLS3 API).
MemberValuePairBinding.javaClass Internal class.
Message.javaClass Error message used to report potential errors found during the AST parsing or name resolution.
MethodBinding.javaClass Internal implementation of method bindings.
MethodDeclaration.javaClass Method declaration AST node type.
MethodInvocation.javaClass Method invocation expression AST node type.
MethodRef.javaClass AST node for a method or constructor reference within a doc comment ( Javadoc ).
MethodRefParameter.javaClass AST node for a parameter within a method reference ( MethodRef ). These nodes only occur within doc comments ( Javadoc ). For JLS2:
 MethodRefParameter:
 Type [ Identifier ]
 
For JLS3, the variable arity indicator was added:
 MethodRefParameter:
 Type [ ... ] [ Identifier ]
 

Note: The 1.5 spec for the Javadoc tool does not mention the possibility of a variable arity indicator in method references.

Modifier.javaClass Modifier node.
NaiveASTFlattener.javaClass Internal AST visitor for serializing an AST in a quick and dirty fashion. For various reasons the resulting string is not necessarily legal Java code; and even if it is legal Java code, it is not necessarily the string that corresponds to the given AST.
Name.javaClass Abstract base class for all AST nodes that represent names.
NodeEventHandler.javaClass A node event handler is an internal mechanism for receiving notification of changes to nodes in an AST.

The default implementation serves as the default event handler that does nothing.

NodeSearcher.javaClass
NormalAnnotation.javaClass Normal annotation node (added in JLS3 API).
NullLiteral.javaClass Null literal node.
NumberLiteral.javaClass Number literal nodes.
PackageBinding.javaClass Internal implementation of package bindings.
PackageDeclaration.javaClass Package declaration AST node type.
ParameterizedType.javaClass Type node for a parameterized type (added in JLS3 API).
ParenthesizedExpression.javaClass Parenthesized expression AST node type.
PostfixExpression.javaClass Postfix expression AST node type.
PrefixExpression.javaClass Prefix expression AST node type.
PrimitiveType.javaClass Primitive type nodes.
QualifiedName.javaClass AST node for a qualified name.
QualifiedType.javaClass Type node for a qualified type (added in JLS3 API).
 QualifiedType:
 Type . SimpleName
 

Not all node arragements will represent legal Java constructs.

RecoveredTypeBinding.javaClass
RecoveredVariableBinding.javaClass
ReturnStatement.javaClass Return statement AST node type.
SimpleName.javaClass AST node for a simple name.
SimplePropertyDescriptor.javaClass Descriptor for a simple property of an AST node.
SimpleType.javaClass Type node for a named class type, a named interface type, or a type variable.
SingleMemberAnnotation.javaClass Single member annotation node (added in JLS3 API).
SingleVariableDeclaration.javaClass Single variable declaration AST node type.
Statement.javaClass Abstract base class of AST nodes that represent statements.
StringLiteral.javaClass String literal nodes.
StructuralPropertyDescriptor.javaClass Abstract base class for property descriptors of AST nodes.
SuperConstructorInvocation.javaClass Super constructor invocation statement AST node type.
SuperFieldAccess.javaClass Simple or qualified "super" field access expression AST node type.
SuperMethodInvocation.javaClass Simple or qualified "super" method invocation expression AST node type.
SwitchCase.javaClass Switch case AST node type.
SwitchStatement.javaClass Switch statement AST node type.
SynchronizedStatement.javaClass Synchronized statement AST node type.
TagElement.javaClass AST node for a tag within a doc comment.
TextElement.javaClass AST node for a text element within a doc comment.
ThisExpression.javaClass Simple or qualified "this" AST node type.
ThrowStatement.javaClass Throw statement AST node type.
TryStatement.javaClass Try statement AST node type.
Type.javaClass Abstract base class of all type AST node types.
TypeBinding.javaClass Internal implementation of type bindings.
TypeDeclaration.javaClass Type declaration AST node type.
TypeDeclarationStatement.javaClass Local type declaration statement AST node type.
TypeLiteral.javaClass Type literal AST node type.
TypeParameter.javaClass Type parameter node (added in JLS3 API).
VariableBinding.javaClass Internal implementation of variable bindings.
VariableDeclaration.javaClass Abstract base class of all AST node types that declare a single local variable.
VariableDeclarationExpression.javaClass Local variable declaration expression AST node type.
VariableDeclarationFragment.javaClass Variable declaration fragment AST node type, used in field declarations, local variable declarations, and ForStatement initializers.
VariableDeclarationStatement.javaClass Local variable declaration statement AST node type.

This kind of node collects several variable declaration fragments (VariableDeclarationFragment) into a statement (Statement), all sharing the same modifiers and base type.

For JLS2:
 VariableDeclarationStatement:
 { Modifier } Type VariableDeclarationFragment 
 { , VariableDeclarationFragment } ;
 
For JLS3, the modifier flags were replaced by a list of modifier nodes (intermixed with annotations):
 VariableDeclarationStatement:
 { ExtendedModifier } Type VariableDeclarationFragment 
 { , VariableDeclarationFragment } ;
 

Note: This type of node is a convenience of sorts.

WhileStatement.javaClass While statement AST node type.
WildcardType.javaClass Type node for a wildcard type (added in JLS3 API).
 WildcardType:
 ? [ ( extends | super) Type ] 
 

Not all node arrangements will represent legal Java constructs.

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.