Search in sources :

Example 6 with MirroredTypeException

use of javax.lang.model.type.MirroredTypeException in project epoxy by airbnb.

the class ResourceProcessor method parseRClass.

private void parseRClass(String rClass, Map<Integer, AndroidResource> symbols) {
    Element element;
    try {
        element = elementUtils.getTypeElement(rClass);
    } catch (MirroredTypeException mte) {
        element = typeUtils.asElement(mte.getTypeMirror());
    }
    JCTree tree = (JCTree) trees.getTree(element);
    if (tree != null) {
        // tree can be null if the references are compiled types and not source
        IdScanner idScanner = new IdScanner(symbols, elementUtils.getPackageOf(element).getQualifiedName().toString());
        tree.accept(idScanner);
    } else {
        parseCompiledR((TypeElement) element, symbols);
    }
}
Also used : MirroredTypeException(javax.lang.model.type.MirroredTypeException) VariableElement(javax.lang.model.element.VariableElement) Element(javax.lang.model.element.Element) TypeElement(javax.lang.model.element.TypeElement) JCTree(com.sun.tools.javac.tree.JCTree)

Aggregations

MirroredTypeException (javax.lang.model.type.MirroredTypeException)6 TypeElement (javax.lang.model.element.TypeElement)5 Element (javax.lang.model.element.Element)4 VariableElement (javax.lang.model.element.VariableElement)4 ExecutableElement (javax.lang.model.element.ExecutableElement)3 TypeMirror (javax.lang.model.type.TypeMirror)3 JCTree (com.sun.tools.javac.tree.JCTree)2 Annotation (java.lang.annotation.Annotation)2 JsonField (com.bluelinelabs.logansquare.annotation.JsonField)1 JsonIgnore (com.bluelinelabs.logansquare.annotation.JsonIgnore)1 JsonFieldHolder (com.bluelinelabs.logansquare.processor.JsonFieldHolder)1 JsonObjectHolder (com.bluelinelabs.logansquare.processor.JsonObjectHolder)1 Embedded (io.requery.Embedded)1 Entity (io.requery.Entity)1 Factory (io.requery.Factory)1 PropertyNameStyle (io.requery.PropertyNameStyle)1 ReadOnly (io.requery.ReadOnly)1 Table (io.requery.Table)1 Transient (io.requery.Transient)1 View (io.requery.View)1