public class ClassOrInterfaceDeclaration extends TypeDeclaration<ClassOrInterfaceDeclaration> implements NodeWithImplements<ClassOrInterfaceDeclaration>, NodeWithExtends<ClassOrInterfaceDeclaration>, NodeWithTypeParameters<ClassOrInterfaceDeclaration>, NodeWithAbstractModifier<ClassOrInterfaceDeclaration>, NodeWithFinalModifier<ClassOrInterfaceDeclaration>, Resolvable<ResolvedReferenceTypeDeclaration>
class X { ... }
interface X { ... }
Node.BreadthFirstIterator, Node.DirectChildrenIterator, Node.ObserverRegistrationMode, Node.ParentsVisitor, Node.Parsedness, Node.PostOrderIterator, Node.PreOrderIterator, Node.TreeTraversal
ABSOLUTE_BEGIN_LINE, ABSOLUTE_END_LINE, LINE_SEPARATOR_KEY, NODE_BY_BEGIN_POSITION, PHANTOM_KEY, prettyPrinterNoCommentsConfiguration, PRINTER_KEY, SYMBOL_RESOLVER_KEY
Constructor and Description |
---|
ClassOrInterfaceDeclaration() |
ClassOrInterfaceDeclaration(NodeList<Modifier> modifiers,
boolean isInterface,
String name) |
ClassOrInterfaceDeclaration(NodeList<Modifier> modifiers,
NodeList<AnnotationExpr> annotations,
boolean isInterface,
SimpleName name,
NodeList<TypeParameter> typeParameters,
NodeList<ClassOrInterfaceType> extendedTypes,
NodeList<ClassOrInterfaceType> implementedTypes,
NodeList<ClassOrInterfaceType> permittedTypes,
NodeList<BodyDeclaration<?>> members) |
ClassOrInterfaceDeclaration(TokenRange tokenRange,
NodeList<Modifier> modifiers,
NodeList<AnnotationExpr> annotations,
boolean isInterface,
SimpleName name,
NodeList<TypeParameter> typeParameters,
NodeList<ClassOrInterfaceType> extendedTypes,
NodeList<ClassOrInterfaceType> implementedTypes,
NodeList<ClassOrInterfaceType> permittedTypes,
NodeList<BodyDeclaration<?>> members)
This constructor is used by the parser and is considered private.
|
addMember, asTypeDeclaration, getCallablesWithSignature, getMembers, getModifiers, getName, ifTypeDeclaration, isNestedType, isTopLevelType, isTypeDeclaration, setMembers, setModifiers, setName, toTypeDeclaration
asAnnotationDeclaration, asAnnotationMemberDeclaration, asCallableDeclaration, asCompactConstructorDeclaration, asConstructorDeclaration, asEnumConstantDeclaration, asEnumDeclaration, asFieldDeclaration, asInitializerDeclaration, asMethodDeclaration, asRecordDeclaration, getAnnotations, ifAnnotationDeclaration, ifAnnotationMemberDeclaration, ifCallableDeclaration, ifCompactConstructorDeclaration, ifConstructorDeclaration, ifEnumConstantDeclaration, ifEnumDeclaration, ifFieldDeclaration, ifInitializerDeclaration, ifMethodDeclaration, ifRecordDeclaration, isAnnotationDeclaration, isAnnotationMemberDeclaration, isCallableDeclaration, isCompactConstructorDeclaration, isConstructorDeclaration, isEnumConstantDeclaration, isEnumDeclaration, isFieldDeclaration, isInitializerDeclaration, isMethodDeclaration, isRecordDeclaration, setAnnotations, toAnnotationDeclaration, toAnnotationMemberDeclaration, toCallableDeclaration, toCompactConstructorDeclaration, toConstructorDeclaration, toEnumConstantDeclaration, toEnumDeclaration, toFieldDeclaration, toInitializerDeclaration, toMethodDeclaration, toRecordDeclaration
addOrphanComment, containsData, createDefaultPrinter, createDefaultPrinter, customInitialization, equals, findAll, findAll, findAll, findByRange, findCompilationUnit, findData, findFirst, findFirst, findFirst, findRootNode, getAllContainedComments, getChildNodes, getChildNodesByType, getComment, getData, getDataKeys, getDefaultPrinterConfiguration, getLineEndingStyle, getLineEndingStyleOrDefault, getNodesByType, getOrphanComments, getParentNode, getParentNodeForChildren, getParsed, getPrinter, getPrinter, getRange, getSymbolResolver, getTokenRange, hashCode, hasScope, isAncestorOf, isPhantom, isRegistered, notifyPropertyChange, register, register, registerForSubtree, remove, removeComment, removeData, removeForced, removeOrphanComment, replace, setAsParentNodeOf, setAsParentNodeOf, setBlockComment, setComment, setData, setLineComment, setParentNode, setParsed, setRange, setTokenRange, stream, stream, toString, toString, tryAddImportToParentCompilationUnit, unregister, walk, walk, walk
finalize, getClass, notify, notifyAll, wait, wait, wait
addImplementedType, addImplementedType, addImplementedType, addImplements, addImplements, getImplementedTypes, setImplementedType, tryAddImportToParentCompilationUnit
addExtendedType, addExtendedType, addExtendedType, addExtends, addExtends, getExtendedTypes, setExtendedType, tryAddImportToParentCompilationUnit
addTypeParameter, addTypeParameter, getTypeParameter, isGeneric, setTypeParameter
isAbstract, setAbstract
isFinal, setFinal
addModifier, getAccessSpecifier, getModifiers, hasModifier, removeModifier, setModifier, setModifiers, setModifiers
getComment, getJavadoc, getJavadocComment, hasJavaDocComment, removeJavaDocComment, setComment, setJavadocComment, setJavadocComment, setJavadocComment, setJavadocComment
addConstructor, addField, addField, addField, addFieldWithInitializer, addFieldWithInitializer, addFieldWithInitializer, addInitializer, addMethod, addPrivateField, addPrivateField, addPrivateField, addProtectedField, addProtectedField, addProtectedField, addPublicField, addPublicField, addPublicField, addStaticInitializer, getConstructorByParameterTypes, getConstructorByParameterTypes, getConstructors, getDefaultConstructor, getFieldByName, getFields, getMember, getMethods, getMethodsByName, getMethodsByParameterTypes, getMethodsByParameterTypes, getMethodsBySignature, isEmpty, setMember, tryAddImportToParentCompilationUnit
getNameAsExpression, getNameAsString, setName
isPublic, setPublic
isPrivate, setPrivate
isProtected, setProtected
isStatic, setStatic
isStrictfp, setStrictfp
addAndGetAnnotation, addAndGetAnnotation, addAnnotation, addAnnotation, addAnnotation, addMarkerAnnotation, addMarkerAnnotation, addSingleMemberAnnotation, addSingleMemberAnnotation, addSingleMemberAnnotation, addSingleMemberAnnotation, getAnnotation, getAnnotationByClass, getAnnotationByName, isAnnotationPresent, isAnnotationPresent, setAnnotation, tryAddImportToParentCompilationUnit
findAncestor, findAncestor, findAncestor, hasParentNode, isDescendantOf
containsWithin, containsWithinRange, getBegin, getEnd, hasRange
public ClassOrInterfaceDeclaration()
public ClassOrInterfaceDeclaration(NodeList<Modifier> modifiers, boolean isInterface, String name)
public ClassOrInterfaceDeclaration(NodeList<Modifier> modifiers, NodeList<AnnotationExpr> annotations, boolean isInterface, SimpleName name, NodeList<TypeParameter> typeParameters, NodeList<ClassOrInterfaceType> extendedTypes, NodeList<ClassOrInterfaceType> implementedTypes, NodeList<ClassOrInterfaceType> permittedTypes, NodeList<BodyDeclaration<?>> members)
public ClassOrInterfaceDeclaration(TokenRange tokenRange, NodeList<Modifier> modifiers, NodeList<AnnotationExpr> annotations, boolean isInterface, SimpleName name, NodeList<TypeParameter> typeParameters, NodeList<ClassOrInterfaceType> extendedTypes, NodeList<ClassOrInterfaceType> implementedTypes, NodeList<ClassOrInterfaceType> permittedTypes, NodeList<BodyDeclaration<?>> members)
public <R,A> R accept(GenericVisitor<R,A> v, A arg)
Visitable
accept
in interface Visitable
R
- the type of the return value of the visitorA
- the type the user argument passed to the visitorv
- the visitor implementationarg
- the argument passed to the visitor (of type A)public <A> void accept(VoidVisitor<A> v, A arg)
Visitable
public NodeList<ClassOrInterfaceType> getExtendedTypes()
getExtendedTypes
in interface NodeWithExtends<ClassOrInterfaceDeclaration>
java.lang.Object
unless it is explicitly added (e.g. class X extends Object {}
)
If you want the implicitly extended types, you will need a resolved reference.public NodeList<ClassOrInterfaceType> getImplementedTypes()
getImplementedTypes
in interface NodeWithImplements<ClassOrInterfaceDeclaration>
public NodeList<ClassOrInterfaceType> getPermittedTypes()
public NodeList<TypeParameter> getTypeParameters()
getTypeParameters
in interface NodeWithTypeParameters<ClassOrInterfaceDeclaration>
public boolean isInterface()
public ClassOrInterfaceDeclaration setExtendedTypes(NodeList<ClassOrInterfaceType> extendedTypes)
setExtendedTypes
in interface NodeWithExtends<ClassOrInterfaceDeclaration>
public ClassOrInterfaceDeclaration setImplementedTypes(NodeList<ClassOrInterfaceType> implementedTypes)
setImplementedTypes
in interface NodeWithImplements<ClassOrInterfaceDeclaration>
public ClassOrInterfaceDeclaration setPermittedTypes(NodeList<ClassOrInterfaceType> permittedTypes)
public ClassOrInterfaceDeclaration setInterface(boolean isInterface)
public ClassOrInterfaceDeclaration setTypeParameters(NodeList<TypeParameter> typeParameters)
setTypeParameters
in interface NodeWithTypeParameters<ClassOrInterfaceDeclaration>
public boolean remove(Node node)
remove
in class TypeDeclaration<ClassOrInterfaceDeclaration>
public boolean isLocalClassDeclaration()
public Optional<String> getFullyQualifiedName()
TypeDeclaration
getFullyQualifiedName
in class TypeDeclaration<ClassOrInterfaceDeclaration>
LocalClassDeclarationStmt
,
LocalRecordDeclarationStmt
public boolean isInnerClass()
public ClassOrInterfaceDeclaration clone()
clone
in class TypeDeclaration<ClassOrInterfaceDeclaration>
public ClassOrInterfaceDeclarationMetaModel getMetaModel()
getMetaModel
in class TypeDeclaration<ClassOrInterfaceDeclaration>
public boolean replace(Node node, Node replacementNode)
replace
in class TypeDeclaration<ClassOrInterfaceDeclaration>
public boolean isClassOrInterfaceDeclaration()
isClassOrInterfaceDeclaration
in class BodyDeclaration<ClassOrInterfaceDeclaration>
public ClassOrInterfaceDeclaration asClassOrInterfaceDeclaration()
asClassOrInterfaceDeclaration
in class BodyDeclaration<ClassOrInterfaceDeclaration>
public void ifClassOrInterfaceDeclaration(Consumer<ClassOrInterfaceDeclaration> action)
ifClassOrInterfaceDeclaration
in class BodyDeclaration<ClassOrInterfaceDeclaration>
public ResolvedReferenceTypeDeclaration resolve()
resolve
in interface Resolvable<ResolvedReferenceTypeDeclaration>
resolve
in class TypeDeclaration<ClassOrInterfaceDeclaration>
public Optional<ClassOrInterfaceDeclaration> toClassOrInterfaceDeclaration()
toClassOrInterfaceDeclaration
in class BodyDeclaration<ClassOrInterfaceDeclaration>
Copyright © 2007–2024. All rights reserved.