public final class ReferenceType extends Type<ReferenceType> implements NodeWithType<ReferenceType>, NodeWithAnnotations<ReferenceType>, NodeWithArrays<ReferenceType>
ABSOLUTE_BEGIN_LINE, ABSOLUTE_END_LINE
Constructor and Description |
---|
ReferenceType() |
ReferenceType(int beginLine,
int beginColumn,
int endLine,
int endColumn,
Type type,
int arrayCount,
List<AnnotationExpr> annotations,
List<List<AnnotationExpr>> arraysAnnotations) |
ReferenceType(Range range,
Type type,
int arrayCount) |
ReferenceType(Range range,
Type type,
int arrayCount,
List<AnnotationExpr> annotations,
List<List<AnnotationExpr>> arraysAnnotations) |
ReferenceType(Type type) |
ReferenceType(Type type,
int arrayCount) |
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.
|
static ReferenceType |
create(PrimitiveType type,
int arrayCount)
Creates a new
ReferenceType for the given primitive type. |
static ReferenceType |
create(String name,
int arrayCount)
Creates a new
ReferenceType for a class or interface. |
int |
getArrayCount() |
List<List<AnnotationExpr>> |
getArraysAnnotations()
Arrays annotations are annotations on the arrays modifiers of the type.
|
Type |
getType()
Gets the type
|
ReferenceType |
setArrayCount(int arrayCount) |
ReferenceType |
setArraysAnnotations(List<List<AnnotationExpr>> arraysAnnotations)
For a description of the arrayAnnotations field refer to
NodeWithArrays.getArraysAnnotations() |
ReferenceType |
setType(Type type)
Sets the type
|
getAnnotations, setAnnotations
addOrphanComment, clone, contains, equals, getAllContainedComments, getBegin, getChildrenNodes, getComment, getData, getEnd, getNodesByType, getOrphanComments, getParentNode, getParentNodeOfType, getRange, hasComment, hashCode, isPositionedAfter, isPositionedBefore, setAsParentNodeOf, setAsParentNodeOf, setBegin, setBlockComment, setComment, setData, setEnd, setLineComment, setParentNode, setRange, toString, toStringWithoutComments, tryAddImportToParentCompilationUnit
finalize, getClass, notify, notifyAll, wait, wait, wait
setType
addAnnotation, addAnnotation, addMarkerAnnotation, addMarkerAnnotation, addSingleMemberAnnotation, addSingleMemberAnnotation, getAnnotationByClass, getAnnotationByName, getAnnotations, isAnnotationPresent, isAnnotationPresent, setAnnotations
public ReferenceType()
public ReferenceType(Type type)
public ReferenceType(Type type, int arrayCount)
public ReferenceType(int beginLine, int beginColumn, int endLine, int endColumn, Type type, int arrayCount, List<AnnotationExpr> annotations, List<List<AnnotationExpr>> arraysAnnotations)
public ReferenceType(Range range, Type type, int arrayCount, List<AnnotationExpr> annotations, List<List<AnnotationExpr>> arraysAnnotations)
public static ReferenceType create(String name, int arrayCount)
ReferenceType
for a class or interface.name
- name of the class or interfacearrayCount
- number of arrays or 0
if is not a array.ReferenceType
public static ReferenceType create(PrimitiveType type, int arrayCount)
ReferenceType
for the given primitive type.type
- primitive typearrayCount
- number of arrays or 0
if is not a array.ReferenceType
public <R,A> R accept(GenericVisitor<R,A> v, A arg)
Node
public <A> void accept(VoidVisitor<A> v, A arg)
Node
public int getArrayCount()
getArrayCount
in interface NodeWithArrays<ReferenceType>
public Type getType()
NodeWithType
getType
in interface NodeWithType<ReferenceType>
public ReferenceType setArrayCount(int arrayCount)
setArrayCount
in interface NodeWithArrays<ReferenceType>
public ReferenceType setType(Type type)
NodeWithType
setType
in interface NodeWithType<ReferenceType>
type
- the typepublic List<List<AnnotationExpr>> getArraysAnnotations()
NodeWithArrays
Arrays annotations are annotations on the arrays modifiers of the type. Consider this example:
int @Ann1 [] @Ann2 [] array;
in this this method will return a list with the annotation expressions
@Ann1and
@Ann2
Note that the first list element of arraysAnnotations will refer to the first array modifier encountered. Considering the example the first element will be a list containing just @Ann1 while the second element will be a list containing just @Ann2.
This property is guaranteed to hold:
getArraysAnnotations().size() == getArrayCount()
If a certain array modifier has no annotation the corresponding entry of arraysAnnotations will be nullgetArraysAnnotations
in interface NodeWithArrays<ReferenceType>
public ReferenceType setArraysAnnotations(List<List<AnnotationExpr>> arraysAnnotations)
NodeWithArrays
NodeWithArrays.getArraysAnnotations()
setArraysAnnotations
in interface NodeWithArrays<ReferenceType>
Copyright © 2007–2016. All rights reserved.