NodeWithAbstractModifier<ClassOrInterfaceDeclaration>
, NodeWithAccessModifiers<ClassOrInterfaceDeclaration>
, NodeWithFinalModifier<ClassOrInterfaceDeclaration>
, NodeWithPrivateModifier<ClassOrInterfaceDeclaration>
, NodeWithProtectedModifier<ClassOrInterfaceDeclaration>
, NodeWithPublicModifier<ClassOrInterfaceDeclaration>
, NodeWithStaticModifier<ClassOrInterfaceDeclaration>
, NodeWithStrictfpModifier<ClassOrInterfaceDeclaration>
, NodeWithAnnotations<ClassOrInterfaceDeclaration>
, NodeWithExtends<ClassOrInterfaceDeclaration>
, NodeWithImplements<ClassOrInterfaceDeclaration>
, NodeWithJavadoc<ClassOrInterfaceDeclaration>
, NodeWithMembers<ClassOrInterfaceDeclaration>
, NodeWithModifiers<ClassOrInterfaceDeclaration>
, NodeWithRange<ClassOrInterfaceDeclaration>
, NodeWithSimpleName<ClassOrInterfaceDeclaration>
, NodeWithTokenRange<ClassOrInterfaceDeclaration>
, NodeWithTypeParameters<ClassOrInterfaceDeclaration>
, Observable
, Visitable
, HasParentNode<ClassOrInterfaceDeclaration>
, Cloneable
public final class ClassOrInterfaceDeclaration extends TypeDeclaration<ClassOrInterfaceDeclaration> implements NodeWithImplements<ClassOrInterfaceDeclaration>, NodeWithExtends<ClassOrInterfaceDeclaration>, NodeWithTypeParameters<ClassOrInterfaceDeclaration>, NodeWithAbstractModifier<ClassOrInterfaceDeclaration>, NodeWithFinalModifier<ClassOrInterfaceDeclaration>
class X { ... }
Node.ObserverRegistrationMode, Node.Parsedness
ABSOLUTE_BEGIN_LINE, ABSOLUTE_END_LINE, NODE_BY_BEGIN_POSITION, prettyPrinterNoCommentsConfiguration
Constructor | Description |
---|---|
ClassOrInterfaceDeclaration() |
|
ClassOrInterfaceDeclaration(TokenRange tokenRange,
EnumSet<Modifier> modifiers,
NodeList<AnnotationExpr> annotations,
boolean isInterface,
SimpleName name,
NodeList<TypeParameter> typeParameters,
NodeList<ClassOrInterfaceType> extendedTypes,
NodeList<ClassOrInterfaceType> implementedTypes,
NodeList<BodyDeclaration<?>> members) |
This constructor is used by the parser and is considered private.
|
ClassOrInterfaceDeclaration(EnumSet<Modifier> modifiers,
boolean isInterface,
String name) |
|
ClassOrInterfaceDeclaration(EnumSet<Modifier> modifiers,
NodeList<AnnotationExpr> annotations,
boolean isInterface,
SimpleName name,
NodeList<TypeParameter> typeParameters,
NodeList<ClassOrInterfaceType> extendedTypes,
NodeList<ClassOrInterfaceType> implementedTypes,
NodeList<BodyDeclaration<?>> members) |
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
isAbstract, setAbstract
addAndGetAnnotation, addAndGetAnnotation, addAnnotation, addAnnotation, addAnnotation, addMarkerAnnotation, addMarkerAnnotation, addSingleMemberAnnotation, addSingleMemberAnnotation, addSingleMemberAnnotation, getAnnotation, getAnnotationByClass, getAnnotationByName, isAnnotationPresent, isAnnotationPresent, setAnnotation, tryAddImportToParentCompilationUnit
addExtendedType, addExtendedType, addExtendedType, addExtends, addExtends, getExtendedTypes, setExtendedType, tryAddImportToParentCompilationUnit
isFinal, setFinal
addImplementedType, addImplementedType, addImplementedType, addImplements, addImplements, getImplementedTypes, setImplementedType, 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, getModifiers, removeModifier, setModifier, setModifiers
isPrivate, setPrivate
isProtected, setProtected
isPublic, setPublic
containsWithin, getBegin, getEnd, isPositionedAfter, isPositionedBefore
getNameAsString, setName
isStatic, setStatic
isStrictfp, setStrictfp
addTypeParameter, getTypeParameter, isGeneric, setTypeParameter
finalize, getClass, notify, notifyAll, wait, wait, wait
addMember, getCallablesWithSignature, getMembers, getModifiers, getName, isNestedType, isTopLevelType, setMembers, setModifiers, setName
public ClassOrInterfaceDeclaration()
public ClassOrInterfaceDeclaration(EnumSet<Modifier> modifiers, boolean isInterface, String name)
public ClassOrInterfaceDeclaration(EnumSet<Modifier> modifiers, NodeList<AnnotationExpr> annotations, boolean isInterface, SimpleName name, NodeList<TypeParameter> typeParameters, NodeList<ClassOrInterfaceType> extendedTypes, NodeList<ClassOrInterfaceType> implementedTypes, NodeList<BodyDeclaration<?>> members)
@Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator") public ClassOrInterfaceDeclaration(TokenRange tokenRange, EnumSet<Modifier> modifiers, NodeList<AnnotationExpr> annotations, boolean isInterface, SimpleName name, NodeList<TypeParameter> typeParameters, NodeList<ClassOrInterfaceType> extendedTypes, NodeList<ClassOrInterfaceType> implementedTypes, 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
@Generated("com.github.javaparser.generator.core.node.PropertyGenerator") public NodeList<ClassOrInterfaceType> getExtendedTypes()
getExtendedTypes
in interface NodeWithExtends<ClassOrInterfaceDeclaration>
@Generated("com.github.javaparser.generator.core.node.PropertyGenerator") public NodeList<ClassOrInterfaceType> getImplementedTypes()
getImplementedTypes
in interface NodeWithImplements<ClassOrInterfaceDeclaration>
@Generated("com.github.javaparser.generator.core.node.PropertyGenerator") public NodeList<TypeParameter> getTypeParameters()
getTypeParameters
in interface NodeWithTypeParameters<ClassOrInterfaceDeclaration>
@Generated("com.github.javaparser.generator.core.node.PropertyGenerator") public boolean isInterface()
@Generated("com.github.javaparser.generator.core.node.PropertyGenerator") public ClassOrInterfaceDeclaration setExtendedTypes(NodeList<ClassOrInterfaceType> extendedTypes)
setExtendedTypes
in interface NodeWithExtends<ClassOrInterfaceDeclaration>
@Generated("com.github.javaparser.generator.core.node.PropertyGenerator") public ClassOrInterfaceDeclaration setImplementedTypes(NodeList<ClassOrInterfaceType> implementedTypes)
setImplementedTypes
in interface NodeWithImplements<ClassOrInterfaceDeclaration>
@Generated("com.github.javaparser.generator.core.node.PropertyGenerator") public ClassOrInterfaceDeclaration setInterface(boolean isInterface)
@Generated("com.github.javaparser.generator.core.node.PropertyGenerator") public ClassOrInterfaceDeclaration setTypeParameters(NodeList<TypeParameter> typeParameters)
setTypeParameters
in interface NodeWithTypeParameters<ClassOrInterfaceDeclaration>
public Optional<ConstructorDeclaration> getDefaultConstructor()
ConstructorDeclaration
with no parameters by its namepublic ConstructorDeclaration addConstructor(Modifier... modifiers)
modifiers
- the modifiers like Modifier.PUBLIC
MethodDeclaration
createdpublic List<ConstructorDeclaration> getConstructors()
public Optional<ConstructorDeclaration> getConstructorByParameterTypes(String... paramTypes)
MethodDeclaration
by its parameters typesparamTypes
- the types of parameters like "Map<Integer,String>","int" to matchpublic Optional<ConstructorDeclaration> getConstructorByParameterTypes(Class<?>... paramTypes)
MethodDeclaration
by its parameters typesparamTypes
- the types of parameters like "Map<Integer,String>","int" to match@Generated("com.github.javaparser.generator.core.node.GetNodeListsGenerator") public List<NodeList<?>> getNodeLists()
Node
getNodeLists
in class TypeDeclaration<ClassOrInterfaceDeclaration>
@Generated("com.github.javaparser.generator.core.node.RemoveMethodGenerator") public boolean remove(Node node)
remove
in class TypeDeclaration<ClassOrInterfaceDeclaration>
public boolean isLocalClassDeclaration()
public boolean isInnerClass()
@Generated("com.github.javaparser.generator.core.node.CloneGenerator") public ClassOrInterfaceDeclaration clone()
clone
in class TypeDeclaration<ClassOrInterfaceDeclaration>
@Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator") public ClassOrInterfaceDeclarationMetaModel getMetaModel()
getMetaModel
in class TypeDeclaration<ClassOrInterfaceDeclaration>
@Generated("com.github.javaparser.generator.core.node.ReplaceMethodGenerator") public boolean replace(Node node, Node replacementNode)
replace
in class TypeDeclaration<ClassOrInterfaceDeclaration>
Copyright © 2007–2019. All rights reserved.