public class ArrayType extends ReferenceType implements NodeWithAnnotations<ArrayType>
Modifier and Type | Class and Description |
---|---|
static class |
ArrayType.ArrayBracketPair
Helper class that stores information about a pair of brackets in a non-recursive way
(unlike ArrayType.)
|
static class |
ArrayType.Origin
The origin of a pair of array brackets [].
|
Node.BreadthFirstIterator, Node.DirectChildrenIterator, Node.ObserverRegistrationMode, Node.ParentsVisitor, Node.Parsedness, Node.PostOrderIterator, Node.PreOrderIterator, Node.TreeTraversal
ABSOLUTE_BEGIN_LINE, ABSOLUTE_END_LINE, LINE_SEPARATOR_KEY, NODE_BY_BEGIN_POSITION, prettyPrinterNoCommentsConfiguration, SYMBOL_RESOLVER_KEY
Constructor and Description |
---|
ArrayType(TokenRange tokenRange,
Type componentType,
ArrayType.Origin origin,
NodeList<AnnotationExpr> annotations)
This constructor is used by the parser and is considered private.
|
ArrayType(Type type,
AnnotationExpr... annotations) |
ArrayType(Type componentType,
ArrayType.Origin origin,
NodeList<AnnotationExpr> annotations) |
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.
|
ArrayType |
asArrayType() |
String |
asString() |
ArrayType |
clone() |
Type |
getComponentType() |
ArrayTypeMetaModel |
getMetaModel() |
ArrayType.Origin |
getOrigin() |
void |
ifArrayType(Consumer<ArrayType> action) |
boolean |
isArrayType() |
boolean |
remove(Node node) |
boolean |
replace(Node node,
Node replacementNode) |
ResolvedArrayType |
resolve() |
ArrayType |
setAnnotations(NodeList<AnnotationExpr> annotations) |
ArrayType |
setComponentType(Type componentType) |
ArrayType |
setOrigin(ArrayType.Origin origin) |
Optional<ArrayType> |
toArrayType() |
static Pair<Type,List<ArrayType.ArrayBracketPair>> |
unwrapArrayTypes(Type type)
Takes a type that may be an ArrayType.
|
static Type |
wrapInArrayTypes(Type type,
List<ArrayType.ArrayBracketPair>... arrayBracketPairLists)
Takes lists of arrayBracketPairs, assumes the lists are ordered left to right and the pairs are ordered left to
right, mirroring the actual code.
|
asReferenceType, ifReferenceType, isReferenceType, toReferenceType
asClassOrInterfaceType, asIntersectionType, asPrimitiveType, asTypeParameter, asUnionType, asUnknownType, asVarType, asVoidType, asWildcardType, getAnnotation, getAnnotations, getArrayLevel, getElementType, ifClassOrInterfaceType, ifIntersectionType, ifPrimitiveType, ifTypeParameter, ifUnionType, ifUnknownType, ifVarType, ifVoidType, ifWildcardType, isClassOrInterfaceType, isIntersectionType, isPrimitiveType, isTypeParameter, isUnionType, isUnknownType, isVarType, isVoidType, isWildcardType, toClassOrInterfaceType, toIntersectionType, toPrimitiveType, toTypeParameter, toUnionType, toUnknownType, toVarType, toVoidType, toWildcardType
addOrphanComment, containsData, customInitialization, equals, findAll, findAll, findCompilationUnit, findFirst, findFirst, findFirst, findRootNode, getAllContainedComments, getChildNodes, getChildNodesByType, getComment, getData, getDataKeys, getLineEndingStyle, getLineEndingStyleOrDefault, getNodesByType, getOrphanComments, getParentNode, getParentNodeForChildren, getParsed, getRange, getSymbolResolver, getTokenRange, getToStringPrettyPrinterConfiguration, hashCode, isAncestorOf, isRegistered, notifyPropertyChange, register, register, registerForSubtree, remove, removeComment, removeData, removeForced, removeOrphanComment, replace, setAsParentNodeOf, setAsParentNodeOf, setBlockComment, setComment, setData, setLineComment, setParentNode, setParsed, setRange, setTokenRange, setToStringPrettyPrinterConfiguration, stream, stream, toString, toString, tryAddImportToParentCompilationUnit, unregister, walk, walk, walk
finalize, getClass, notify, notifyAll, wait, wait, wait
addAndGetAnnotation, addAndGetAnnotation, addAnnotation, addAnnotation, addAnnotation, addMarkerAnnotation, addMarkerAnnotation, addSingleMemberAnnotation, addSingleMemberAnnotation, addSingleMemberAnnotation, addSingleMemberAnnotation, getAnnotation, getAnnotationByClass, getAnnotationByName, getAnnotations, isAnnotationPresent, isAnnotationPresent, setAnnotation, tryAddImportToParentCompilationUnit
findAncestor, findAncestor, isDescendantOf
containsWithin, containsWithinRange, getBegin, getEnd
public ArrayType(Type componentType, ArrayType.Origin origin, NodeList<AnnotationExpr> annotations)
public ArrayType(Type type, AnnotationExpr... annotations)
public ArrayType(TokenRange tokenRange, Type componentType, ArrayType.Origin origin, NodeList<AnnotationExpr> annotations)
public ResolvedArrayType resolve()
resolve
in interface Resolvable<ResolvedType>
resolve
in class Type
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 Type getComponentType()
@SafeVarargs public static Type wrapInArrayTypes(Type type, List<ArrayType.ArrayBracketPair>... arrayBracketPairLists)
public static Pair<Type,List<ArrayType.ArrayBracketPair>> unwrapArrayTypes(Type type)
public ArrayType setAnnotations(NodeList<AnnotationExpr> annotations)
setAnnotations
in interface NodeWithAnnotations<ArrayType>
setAnnotations
in class Type
public ArrayType.Origin getOrigin()
public ArrayType setOrigin(ArrayType.Origin origin)
public boolean remove(Node node)
remove
in class ReferenceType
public ArrayType clone()
clone
in class ReferenceType
public ArrayTypeMetaModel getMetaModel()
getMetaModel
in class ReferenceType
public boolean replace(Node node, Node replacementNode)
replace
in class ReferenceType
public boolean isArrayType()
isArrayType
in class Type
public ArrayType asArrayType()
asArrayType
in class Type
public void ifArrayType(Consumer<ArrayType> action)
ifArrayType
in class Type
public Optional<ArrayType> toArrayType()
toArrayType
in class Type
Copyright © 2007–2020. All rights reserved.