|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.googlecode.androidannotations.helper.AnnotationHelper
public class AnnotationHelper
Constructor Summary | |
---|---|
AnnotationHelper(ProcessingEnvironment processingEnv)
|
Method Summary | ||
---|---|---|
String |
actionName(Class<? extends Annotation> target)
|
|
boolean |
defaultResIdValue(int[] values)
|
|
boolean |
defaultResName(String[] resNames)
|
|
List<DeclaredType> |
extractAnnotationClassArrayParameter(Element element,
Class<? extends Annotation> target,
String methodName)
|
|
DeclaredType |
extractAnnotationClassParameter(Element element,
Class<? extends Annotation> target)
|
|
DeclaredType |
extractAnnotationClassParameter(Element element,
Class<? extends Annotation> target,
String methodName)
|
|
List<com.sun.codemodel.JFieldRef> |
extractAnnotationFieldRefs(EBeanHolder holder,
Element element,
Class<? extends Annotation> target,
IRInnerClass rInnerClass,
boolean useElementName)
Returns a list of JFieldRef linking to the R class, based on the
given annotation |
|
|
extractAnnotationParameter(Element element,
Class<? extends Annotation> target,
String methodName)
|
|
int[] |
extractAnnotationResIdValueParameter(Element element,
Class<? extends Annotation> target)
|
|
String[] |
extractAnnotationResNameParameter(Element element,
Class<? extends Annotation> target)
|
|
List<String> |
extractAnnotationResources(Element element,
Class<? extends Annotation> target,
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,
Class<? extends Annotation> target)
|
|
AnnotationMirror |
findAnnotationMirror(Element annotatedElement,
Class<? extends Annotation> annotationClass)
|
|
Elements |
getElementUtils()
|
|
Types |
getTypeUtils()
|
|
boolean |
isAbstract(Element element)
|
|
boolean |
isAnnotation(TypeElement annotation,
Class<? extends Annotation> annotationClass)
|
|
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,
Class<? extends Annotation> annotationClass,
String message)
|
|
void |
printAnnotationMessage(Diagnostic.Kind diagnosticKind,
Element annotatedElement,
Class<? extends Annotation> annotationClass,
String message)
|
|
void |
printAnnotationWarning(Element annotatedElement,
Class<? extends Annotation> annotationClass,
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, Class<? extends Annotation> annotationClass)
public boolean isAnnotation(TypeElement annotation, Class<? extends Annotation> annotationClass)
public void printAnnotationError(Element annotatedElement, Class<? extends Annotation> annotationClass, String message)
public void printAnnotationWarning(Element annotatedElement, Class<? extends Annotation> annotationClass, String message)
public void printAnnotationMessage(Diagnostic.Kind diagnosticKind, Element annotatedElement, Class<? extends Annotation> annotationClass, 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(EBeanHolder holder, Element element, Class<? extends Annotation> target, IRInnerClass rInnerClass, boolean useElementName)
JFieldRef
linking to the R class, based on the
given annotation
extractAnnotationResources(Element, Class, IRInnerClass, boolean)
public List<String> extractAnnotationResources(Element element, Class<? extends Annotation> target, IRInnerClass rInnerClass, boolean useElementName)
element
- the annotated elementtarget
- 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, Class<? extends Annotation> target)
public boolean defaultResName(String[] resNames)
public boolean defaultResIdValue(int[] values)
public String[] extractAnnotationResNameParameter(Element element, Class<? extends Annotation> target)
public int[] extractAnnotationResIdValueParameter(Element element, Class<? extends Annotation> target)
public <T> T extractAnnotationParameter(Element element, Class<? extends Annotation> target, String methodName)
public String actionName(Class<? extends Annotation> target)
public List<DeclaredType> extractAnnotationClassArrayParameter(Element element, Class<? extends Annotation> target, String methodName)
public DeclaredType extractAnnotationClassParameter(Element element, Class<? extends Annotation> target, String methodName)
public DeclaredType extractAnnotationClassParameter(Element element, Class<? extends Annotation> target)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |