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 and Description |
---|
ClassOrInterfaceDeclaration() |
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) |
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.
|
addMember, getCallablesWithSignature, getMembers, getModifiers, getName, isNestedType, isTopLevelType, setMembers, setModifiers, setName
getAnnotations, setAnnotations
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, setAsParentNodeOf, setAsParentNodeOf, setBlockComment, setComment, setData, setLineComment, setParentNode, setParsed, setRange, setTokenRange, toString, toString, tryAddImportToParentCompilationUnit, unregister
finalize, getClass, notify, notifyAll, wait, wait, wait
addImplementedType, addImplementedType, addImplementedType, addImplements, addImplements, getImplementedTypes, setImplementedType, tryAddImportToParentCompilationUnit
addExtendedType, addExtendedType, addExtendedType, addExtends, addExtends, getExtendedTypes, setExtendedType, tryAddImportToParentCompilationUnit
addTypeParameter, getTypeParameter, isGeneric, setTypeParameter
isAbstract, setAbstract
isFinal, setFinal
addModifier, getModifiers, removeModifier, setModifier, setModifiers
getNameAsString, setName
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
isPublic, setPublic
isPrivate, setPrivate
isProtected, setProtected
isStatic, setStatic
isStrictfp, setStrictfp
addAndGetAnnotation, addAndGetAnnotation, addAnnotation, addAnnotation, addAnnotation, addMarkerAnnotation, addMarkerAnnotation, addSingleMemberAnnotation, addSingleMemberAnnotation, addSingleMemberAnnotation, getAnnotation, getAnnotationByClass, getAnnotationByName, isAnnotationPresent, isAnnotationPresent, setAnnotation, tryAddImportToParentCompilationUnit
getAncestorOfType
containsWithin, getBegin, getEnd, isPositionedAfter, isPositionedBefore
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(value="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(value="com.github.javaparser.generator.core.node.PropertyGenerator") public NodeList<ClassOrInterfaceType> getExtendedTypes()
getExtendedTypes
in interface NodeWithExtends<ClassOrInterfaceDeclaration>
@Generated(value="com.github.javaparser.generator.core.node.PropertyGenerator") public NodeList<ClassOrInterfaceType> getImplementedTypes()
getImplementedTypes
in interface NodeWithImplements<ClassOrInterfaceDeclaration>
@Generated(value="com.github.javaparser.generator.core.node.PropertyGenerator") public NodeList<TypeParameter> getTypeParameters()
getTypeParameters
in interface NodeWithTypeParameters<ClassOrInterfaceDeclaration>
@Generated(value="com.github.javaparser.generator.core.node.PropertyGenerator") public boolean isInterface()
@Generated(value="com.github.javaparser.generator.core.node.PropertyGenerator") public ClassOrInterfaceDeclaration setExtendedTypes(NodeList<ClassOrInterfaceType> extendedTypes)
setExtendedTypes
in interface NodeWithExtends<ClassOrInterfaceDeclaration>
@Generated(value="com.github.javaparser.generator.core.node.PropertyGenerator") public ClassOrInterfaceDeclaration setImplementedTypes(NodeList<ClassOrInterfaceType> implementedTypes)
setImplementedTypes
in interface NodeWithImplements<ClassOrInterfaceDeclaration>
@Generated(value="com.github.javaparser.generator.core.node.PropertyGenerator") public ClassOrInterfaceDeclaration setInterface(boolean isInterface)
@Generated(value="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(value="com.github.javaparser.generator.core.node.GetNodeListsGenerator") public List<NodeList<?>> getNodeLists()
Node
getNodeLists
in class TypeDeclaration<ClassOrInterfaceDeclaration>
@Generated(value="com.github.javaparser.generator.core.node.RemoveMethodGenerator") public boolean remove(Node node)
remove
in class TypeDeclaration<ClassOrInterfaceDeclaration>
public boolean isLocalClassDeclaration()
public boolean isInnerClass()
@Generated(value="com.github.javaparser.generator.core.node.CloneGenerator") public ClassOrInterfaceDeclaration clone()
clone
in class TypeDeclaration<ClassOrInterfaceDeclaration>
@Generated(value="com.github.javaparser.generator.core.node.GetMetaModelGenerator") public ClassOrInterfaceDeclarationMetaModel getMetaModel()
getMetaModel
in class TypeDeclaration<ClassOrInterfaceDeclaration>
@Generated(value="com.github.javaparser.generator.core.node.ReplaceMethodGenerator") public boolean replace(Node node, Node replacementNode)
replace
in class TypeDeclaration<ClassOrInterfaceDeclaration>
Copyright © 2007–2017. All rights reserved.