Package | Description |
---|---|
com.github.javaparser.ast | |
com.github.javaparser.ast.body |
Modifier and Type | Method and Description |
---|---|
TypeDeclaration<?> |
CompilationUnit.getType(int i)
Convenience method that wraps
getTypes() .If i is out of bounds, throws IndexOutOfBoundsException. |
Modifier and Type | Method and Description |
---|---|
Optional<TypeDeclaration<?>> |
CompilationUnit.getPrimaryType() |
NodeList<TypeDeclaration<?>> |
CompilationUnit.getTypes()
Return the list of top level types declared in this compilation unit.
If there are no types declared, none is returned. |
Modifier and Type | Method and Description |
---|---|
CompilationUnit |
CompilationUnit.addType(TypeDeclaration<?> type) |
CompilationUnit |
CompilationUnit.setType(int i,
TypeDeclaration<?> type) |
Modifier and Type | Method and Description |
---|---|
CompilationUnit |
CompilationUnit.setTypes(NodeList<TypeDeclaration<?>> types)
Sets the list of types declared in this compilation unit.
|
Constructor and Description |
---|
CompilationUnit(PackageDeclaration packageDeclaration,
NodeList<ImportDeclaration> imports,
NodeList<TypeDeclaration<?>> types,
ModuleDeclaration module) |
CompilationUnit(TokenRange tokenRange,
PackageDeclaration packageDeclaration,
NodeList<ImportDeclaration> imports,
NodeList<TypeDeclaration<?>> types,
ModuleDeclaration module)
This constructor is used by the parser and is considered private.
|
Modifier and Type | Class and Description |
---|---|
class |
TypeDeclaration<T extends TypeDeclaration<?>>
A base class for all types of type declarations.
|
Modifier and Type | Class and Description |
---|---|
class |
AnnotationDeclaration
An annotation type declaration.
@interface X { ... |
class |
ClassOrInterfaceDeclaration
A definition of a class or interface.
class X { ... |
class |
EnumDeclaration
The declaration of an enum.
enum X { ... |
Modifier and Type | Method and Description |
---|---|
TypeDeclaration |
BodyDeclaration.asTypeDeclaration() |
TypeDeclaration |
TypeDeclaration.asTypeDeclaration() |
TypeDeclaration<?> |
TypeDeclaration.clone() |
Modifier and Type | Method and Description |
---|---|
Optional<TypeDeclaration> |
BodyDeclaration.toTypeDeclaration() |
Optional<TypeDeclaration> |
TypeDeclaration.toTypeDeclaration() |
Modifier and Type | Method and Description |
---|---|
void |
BodyDeclaration.ifTypeDeclaration(Consumer<TypeDeclaration> action) |
void |
TypeDeclaration.ifTypeDeclaration(Consumer<TypeDeclaration> action) |
Copyright © 2007–2018. All rights reserved.