/** * Compute and return the {@link Element} referencing this template. * * @return the elements referencing this template */ public Element[] getReferencingElements() { Set<Name> types = new LinkedHashSet<Name>(); for (ElementMetaModel ref : getElementReferences()) { ElementHandle.Field handle = ref.getElement(); types.add(handle.getTypeName()); } final Element[] elements = new Element[types.size()]; int index = 0; for (Name type : types) { elements[index++] = container.application.getProcessingContext().getTypeElement(type); } return elements; }
/** * Compute and return the {@link Element} referencing this template. * * @return the elements referencing this template */ public Element[] getReferencingElements() { Set<Name> types = new LinkedHashSet<Name>(); for (ElementMetaModel ref : getElementReferences()) { ElementHandle.Field handle = ref.getElement(); types.add(handle.getTypeName()); } final Element[] elements = new Element[types.size()]; int index = 0; for (Name type : types) { elements[index++] = container.application.getProcessingContext().getTypeElement(type); } return elements; }
if (line != null) { String providerName = line.trim(); TypeElement provider = applications.getProcessingContext().getTypeElement(providerName); if (provider.getKind() == ElementKind.CLASS) { List<? extends TypeMirror> superTypes = applications.getProcessingContext().directSupertypes((TypeMirror)provider.asType());
if (line != null) { String providerName = line.trim(); TypeElement provider = applications.getProcessingContext().getTypeElement(providerName); if (provider.getKind() == ElementKind.CLASS) { List<? extends TypeMirror> superTypes = applications.getProcessingContext().directSupertypes((TypeMirror)provider.asType());
case DECLARED: DeclaredType dt = (DeclaredType)parameterTypeMirror; TypeElement col = context.processingContext.getTypeElement("java.util.List"); TypeMirror tm = context.processingContext.erasure(col.asType()); TypeMirror err = context.processingContext.erasure(dt);
case DECLARED: DeclaredType dt = (DeclaredType)parameterTypeMirror; TypeElement col = context.processingContext.getTypeElement("java.util.List"); TypeMirror tm = context.processingContext.erasure(col.asType()); TypeMirror err = context.processingContext.erasure(dt);
TypeMirror providerFactoryTM = env.getTypeElement(ProviderFactory.class.getName()).asType(); TypeElement providerElt = env.getTypeElement("javax.inject.Provider"); DeclaredType providerTM = (DeclaredType)providerElt.asType(); TypeMirror rawProviderTM = env.erasure(providerTM);
TypeMirror providerFactoryTM = env.getTypeElement(ProviderFactory.class.getName()).asType(); TypeElement providerElt = env.getTypeElement("javax.inject.Provider"); DeclaredType providerTM = (DeclaredType)providerElt.asType(); TypeMirror rawProviderTM = env.erasure(providerTM);