|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.androidannotations.helper.AnnotationHelper
public class AnnotationHelper
Constructor Summary | |
---|---|
AnnotationHelper(ProcessingEnvironment processingEnv)
|
Method Summary | ||
---|---|---|
String |
actionName(String annotationName)
|
|
boolean |
defaultResIdValue(int[] values)
|
|
boolean |
defaultResName(String[] resNames)
|
|
boolean |
enclosingElementHasEnhancedComponentAnnotation(Element element)
|
|
List<DeclaredType> |
extractAnnotationClassArrayParameter(Element element,
String annotationName,
String methodName)
|
|
DeclaredType |
extractAnnotationClassParameter(Element element,
String annotationName)
|
|
DeclaredType |
extractAnnotationClassParameter(Element element,
String annotationName,
String methodName)
|
|
List<com.sun.codemodel.JFieldRef> |
extractAnnotationFieldRefs(ProcessHolder holder,
Element element,
String annotationName,
IRInnerClass rInnerClass,
boolean useElementName)
Returns a list of JFieldRef linking to the R class, based on the
given annotation |
|
|
extractAnnotationParameter(Element element,
String annotationName,
String methodName)
|
|
int[] |
extractAnnotationResIdValueParameter(Element element,
String annotationName)
|
|
String[] |
extractAnnotationResNameParameter(Element element,
String annotationName)
|
|
List<String> |
extractAnnotationResources(Element element,
String annotationName,
IRInnerClass rInnerClass,
boolean useElementName)
Method to handle all annotations dealing with resource ids that can be set using the value() parameter of the annotation (as int or int[]), the resName() parameter of the annotation (as String or String[]), the element name. |
|
String |
extractElementName(Element element,
String annotationName)
|
|
AnnotationMirror |
findAnnotationMirror(Element annotatedElement,
String annotationName)
|
|
Elements |
getElementUtils()
|
|
Types |
getTypeUtils()
|
|
boolean |
hasOneOfClassAnnotations(Element element,
Class<? extends Annotation> validAnnotation)
|
|
boolean |
hasOneOfClassAnnotations(Element element,
List<Class<? extends Annotation>> validAnnotations)
|
|
boolean |
isAbstract(Element element)
|
|
boolean |
isAnnotation(TypeElement annotation,
String annotationName)
|
|
boolean |
isFinal(Element element)
|
|
boolean |
isInterface(TypeElement element)
|
|
boolean |
isPrivate(Element element)
|
|
boolean |
isPublic(Element element)
|
|
boolean |
isSubtype(TypeElement t1,
TypeElement t2)
|
|
boolean |
isSubtype(TypeMirror potentialSubtype,
TypeMirror potentialSupertype)
Tests whether one type is a subtype of another. |
|
boolean |
isSynchronized(Element element)
|
|
boolean |
isTopLevel(TypeElement element)
|
|
void |
printAnnotationError(Element annotatedElement,
String annotationName,
String message)
|
|
void |
printAnnotationMessage(Level level,
Element annotatedElement,
String annotationName,
String message)
|
|
void |
printAnnotationWarning(Element annotatedElement,
String annotationName,
String message)
|
|
void |
printError(Element element,
String message)
|
|
TypeElement |
typeElementFromQualifiedName(String qualifiedName)
This method may return null if the TypeElement cannot be found in
the processor classpath |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AnnotationHelper(ProcessingEnvironment processingEnv)
Method Detail |
---|
public boolean isSubtype(TypeMirror potentialSubtype, TypeMirror potentialSupertype)
public boolean isSubtype(TypeElement t1, TypeElement t2)
public TypeElement typeElementFromQualifiedName(String qualifiedName)
TypeElement
cannot be found in
the processor classpath
public AnnotationMirror findAnnotationMirror(Element annotatedElement, String annotationName)
public boolean isAnnotation(TypeElement annotation, String annotationName)
public void printAnnotationError(Element annotatedElement, String annotationName, String message)
public void printAnnotationWarning(Element annotatedElement, String annotationName, String message)
public void printAnnotationMessage(Level level, Element annotatedElement, String annotationName, String message)
public void printError(Element element, String message)
public boolean isPrivate(Element element)
public boolean isPublic(Element element)
public boolean isAbstract(Element element)
public boolean isInterface(TypeElement element)
public boolean isTopLevel(TypeElement element)
public boolean isFinal(Element element)
public boolean isSynchronized(Element element)
public Elements getElementUtils()
public Types getTypeUtils()
public List<com.sun.codemodel.JFieldRef> extractAnnotationFieldRefs(ProcessHolder holder, Element element, String annotationName, IRInnerClass rInnerClass, boolean useElementName)
JFieldRef
linking to the R class, based on the
given annotation
extractAnnotationResources(Element, String, IRInnerClass, boolean)
public List<String> extractAnnotationResources(Element element, String annotationName, IRInnerClass rInnerClass, boolean useElementName)
element
- the annotated elementannotationName
- the annotation on the elementrInnerClass
- the R innerClass the resources belong touseElementName
- Should we use a default fallback strategy that uses the
element qualified name for a resource name
public String extractElementName(Element element, String annotationName)
public boolean defaultResName(String[] resNames)
public boolean defaultResIdValue(int[] values)
public String[] extractAnnotationResNameParameter(Element element, String annotationName)
public int[] extractAnnotationResIdValueParameter(Element element, String annotationName)
public <T> T extractAnnotationParameter(Element element, String annotationName, String methodName)
public String actionName(String annotationName)
public List<DeclaredType> extractAnnotationClassArrayParameter(Element element, String annotationName, String methodName)
public DeclaredType extractAnnotationClassParameter(Element element, String annotationName, String methodName)
public DeclaredType extractAnnotationClassParameter(Element element, String annotationName)
public boolean enclosingElementHasEnhancedComponentAnnotation(Element element)
public boolean hasOneOfClassAnnotations(Element element, Class<? extends Annotation> validAnnotation)
public boolean hasOneOfClassAnnotations(Element element, List<Class<? extends Annotation>> validAnnotations)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |