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
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,
String name) |
ClassOrInterfaceType(Range range,
ClassOrInterfaceType scope,
SimpleName name,
NodeList<Type> typeArguments) |
ClassOrInterfaceType(String name) |
Modifier and Type | Method and Description |
---|---|
<R,A> R |
accept(GenericVisitor<R,A> v,
A arg)
Accept method for visitor support.
|
<A> void |
accept(VoidVisitor<A> v,
A arg)
Accept method for visitor support.
|
ClassOrInterfaceType |
clone() |
ClassOrInterfaceTypeMetaModel |
getMetaModel() |
SimpleName |
getName() |
List<NodeList<?>> |
getNodeLists()
The list of NodeLists owned by this node.
|
Optional<ClassOrInterfaceType> |
getScope() |
Optional<NodeList<Type>> |
getTypeArguments() |
boolean |
isBoxedType() |
boolean |
remove(Node node) |
ClassOrInterfaceType |
removeScope() |
ClassOrInterfaceType |
setAnnotations(NodeList<AnnotationExpr> annotations) |
ClassOrInterfaceType |
setName(SimpleName name) |
ClassOrInterfaceType |
setScope(ClassOrInterfaceType scope)
Sets the scope
|
ClassOrInterfaceType |
setTypeArguments(NodeList<Type> typeArguments)
Sets the typeArguments
|
PrimitiveType |
toUnboxedType() |
getAnnotation, getAnnotations, getArrayLevel, getElementType
addOrphanComment, equals, getAllContainedComments, getChildNodes, getComment, getData, getNodesByType, getOrphanComments, getParentNode, getParentNodeForChildren, getRange, hasComment, hashCode, isRegistered, notifyPropertyChange, register, register, registerForSubtree, remove, removeComment, removeOrphanComment, setAsParentNodeOf, setBlockComment, setComment, setData, setLineComment, setParentNode, setRange, toString, toString, tryAddImportToParentCompilationUnit, unregister
finalize, getClass, notify, notifyAll, wait, wait, wait
getNameAsString, setName
addAndGetAnnotation, addAndGetAnnotation, addAnnotation, addAnnotation, addAnnotation, addMarkerAnnotation, addMarkerAnnotation, addSingleMemberAnnotation, addSingleMemberAnnotation, getAnnotation, getAnnotationByClass, getAnnotationByName, getAnnotations, isAnnotationPresent, isAnnotationPresent, setAnnotation
isUsingDiamondOperator, removeTypeArguments, setDiamondOperator, setTypeArguments
getAncestorOfType, setAsParentNodeOf, setAsParentNodeOf
containsWithin, getBegin, getEnd, isPositionedAfter, isPositionedBefore
public ClassOrInterfaceType()
public ClassOrInterfaceType(String name)
public ClassOrInterfaceType(ClassOrInterfaceType scope, String name)
public ClassOrInterfaceType(ClassOrInterfaceType scope, SimpleName name, NodeList<Type> typeArguments)
public ClassOrInterfaceType(Range range, ClassOrInterfaceType scope, SimpleName name, NodeList<Type> typeArguments)
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 SimpleName getName()
getName
in interface NodeWithSimpleName<ClassOrInterfaceType>
public Optional<ClassOrInterfaceType> getScope()
public boolean isBoxedType()
public PrimitiveType toUnboxedType() throws UnsupportedOperationException
UnsupportedOperationException
public ClassOrInterfaceType setName(SimpleName name)
setName
in interface NodeWithSimpleName<ClassOrInterfaceType>
public ClassOrInterfaceType setScope(ClassOrInterfaceType scope)
scope
- the scope, can be nullpublic Optional<NodeList<Type>> getTypeArguments()
getTypeArguments
in interface NodeWithTypeArguments<ClassOrInterfaceType>
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
public List<NodeList<?>> getNodeLists()
Node
getNodeLists
in class Node
public boolean remove(Node node)
remove
in class ReferenceType
public ClassOrInterfaceType removeScope()
public ClassOrInterfaceType clone()
clone
in class ReferenceType
public ClassOrInterfaceTypeMetaModel getMetaModel()
getMetaModel
in class ReferenceType
Copyright © 2007–2017. All rights reserved.