Package | Description |
---|---|
com.github.javaparser.ast | |
com.github.javaparser.ast.body | |
com.github.javaparser.ast.nodeTypes |
Modifier and Type | Method and Description |
---|---|
Modifier.Keyword |
Modifier.getKeyword() |
static Modifier.Keyword |
Modifier.Keyword.valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static Modifier.Keyword[] |
Modifier.Keyword.values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
Modifier and Type | Method and Description |
---|---|
AnnotationDeclaration |
CompilationUnit.addAnnotationDeclaration(String name,
Modifier.Keyword... modifiers)
Add an annotation declaration to the types of this compilation unit
|
ClassOrInterfaceDeclaration |
CompilationUnit.addClass(String name,
Modifier.Keyword... modifiers)
Add a class to the types of this compilation unit
|
EnumDeclaration |
CompilationUnit.addEnum(String name,
Modifier.Keyword... modifiers)
Add an enum to the types of this compilation unit
|
ClassOrInterfaceDeclaration |
CompilationUnit.addInterface(String name,
Modifier.Keyword... modifiers)
Add an interface to the types of this compilation unit
|
static NodeList<Modifier> |
Modifier.createModifierList(Modifier.Keyword... modifiers)
Utility method that instantiaties "Modifier"s for the keywords,
and puts them in a NodeList.
|
Modifier |
Modifier.setKeyword(Modifier.Keyword keyword) |
Constructor and Description |
---|
Modifier(Modifier.Keyword keyword) |
Modifier(TokenRange tokenRange,
Modifier.Keyword keyword)
This constructor is used by the parser and is considered private.
|
Modifier and Type | Method and Description |
---|---|
FieldDeclaration |
AnnotationDeclaration.addField(Type type,
String name,
Modifier.Keyword... modifiers) |
Modifier and Type | Method and Description |
---|---|
default ConstructorDeclaration |
NodeWithMembers.addConstructor(Modifier.Keyword... modifiers)
Adds a constructor to this node with members.
|
default FieldDeclaration |
NodeWithMembers.addField(Class<?> typeClass,
String name,
Modifier.Keyword... modifiers)
Add a field to this and automatically add the import of the type if needed
|
default FieldDeclaration |
NodeWithMembers.addField(String type,
String name,
Modifier.Keyword... modifiers)
Add a field to this.
|
default FieldDeclaration |
NodeWithMembers.addField(Type type,
String name,
Modifier.Keyword... modifiers)
Add a field to this.
|
default FieldDeclaration |
NodeWithMembers.addFieldWithInitializer(Class<?> typeClass,
String name,
Expression initializer,
Modifier.Keyword... modifiers)
Add a field to this and automatically add the import of the type if needed
|
default FieldDeclaration |
NodeWithMembers.addFieldWithInitializer(String type,
String name,
Expression initializer,
Modifier.Keyword... modifiers)
Add a field to this.
|
default FieldDeclaration |
NodeWithMembers.addFieldWithInitializer(Type type,
String name,
Expression initializer,
Modifier.Keyword... modifiers)
Add a field to this.
|
default MethodDeclaration |
NodeWithMembers.addMethod(String methodName,
Modifier.Keyword... modifiers)
Adds a methods with void return by default to this.
|
default N |
NodeWithModifiers.addModifier(Modifier.Keyword... newModifiers) |
default boolean |
NodeWithModifiers.hasModifier(Modifier.Keyword modifier) |
default N |
NodeWithModifiers.removeModifier(Modifier.Keyword... modifiersToRemove) |
default N |
NodeWithModifiers.setModifier(Modifier.Keyword m,
boolean set) |
default N |
NodeWithModifiers.setModifiers(Modifier.Keyword... modifiers)
Creates a list of modifier nodes corresponding to the keywords passed, and set it.
|
Copyright © 2007–2021. All rights reserved.