/** * 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. * * @param element * the annotated element * @param annotationName * the annotation on the element * @param rInnerClass * the R innerClass the resources belong to * @param useElementName * Should we use a default fallback strategy that uses the element * qualified name for a resource name * @return the qualified names of the matching resources in the R inner class */ public List<String> extractAnnotationResources(Element element, String annotationName, IRInnerClass rInnerClass, boolean useElementName) { return extractAnnotationResources(element, annotationName, rInnerClass, useElementName, DEFAULT_FIELD_NAME_VALUE, DEFAULT_FIELD_NAME_RESNAME); }
public List<JFieldRef> extractAnnotationFieldRefs(Element element, String annotationName, IRInnerClass rInnerClass, boolean useElementName, String idFieldName, String resFieldName) { List<JFieldRef> fieldRefs = new ArrayList<>(); for (String refQualifiedName : extractAnnotationResources(element, annotationName, rInnerClass, useElementName, idFieldName, resFieldName)) { fieldRefs.add(RInnerClass.extractIdStaticRef(environment, refQualifiedName)); } return fieldRefs; }
/** * 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. * * @param element * the annotated element * @param annotationName * the annotation on the element * @param rInnerClass * the R innerClass the resources belong to * @param useElementName * Should we use a default fallback strategy that uses the element * qualified name for a resource name * @return the qualified names of the matching resources in the R inner class */ public List<String> extractAnnotationResources(Element element, String annotationName, IRInnerClass rInnerClass, boolean useElementName) { return extractAnnotationResources(element, annotationName, rInnerClass, useElementName, DEFAULT_FIELD_NAME_VALUE, DEFAULT_FIELD_NAME_RESNAME); }
public List<JFieldRef> extractAnnotationFieldRefs(Element element, String annotationName, IRInnerClass rInnerClass, boolean useElementName, String idFieldName, String resFieldName) { List<JFieldRef> fieldRefs = new ArrayList<>(); for (String refQualifiedName : extractAnnotationResources(element, annotationName, rInnerClass, useElementName, idFieldName, resFieldName)) { fieldRefs.add(RInnerClass.extractIdStaticRef(environment, refQualifiedName)); } return fieldRefs; }