public final class ClassOrInterfaceType extends ReferenceType implements NodeWithSimpleName<ClassOrInterfaceType>, NodeWithAnnotations<ClassOrInterfaceType>, NodeWithTypeArguments<ClassOrInterfaceType>
Object
HashMap<String, String>
java.util.Punchcard
Note that the syntax is ambiguous here, and JavaParser does not know what is to the left of the class. It assumes
cases like Map.Entry
where Map is the scope of Entry. In java.util.Punchcard
, it will not
recognize that java and util are parts of the package name. Instead, it will set util as the scope of Punchcard, as a
ClassOrInterfaceType (which it is not.) In turn, util will have java as its scope, also as a
ClassOrInterfaceType
Node.ObserverRegistrationMode, Node.Parsedness
Modifier and Type | Field and Description |
---|---|
private SimpleName |
name |
private ClassOrInterfaceType |
scope |
private NodeList<Type> |
typeArguments |
ABSOLUTE_BEGIN_LINE, ABSOLUTE_END_LINE, NODE_BY_BEGIN_POSITION, prettyPrinterNoCommentsConfiguration
Constructor and Description |
---|
ClassOrInterfaceType() |
ClassOrInterfaceType(ClassOrInterfaceType scope,
SimpleName name,
NodeList<Type> typeArguments) |
ClassOrInterfaceType(ClassOrInterfaceType scope,
SimpleName name,
NodeList<Type> typeArguments,
NodeList<AnnotationExpr> annotations) |
ClassOrInterfaceType(ClassOrInterfaceType scope,
java.lang.String name) |
ClassOrInterfaceType(java.lang.String name)
Deprecated.
use JavaParser.parseClassOrInterfaceType instead. This constructor does not understand generics.
|
ClassOrInterfaceType(TokenRange tokenRange,
ClassOrInterfaceType scope,
SimpleName name,
NodeList<Type> typeArguments,
NodeList<AnnotationExpr> annotations)
This constructor is used by the parser and is considered private.
|
getAnnotation, getAnnotations, getArrayLevel, getElementType
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
finalize, getClass, notify, notifyAll, wait, wait, wait
getNameAsString, setName
addAndGetAnnotation, addAndGetAnnotation, addAnnotation, addAnnotation, addAnnotation, addMarkerAnnotation, addMarkerAnnotation, addSingleMemberAnnotation, addSingleMemberAnnotation, addSingleMemberAnnotation, getAnnotation, getAnnotationByClass, getAnnotationByName, getAnnotations, isAnnotationPresent, isAnnotationPresent, setAnnotation, tryAddImportToParentCompilationUnit
isUsingDiamondOperator, removeTypeArguments, setDiamondOperator, setTypeArguments
getAncestorOfType
containsWithin, getBegin, getEnd, isPositionedAfter, isPositionedBefore
private ClassOrInterfaceType scope
private SimpleName name
public ClassOrInterfaceType()
public ClassOrInterfaceType(java.lang.String name)
public ClassOrInterfaceType(ClassOrInterfaceType scope, java.lang.String name)
public ClassOrInterfaceType(ClassOrInterfaceType scope, SimpleName name, NodeList<Type> typeArguments)
public ClassOrInterfaceType(ClassOrInterfaceType scope, SimpleName name, NodeList<Type> typeArguments, NodeList<AnnotationExpr> annotations)
@Generated(value="com.github.javaparser.generator.core.node.MainConstructorGenerator") public ClassOrInterfaceType(TokenRange tokenRange, ClassOrInterfaceType scope, SimpleName name, NodeList<Type> typeArguments, NodeList<AnnotationExpr> annotations)
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 SimpleName getName()
getName
in interface NodeWithSimpleName<ClassOrInterfaceType>
@Generated(value="com.github.javaparser.generator.core.node.PropertyGenerator") public java.util.Optional<ClassOrInterfaceType> getScope()
public boolean isBoxedType()
public PrimitiveType toUnboxedType() throws java.lang.UnsupportedOperationException
java.lang.UnsupportedOperationException
@Generated(value="com.github.javaparser.generator.core.node.PropertyGenerator") public ClassOrInterfaceType setName(SimpleName name)
setName
in interface NodeWithSimpleName<ClassOrInterfaceType>
@Generated(value="com.github.javaparser.generator.core.node.PropertyGenerator") public ClassOrInterfaceType setScope(ClassOrInterfaceType scope)
scope
- the scope, can be null@Generated(value="com.github.javaparser.generator.core.node.PropertyGenerator") public java.util.Optional<NodeList<Type>> getTypeArguments()
getTypeArguments
in interface NodeWithTypeArguments<ClassOrInterfaceType>
@Generated(value="com.github.javaparser.generator.core.node.PropertyGenerator") public ClassOrInterfaceType setTypeArguments(NodeList<Type> typeArguments)
setTypeArguments
in interface NodeWithTypeArguments<ClassOrInterfaceType>
typeArguments
- the typeArguments, can be nullpublic ClassOrInterfaceType setAnnotations(NodeList<AnnotationExpr> annotations)
setAnnotations
in interface NodeWithAnnotations<ClassOrInterfaceType>
setAnnotations
in class Type
@Generated(value="com.github.javaparser.generator.core.node.GetNodeListsGenerator") public java.util.List<NodeList<?>> getNodeLists()
Node
getNodeLists
in class Node
@Generated(value="com.github.javaparser.generator.core.node.RemoveMethodGenerator") public boolean remove(Node node)
remove
in class ReferenceType
@Generated(value="com.github.javaparser.generator.core.node.RemoveMethodGenerator") public ClassOrInterfaceType removeScope()
@Generated(value="com.github.javaparser.generator.core.node.CloneGenerator") public ClassOrInterfaceType clone()
clone
in class ReferenceType
@Generated(value="com.github.javaparser.generator.core.node.GetMetaModelGenerator") public ClassOrInterfaceTypeMetaModel getMetaModel()
getMetaModel
in class ReferenceType
@Generated(value="com.github.javaparser.generator.core.node.ReplaceMethodGenerator") public boolean replace(Node node, Node replacementNode)
replace
in class ReferenceType