Java org.eclipse.jdt.core.dom CompilationUnit fields, constructors, methods, implement or subclass

Example usage for Java org.eclipse.jdt.core.dom CompilationUnit fields, constructors, methods, implement or subclass

Introduction

In this page you can find the methods, fields and constructors for org.eclipse.jdt.core.dom CompilationUnit.

The text is from its open source code.

Subclass

org.eclipse.jdt.core.dom.CompilationUnit has subclasses.
Click this link to see all its subclasses.

Field

ChildListPropertyDescriptorIMPORTS_PROPERTY
The "imports" structural property of this node type (element type: ImportDeclaration ).
ChildPropertyDescriptorPACKAGE_PROPERTY
The "package" structural property of this node type (child type: PackageDeclaration ).
ChildListPropertyDescriptorTYPES_PROPERTY
The "types" structural property of this node type (element type: AbstractTypeDeclaration ).
ASTNode.NodeListimports
The list of import declarations in textual order order; initially none (elementType: ImportDeclaration).
ASTNode.NodeListtypes
The list of type declarations in textual order order; initially none (elementType: AbstractTypeDeclaration)

Constructor

CompilationUnit(AST ast)
Creates a new AST node for a compilation owned by the given AST.

Method

voidaccept(ASTVisitor visitor)
Accepts the given visitor on a visit of the current node.
ASTNodefindDeclaringNode(IBinding binding)
Finds the corresponding AST node in the given compilation unit from which the given binding originated.
ASTNodefindDeclaringNode(String key)
Finds the corresponding AST node in the given compilation unit from which the binding with the given key originated.
intfirstLeadingCommentIndex(ASTNode node)
Return the index in the whole comments list #getCommentList() of the first leading comments associated with the given node.
ASTgetAST()
Returns this node's AST.
intgetColumnNumber(final int position)
Returns the column number corresponding to the given source character position in the original source string.
ListgetCommentList()
Returns a list of the comments encountered while parsing this compilation unit.
intgetExtendedLength(ASTNode node)
Returns the extended source length of the given node.
intgetExtendedStartPosition(ASTNode node)
Returns the extended start position of the given node.
intgetFlags()
Returns the flags associated with this node.
IJavaElementgetJavaElement()
The Java element (an org.eclipse.jdt.core.ICompilationUnit or an org.eclipse.jdt.core.IClassFile) this compilation unit was created from, or null if it was not created from a Java element.
intgetLength()
Returns the length in characters of the original source file indicating where the source fragment corresponding to this node ends.
intgetLineNumber(int position)
Returns the line number corresponding to the given source character position in the original source string.
Message[]getMessages()
Returns the list of messages reported by the compiler during the parsing or the type checking of this compilation unit.
PackageDeclarationgetPackage()
Returns the node for the package declaration of this compilation unit, or null if this compilation unit is in the default package.
intgetPosition(int line, int column)
Given a line number and column number, returns the corresponding position in the original source string.
IProblem[]getProblems()
Returns the list of detailed problem reports noted by the compiler during the parsing or the type checking of this compilation unit.
ObjectgetProperty(String propertyName)
Returns the value of the named property of this node, or null if none.
ITypeRootgetTypeRoot()
The Java type root (a org.eclipse.jdt.core.ICompilationUnit compilation unit or a org.eclipse.jdt.core.IClassFile class file ) this compilation unit was created from, or null if it was not created from a Java type root.
inthashCode()
voidinitCommentMapper(Scanner scanner)
Initializes the internal comment mapper with the given scanner.
intlastTrailingCommentIndex(ASTNode node)
Return the index in the whole comments list #getCommentList() of the last trailing comments associated with the given node.
intlineNumber(int position)
Returns the line number corresponding to the given source character position in the original source string.
voidrecordModifications()
Enables the recording of changes to this compilation unit and its descendants.
TextEditrewrite(IDocument document, Map options)
Converts all modifications recorded for this compilation unit into an object representing the corresponding text edits to the given document containing the original source code for this compilation unit.
voidsetCommentTable(Comment[] commentTable)
Sets the list of the comments encountered while parsing this compilation unit.
voidsetFlags(int flags)
Sets the flags associated with this node to the given value.
voidsetLineEndTable(int[] lineEndTable)
Sets the line end table for this compilation unit.
voidsetPackage(PackageDeclaration pkgDecl)
Sets or clears the package declaration of this compilation unit node to the given package declaration node.
voidsetProblems(IProblem[] problems)
Sets the array of problems reported by the compiler during the parsing or name resolution of this compilation unit.
voidsetProperty(String propertyName, Object data)
Sets the named property of this node to the given value, or to null to clear it.
voidsetSourceRange(int startPosition, int length)
Sets the source range of the original source file where the source fragment corresponding to this node was found.
voidsetStatementsRecoveryData(Object data)
Internal method Sets internal data used to perform statements recovery.
voidsetTypeRoot(ITypeRoot typeRoot)
Sets the Java type root (a org.eclipse.jdt.core.ICompilationUnit compilation unit or a org.eclipse.jdt.core.IClassFile class file ) this compilation unit was created from, or null if it was not created from a Java type root.
booleansubtreeMatch(ASTMatcher matcher, Object other)
Returns whether the subtree rooted at the given node matches the given other object as decided by the given matcher.
StringtoString()
Returns a string representation of this node suitable for debugging purposes only.