NodeWithAccessModifiers<T>
, NodeWithPrivateModifier<T>
, NodeWithProtectedModifier<T>
, NodeWithPublicModifier<T>
, NodeWithStaticModifier<T>
, NodeWithStrictfpModifier<T>
, NodeWithAnnotations<T>
, NodeWithJavadoc<T>
, NodeWithMembers<T>
, NodeWithModifiers<T>
, NodeWithRange<T>
, NodeWithSimpleName<T>
, NodeWithTokenRange<T>
, Observable
, Visitable
, HasParentNode<T>
, Cloneable
AnnotationDeclaration
, ClassOrInterfaceDeclaration
, EnumDeclaration
public abstract class TypeDeclaration<T extends TypeDeclaration<?>> extends BodyDeclaration<T> implements NodeWithSimpleName<T>, NodeWithJavadoc<T>, NodeWithMembers<T>, NodeWithAccessModifiers<T>, NodeWithStaticModifier<T>, NodeWithStrictfpModifier<T>
Node.ObserverRegistrationMode, Node.Parsedness
ABSOLUTE_BEGIN_LINE, ABSOLUTE_END_LINE, NODE_BY_BEGIN_POSITION, prettyPrinterNoCommentsConfiguration
Constructor | Description |
---|---|
TypeDeclaration() |
|
TypeDeclaration(TokenRange tokenRange,
EnumSet<Modifier> modifiers,
NodeList<AnnotationExpr> annotations,
SimpleName name,
NodeList<BodyDeclaration<?>> members) |
This constructor is used by the parser and is considered private.
|
TypeDeclaration(EnumSet<Modifier> modifiers,
NodeList<AnnotationExpr> annotations,
SimpleName name,
NodeList<BodyDeclaration<?>> members) |
|
TypeDeclaration(EnumSet<Modifier> modifiers,
String name) |
Modifier and Type | Method | Description |
---|---|---|
T |
addMember(BodyDeclaration<?> decl) |
Adds the given declaration to the specified type.
|
TypeDeclaration<?> |
clone() |
|
List<CallableDeclaration<?>> |
getCallablesWithSignature(CallableDeclaration.Signature signature) |
|
NodeList<BodyDeclaration<?>> |
getMembers() |
|
TypeDeclarationMetaModel |
getMetaModel() |
|
EnumSet<Modifier> |
getModifiers() |
Return the modifiers of this type declaration.
|
SimpleName |
getName() |
|
List<NodeList<?>> |
getNodeLists() |
The list of NodeLists owned by this node.
|
boolean |
isNestedType() |
|
boolean |
isTopLevelType() |
|
boolean |
remove(Node node) |
|
boolean |
replace(Node node,
Node replacementNode) |
|
T |
setMembers(NodeList<BodyDeclaration<?>> members) |
|
T |
setModifiers(EnumSet<Modifier> modifiers) |
|
T |
setName(SimpleName name) |
getAnnotations, setAnnotations
getAncestorOfType
addOrphanComment, customInitialization, equals, getAllContainedComments, getChildNodes, getChildNodesByType, getComment, getData, getNodesByType, getOrphanComments, getParentNode, getParentNodeForChildren, getParsed, getRange, getTokenRange, hasComment, hashCode, isRegistered, notifyPropertyChange, register, register, registerForSubtree, remove, removeComment, removeForced, removeOrphanComment, replace, setAsParentNodeOf, setAsParentNodeOf, setBlockComment, setComment, setData, setLineComment, setParentNode, setParsed, setRange, setTokenRange, toString, toString, tryAddImportToParentCompilationUnit, unregister
addAndGetAnnotation, addAndGetAnnotation, addAnnotation, addAnnotation, addAnnotation, addMarkerAnnotation, addMarkerAnnotation, addSingleMemberAnnotation, addSingleMemberAnnotation, addSingleMemberAnnotation, getAnnotation, getAnnotationByClass, getAnnotationByName, isAnnotationPresent, isAnnotationPresent, setAnnotation, tryAddImportToParentCompilationUnit
getComment, getJavadoc, getJavadocComment, hasJavaDocComment, removeJavaDocComment, setComment, setJavadocComment, setJavadocComment, setJavadocComment
addField, addField, addField, addInitializer, addMethod, addPrivateField, addPrivateField, addProtectedField, addProtectedField, addPublicField, addPublicField, addStaticInitializer, getFieldByName, getFields, getMember, getMethods, getMethodsByName, getMethodsByParameterTypes, getMethodsByParameterTypes, getMethodsBySignature, setMember, tryAddImportToParentCompilationUnit
addModifier, removeModifier, setModifier
isPrivate, setPrivate
isProtected, setProtected
isPublic, setPublic
containsWithin, getBegin, getEnd, isPositionedAfter, isPositionedBefore
getNameAsString, setName
isStatic, setStatic
isStrictfp, setStrictfp
public TypeDeclaration()
public TypeDeclaration(EnumSet<Modifier> modifiers, NodeList<AnnotationExpr> annotations, SimpleName name, NodeList<BodyDeclaration<?>> members)
@Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") public TypeDeclaration(TokenRange tokenRange, EnumSet<Modifier> modifiers, NodeList<AnnotationExpr> annotations, SimpleName name, NodeList<BodyDeclaration<?>> members)
public T addMember(BodyDeclaration<?> decl)
addMember
in interface NodeWithMembers<T extends TypeDeclaration<?>>
decl
- member declaration@Generated("com.github.javaparser.generator.core.node.PropertyGenerator") public NodeList<BodyDeclaration<?>> getMembers()
getMembers
in interface NodeWithMembers<T extends TypeDeclaration<?>>
@Generated("com.github.javaparser.generator.core.node.PropertyGenerator") public EnumSet<Modifier> getModifiers()
getModifiers
in interface NodeWithModifiers<T extends TypeDeclaration<?>>
Modifier
@Generated("com.github.javaparser.generator.core.node.PropertyGenerator") public T setMembers(NodeList<BodyDeclaration<?>> members)
setMembers
in interface NodeWithMembers<T extends TypeDeclaration<?>>
@Generated("com.github.javaparser.generator.core.node.PropertyGenerator") public T setModifiers(EnumSet<Modifier> modifiers)
setModifiers
in interface NodeWithModifiers<T extends TypeDeclaration<?>>
@Generated("com.github.javaparser.generator.core.node.PropertyGenerator") public T setName(SimpleName name)
setName
in interface NodeWithSimpleName<T extends TypeDeclaration<?>>
@Generated("com.github.javaparser.generator.core.node.PropertyGenerator") public SimpleName getName()
getName
in interface NodeWithSimpleName<T extends TypeDeclaration<?>>
public List<NodeList<?>> getNodeLists()
Node
getNodeLists
in class BodyDeclaration<T extends TypeDeclaration<?>>
@Generated("com.github.javaparser.generator.core.node.RemoveMethodGenerator") public boolean remove(Node node)
remove
in class BodyDeclaration<T extends TypeDeclaration<?>>
public boolean isTopLevelType()
public List<CallableDeclaration<?>> getCallablesWithSignature(CallableDeclaration.Signature signature)
public boolean isNestedType()
@Generated("com.github.javaparser.generator.core.node.CloneGenerator") public TypeDeclaration<?> clone()
clone
in class BodyDeclaration<T extends TypeDeclaration<?>>
@Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator") public TypeDeclarationMetaModel getMetaModel()
getMetaModel
in class BodyDeclaration<T extends TypeDeclaration<?>>
@Generated("com.github.javaparser.generator.core.node.ReplaceMethodGenerator") public boolean replace(Node node, Node replacementNode)
replace
in class BodyDeclaration<T extends TypeDeclaration<?>>
Copyright © 2007–2019. All rights reserved.