public class TypeAnnotationUtils extends Object
AnnotationUtils
Modifier and Type | Method and Description |
---|---|
static com.sun.tools.javac.code.Attribute |
attributeFromAnnotationValue(ExecutableElement meth,
AnnotationValue av,
ProcessingEnvironment env)
Returns a newly created Attribute corresponding to an argument AnnotationValue.
|
static com.sun.tools.javac.code.TypeAnnotationPosition |
classExtendsTAPosition(int implidx,
int pos)
Create a class extends TypeAnnotationPosition.
|
static com.sun.tools.javac.code.TypeAnnotationPosition |
copyTAPosition(com.sun.tools.javac.code.TypeAnnotationPosition tapos)
Copy a TypeAnnotationPosition.
|
static com.sun.tools.javac.code.Attribute.Compound |
createCompoundFromAnnotationMirror(AnnotationMirror am,
ProcessingEnvironment env)
Returns a newly created Attribute.Compound corresponding to an argument AnnotationMirror.
|
static com.sun.tools.javac.code.Attribute.TypeCompound |
createTypeCompoundFromAnnotationMirror(AnnotationMirror am,
com.sun.tools.javac.code.TypeAnnotationPosition tapos,
ProcessingEnvironment env)
Returns a newly created Attribute.TypeCompound corresponding to an argument AnnotationMirror.
|
static com.sun.tools.javac.code.TypeAnnotationPosition |
fieldTAPosition(int pos)
Create a field TypeAnnotationPosition.
|
static boolean |
isSameTAPosition(com.sun.tools.javac.code.TypeAnnotationPosition p1,
com.sun.tools.javac.code.TypeAnnotationPosition p2)
Compare two TypeAnnotationPositions for equality.
|
static boolean |
isSameTAPositionExceptTreePos(com.sun.tools.javac.code.TypeAnnotationPosition p1,
com.sun.tools.javac.code.TypeAnnotationPosition p2)
Compare two TypeAnnotationPositions for equality, ignoring the source tree position.
|
static boolean |
isTypeCompoundContained(com.sun.tools.javac.util.List<com.sun.tools.javac.code.Attribute.TypeCompound> list,
com.sun.tools.javac.code.Attribute.TypeCompound tc,
Types types)
Check whether a TypeCompound is contained in a list of TypeCompounds.
|
static com.sun.tools.javac.code.TypeAnnotationPosition |
methodParameterTAPosition(int pidx,
int pos)
Create a method parameter TypeAnnotationPosition.
|
static com.sun.tools.javac.code.TypeAnnotationPosition |
methodReceiverTAPosition(int pos)
Create a method receiver TypeAnnotationPosition.
|
static com.sun.tools.javac.code.TypeAnnotationPosition |
methodReturnTAPosition(int pos)
Create a method return TypeAnnotationPosition.
|
static com.sun.tools.javac.code.TypeAnnotationPosition |
methodThrowsTAPosition(int tidx,
int pos)
Create a method throws TypeAnnotationPosition.
|
static com.sun.tools.javac.code.TypeAnnotationPosition |
methodTypeParameterBoundTAPosition(int tpidx,
int bndidx,
int pos)
Create a method type parameter bound TypeAnnotationPosition.
|
static com.sun.tools.javac.code.TypeAnnotationPosition |
methodTypeParameterTAPosition(int tpidx,
int pos)
Create a method type parameter TypeAnnotationPosition.
|
static com.sun.tools.javac.code.TypeAnnotationPosition |
typeParameterBoundTAPosition(int tpidx,
int bndidx,
int pos)
Create a type parameter bound TypeAnnotationPosition.
|
static com.sun.tools.javac.code.TypeAnnotationPosition |
typeParameterTAPosition(int tpidx,
int pos)
Create a type parameter TypeAnnotationPosition.
|
static com.sun.tools.javac.code.Type |
unannotatedType(TypeMirror in)
Remove type annotations from the given type.
|
static com.sun.tools.javac.code.TypeAnnotationPosition |
unknownTAPosition()
Create an unknown TypeAnnotationPosition.
|
public static boolean isTypeCompoundContained(com.sun.tools.javac.util.List<com.sun.tools.javac.code.Attribute.TypeCompound> list, com.sun.tools.javac.code.Attribute.TypeCompound tc, Types types)
list
- the input list of TypeCompoundstc
- the TypeCompound to findpublic static boolean isSameTAPosition(com.sun.tools.javac.code.TypeAnnotationPosition p1, com.sun.tools.javac.code.TypeAnnotationPosition p2)
p1
- the first positionp2
- the second positionpublic static boolean isSameTAPositionExceptTreePos(com.sun.tools.javac.code.TypeAnnotationPosition p1, com.sun.tools.javac.code.TypeAnnotationPosition p2)
p1
- the first positionp2
- the second positionpublic static com.sun.tools.javac.code.Attribute.Compound createCompoundFromAnnotationMirror(AnnotationMirror am, ProcessingEnvironment env)
am
- an AnnotationMirror, which may be part of an AST or an internally created subclasspublic static com.sun.tools.javac.code.Attribute.TypeCompound createTypeCompoundFromAnnotationMirror(AnnotationMirror am, com.sun.tools.javac.code.TypeAnnotationPosition tapos, ProcessingEnvironment env)
am
- an AnnotationMirror, which may be part of an AST or an internally created subclasstapos
- the type annotation position to usepublic static com.sun.tools.javac.code.Attribute attributeFromAnnotationValue(ExecutableElement meth, AnnotationValue av, ProcessingEnvironment env)
meth
- the ExecutableElement that is assigned the value, needed for empty arraysav
- an AnnotationValue, which may be part of an AST or an internally created subclasspublic static com.sun.tools.javac.code.TypeAnnotationPosition unknownTAPosition()
public static com.sun.tools.javac.code.TypeAnnotationPosition methodReturnTAPosition(int pos)
pos
- the source tree positionpublic static com.sun.tools.javac.code.TypeAnnotationPosition methodReceiverTAPosition(int pos)
pos
- the source tree positionpublic static com.sun.tools.javac.code.TypeAnnotationPosition methodParameterTAPosition(int pidx, int pos)
pidx
- the parameter indexpos
- the source tree positionpublic static com.sun.tools.javac.code.TypeAnnotationPosition methodThrowsTAPosition(int tidx, int pos)
tidx
- the throws indexpos
- the source tree positionpublic static com.sun.tools.javac.code.TypeAnnotationPosition fieldTAPosition(int pos)
pos
- the source tree positionpublic static com.sun.tools.javac.code.TypeAnnotationPosition classExtendsTAPosition(int implidx, int pos)
implidx
- the class extends indexpos
- the source tree positionpublic static com.sun.tools.javac.code.TypeAnnotationPosition typeParameterTAPosition(int tpidx, int pos)
tpidx
- the type parameter indexpos
- the source tree positionpublic static com.sun.tools.javac.code.TypeAnnotationPosition methodTypeParameterTAPosition(int tpidx, int pos)
tpidx
- the method type parameter indexpos
- the source tree positionpublic static com.sun.tools.javac.code.TypeAnnotationPosition typeParameterBoundTAPosition(int tpidx, int bndidx, int pos)
tpidx
- the type parameter indexbndidx
- the bound indexpos
- the source tree positionpublic static com.sun.tools.javac.code.TypeAnnotationPosition methodTypeParameterBoundTAPosition(int tpidx, int bndidx, int pos)
tpidx
- the type parameter indexbndidx
- the bound indexpos
- the source tree positionpublic static com.sun.tools.javac.code.TypeAnnotationPosition copyTAPosition(com.sun.tools.javac.code.TypeAnnotationPosition tapos)
tapos
- the input TypeAnnotationPositionpublic static com.sun.tools.javac.code.Type unannotatedType(TypeMirror in)
in
- the input type