public 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.BreadthFirstIterator, Node.DirectChildrenIterator, Node.ObserverRegistrationMode, Node.ParentsVisitor, Node.Parsedness, Node.PostOrderIterator, Node.PreOrderIterator, Node.TreeTraversalABSOLUTE_BEGIN_LINE, ABSOLUTE_END_LINE, LINE_SEPARATOR_KEY, NODE_BY_BEGIN_POSITION, PHANTOM_KEY, prettyPrinterNoCommentsConfiguration, PRINTER_KEY, SYMBOL_RESOLVER_KEY| 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,
String name) |
ClassOrInterfaceType(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.
|
asReferenceType, ifReferenceType, isReferenceType, toReferenceTypeasArrayType, asIntersectionType, asPrimitiveType, asTypeParameter, asUnionType, asUnknownType, asVarType, asVoidType, asWildcardType, getAnnotation, getAnnotations, getArrayLevel, getElementType, ifArrayType, ifIntersectionType, ifPrimitiveType, ifTypeParameter, ifUnionType, ifUnknownType, ifVarType, ifVoidType, ifWildcardType, isArrayType, isIntersectionType, isPrimitiveType, isTypeParameter, isUnionType, isUnknownType, isVarType, isVoidType, isWildcardType, toArrayType, toIntersectionType, toPrimitiveType, toTypeParameter, toUnionType, toUnknownType, toVarType, toVoidType, toWildcardTypeaddOrphanComment, containsData, createDefaultPrinter, createDefaultPrinter, customInitialization, equals, findAll, findAll, findAll, findCompilationUnit, 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, walkfinalize, getClass, notify, notifyAll, wait, wait, waitgetNameAsExpression, getNameAsString, setNameaddAndGetAnnotation, addAndGetAnnotation, addAnnotation, addAnnotation, addAnnotation, addMarkerAnnotation, addMarkerAnnotation, addSingleMemberAnnotation, addSingleMemberAnnotation, addSingleMemberAnnotation, addSingleMemberAnnotation, getAnnotation, getAnnotationByClass, getAnnotationByName, getAnnotations, isAnnotationPresent, isAnnotationPresent, setAnnotation, tryAddImportToParentCompilationUnitisUsingDiamondOperator, removeTypeArguments, setDiamondOperator, setTypeArgumentsfindAncestor, findAncestor, findAncestor, hasParentNode, isDescendantOfcontainsWithin, containsWithinRange, getBegin, getEnd, hasRangepublic ClassOrInterfaceType()
public ClassOrInterfaceType(String name)
public ClassOrInterfaceType(ClassOrInterfaceType scope, String name)
public ClassOrInterfaceType(ClassOrInterfaceType scope, SimpleName name, NodeList<Type> typeArguments)
public ClassOrInterfaceType(ClassOrInterfaceType scope, SimpleName name, NodeList<Type> typeArguments, NodeList<AnnotationExpr> annotations)
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)
Visitableaccept in interface VisitableR - 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)
Visitablepublic SimpleName getName()
getName in interface NodeWithSimpleName<ClassOrInterfaceType>public String getNameWithScope()
public Optional<ClassOrInterfaceType> getScope()
public boolean isBoxedType()
public PrimitiveType toUnboxedType() throws UnsupportedOperationException
UnsupportedOperationExceptionpublic 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><String, Integer>.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 Typepublic String toDescriptor()
toDescriptor in class ReferenceTypepublic ClassOrInterfaceType removeScope()
public ClassOrInterfaceType clone()
clone in class ReferenceTypepublic ClassOrInterfaceTypeMetaModel getMetaModel()
getMetaModel in class ReferenceTypepublic boolean isClassOrInterfaceType()
isClassOrInterfaceType in class Typepublic ClassOrInterfaceType asClassOrInterfaceType()
asClassOrInterfaceType in class Typepublic void ifClassOrInterfaceType(Consumer<ClassOrInterfaceType> action)
ifClassOrInterfaceType in class Typepublic ResolvedType resolve()
resolve in interface Resolvable<ResolvedType>resolve in class Typepublic Optional<ClassOrInterfaceType> toClassOrInterfaceType()
toClassOrInterfaceType in class Typepublic ResolvedType convertToUsage(Context context)
ClassOrInterfaceType into a ResolvedType.convertToUsage in interface ConvertibleToUsageclassOrInterfaceType - The class of interface type to be converted.context - The current context.Copyright © 2007–2024. All rights reserved.