Search in sources :

Example 6 with Elements

use of javax.lang.model.util.Elements in project requery by requery.

the class AttributeMember method processAssociativeAnnotations.

private void processAssociativeAnnotations(ProcessingEnvironment processingEnvironment, ElementValidator validator) {
    Optional<Annotation> oneToOne = annotationOf(OneToOne.class);
    Optional<Annotation> oneToMany = annotationOf(OneToMany.class);
    Optional<Annotation> manyToOne = annotationOf(ManyToOne.class);
    Optional<Annotation> manyToMany = annotationOf(ManyToMany.class);
    oneToOne = oneToOne.isPresent() ? oneToOne : annotationOf(javax.persistence.OneToOne.class);
    oneToMany = oneToMany.isPresent() ? oneToMany : annotationOf(javax.persistence.OneToMany.class);
    manyToOne = manyToOne.isPresent() ? manyToOne : annotationOf(javax.persistence.ManyToOne.class);
    manyToMany = manyToMany.isPresent() ? manyToMany : annotationOf(javax.persistence.ManyToMany.class);
    if (Stream.of(oneToOne, oneToMany, manyToOne, manyToMany).filter(Optional::isPresent).count() > 1) {
        validator.error("Cannot have more than one associative annotation per field");
    }
    if (oneToOne.isPresent()) {
        cardinality = Cardinality.ONE_TO_ONE;
        ReflectiveAssociation reflect = new ReflectiveAssociation(oneToOne.get());
        mappedBy = reflect.mappedBy();
        cascadeActions = reflect.cascade();
        if (!isForeignKey()) {
            isReadOnly = true;
            if (!isKey()) {
                isUnique = true;
            }
        }
    }
    if (oneToMany.isPresent()) {
        isIterable = true;
        cardinality = Cardinality.ONE_TO_MANY;
        isReadOnly = true;
        ReflectiveAssociation reflect = new ReflectiveAssociation(oneToMany.get());
        mappedBy = reflect.mappedBy();
        cascadeActions = reflect.cascade();
        checkIterable(validator);
        processOrderBy();
    }
    if (manyToOne.isPresent()) {
        cardinality = Cardinality.MANY_TO_ONE;
        isForeignKey = true;
        ReflectiveAssociation reflect = new ReflectiveAssociation(manyToOne.get());
        cascadeActions = reflect.cascade();
        if (deleteAction == null) {
            deleteAction = ReferentialAction.CASCADE;
        }
        if (updateAction == null) {
            updateAction = ReferentialAction.CASCADE;
        }
    }
    if (manyToMany.isPresent()) {
        isIterable = true;
        cardinality = Cardinality.MANY_TO_MANY;
        ReflectiveAssociation reflect = new ReflectiveAssociation(manyToMany.get());
        mappedBy = reflect.mappedBy();
        cascadeActions = reflect.cascade();
        Optional<JunctionTable> junctionTable = annotationOf(JunctionTable.class);
        Optional<javax.persistence.JoinTable> joinTable = annotationOf(javax.persistence.JoinTable.class);
        if (junctionTable.isPresent()) {
            Elements elements = processingEnvironment.getElementUtils();
            associativeDescriptor = new JunctionTableAssociation(elements, this, junctionTable.get());
        } else if (joinTable.isPresent()) {
            associativeDescriptor = new JoinTableAssociation(joinTable.get());
        }
        isReadOnly = true;
        checkIterable(validator);
        processOrderBy();
    }
    if (isForeignKey()) {
        if (deleteAction == ReferentialAction.SET_NULL && !isNullable()) {
            validator.error("Cannot SET_NULL on optional attribute", ForeignKey.class);
        }
        // user mirror so generated type can be referenced
        Optional<? extends AnnotationMirror> mirror = Mirrors.findAnnotationMirror(element(), ForeignKey.class);
        if (mirror.isPresent()) {
            referencedType = mirror.flatMap(m -> Mirrors.findAnnotationValue(m, "references")).map(value -> value.getValue().toString()).orElse(null);
        } else if (!typeMirror().getKind().isPrimitive()) {
            referencedType = typeMirror().toString();
        }
    }
}
Also used : Arrays(java.util.Arrays) Nullable(io.requery.Nullable) Modifier(javax.lang.model.element.Modifier) Lazy(io.requery.Lazy) TypeElement(javax.lang.model.element.TypeElement) Elements(javax.lang.model.util.Elements) ForeignKey(io.requery.ForeignKey) EnumType(javax.persistence.EnumType) ConstraintMode(javax.persistence.ConstraintMode) OrderBy(io.requery.OrderBy) Locale(java.util.Locale) Map(java.util.Map) OneToOne(io.requery.OneToOne) PropertyNameStyle(io.requery.PropertyNameStyle) Enumerated(javax.persistence.Enumerated) OneToMany(io.requery.OneToMany) EnumSet(java.util.EnumSet) Index(io.requery.Index) CascadeType(javax.persistence.CascadeType) Naming(io.requery.Naming) Set(java.util.Set) ReadOnly(io.requery.ReadOnly) Element(javax.lang.model.element.Element) Types(javax.lang.model.util.Types) Version(io.requery.Version) TypeKind(javax.lang.model.type.TypeKind) ManyToOne(io.requery.ManyToOne) Basic(javax.persistence.Basic) SourceVersion(javax.lang.model.SourceVersion) GenerationType(javax.persistence.GenerationType) List(java.util.List) Cardinality(io.requery.meta.Cardinality) Stream(java.util.stream.Stream) GeneratedValue(javax.persistence.GeneratedValue) Annotation(java.lang.annotation.Annotation) Optional(java.util.Optional) MapAttributeBuilder(io.requery.meta.MapAttributeBuilder) ListAttributeBuilder(io.requery.meta.ListAttributeBuilder) Key(io.requery.Key) Transient(io.requery.Transient) JunctionTable(io.requery.JunctionTable) VariableElement(javax.lang.model.element.VariableElement) SetAttributeBuilder(io.requery.meta.SetAttributeBuilder) Convert(io.requery.Convert) ReferentialAction(io.requery.ReferentialAction) Embedded(io.requery.Embedded) ElementFilter(javax.lang.model.util.ElementFilter) LinkedHashSet(java.util.LinkedHashSet) ElementKind(javax.lang.model.element.ElementKind) ExecutableElement(javax.lang.model.element.ExecutableElement) JoinColumn(javax.persistence.JoinColumn) EnumOrdinalConverter(io.requery.converter.EnumOrdinalConverter) ResultAttributeBuilder(io.requery.meta.ResultAttributeBuilder) Generated(io.requery.Generated) Order(io.requery.query.Order) AnnotationMirror(javax.lang.model.element.AnnotationMirror) CascadeAction(io.requery.CascadeAction) TypeMirror(javax.lang.model.type.TypeMirror) Column(io.requery.Column) ProcessingEnvironment(javax.annotation.processing.ProcessingEnvironment) FetchType(javax.persistence.FetchType) Collections(java.util.Collections) ManyToMany(io.requery.ManyToMany) AttributeBuilder(io.requery.meta.AttributeBuilder) Optional(java.util.Optional) Elements(javax.lang.model.util.Elements) Annotation(java.lang.annotation.Annotation) JunctionTable(io.requery.JunctionTable)

Example 7 with Elements

use of javax.lang.model.util.Elements in project requery by requery.

the class EntityProcessor method process.

@Override
public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) {
    // types to generate in this round
    Map<TypeElement, EntityElement> entities = new HashMap<>();
    SourceLanguage.map(processingEnv);
    Types types = processingEnv.getTypeUtils();
    Set<TypeElement> annotationElements = new LinkedHashSet<>();
    if (isEmptyKotlinAnnotationSet(annotations)) {
        annotationElements.addAll(SourceLanguage.getAnnotations());
    } else {
        annotationElements.addAll(annotations);
    }
    for (TypeElement annotation : annotationElements) {
        for (Element element : roundEnv.getElementsAnnotatedWith(annotation)) {
            typeElementOf(element).ifPresent(typeElement -> {
                EntityElement entity = null;
                if (isEntity(typeElement)) {
                    entity = computeType(entities, typeElement);
                    String model = entity.modelName();
                    graphs.computeIfAbsent(model, key -> new EntityGraph(types, embeddedTypes)).add(entity);
                } else if (isSuperclass(typeElement)) {
                    entity = computeType(superTypes, typeElement);
                } else if (isEmbeddable(typeElement)) {
                    entity = computeType(embeddedTypes, typeElement);
                }
                if (entity != null) {
                    entity.addAnnotationElement(annotation, element);
                }
            });
        }
    }
    // process
    boolean hasErrors = false;
    Set<ElementValidator> validators = new LinkedHashSet<>();
    Elements elements = processingEnv.getElementUtils();
    for (EntityElement entity : entities.values()) {
        // add the annotated elements from the super type (if any)
        if (entity.element().getKind() == ElementKind.INTERFACE) {
            List<? extends TypeMirror> interfaces = entity.element().getInterfaces();
            for (TypeMirror mirror : interfaces) {
                TypeElement superElement = elements.getTypeElement(mirror.toString());
                if (superElement != null) {
                    mergeSuperType(entity, superElement);
                }
            }
        }
        TypeMirror typeMirror = entity.element().getSuperclass();
        while (typeMirror.getKind() != TypeKind.NONE) {
            TypeElement superElement = elements.getTypeElement(typeMirror.toString());
            if (superElement != null) {
                mergeSuperType(entity, superElement);
                typeMirror = superElement.getSuperclass();
            } else {
                break;
            }
        }
        // process the entity
        Set<ElementValidator> results = entity.process(processingEnv);
        validators.addAll(results);
    }
    for (EntityElement entity : embeddedTypes.values()) {
        Set<ElementValidator> results = entity.process(processingEnv);
        validators.addAll(results);
    }
    for (EntityGraph graph : graphs.values()) {
        EntityGraphValidator validator = new EntityGraphValidator(processingEnv, graph);
        Set<ElementValidator> results = validator.validate();
        validators.addAll(results);
    }
    if (ElementValidator.hasErrors(validators)) {
        hasErrors = true;
        StringBuilder sb = new StringBuilder("Model has error(s) code generation may fail: ");
        validators.forEach(validator -> sb.append(validator.toString()));
        processingEnv.getMessager().printMessage(Diagnostic.Kind.WARNING, sb);
    }
    // generate
    Set<SourceGenerator> generators = new LinkedHashSet<>();
    if (!hasErrors || getOption(GENERATE_ALWAYS, true)) {
        for (EntityDescriptor entity : entities.values()) {
            EntityGraph graph = graphs.get(entity.modelName());
            if (graph != null) {
                generators.add(new EntityGenerator(processingEnv, graph, entity, null));
            }
        }
    }
    if (getOption(GENERATE_MODEL, true)) {
        Map<String, Collection<EntityDescriptor>> packagesMap = new LinkedHashMap<>();
        Set<EntityDescriptor> allEntities = graphs.values().stream().flatMap(graph -> graph.entities().stream()).collect(Collectors.toSet());
        for (EntityDescriptor entity : allEntities) {
            EntityGraph graph = graphs.get(entity.modelName());
            String packageName = findModelPackageName(graph);
            packagesMap.computeIfAbsent(packageName, key -> new LinkedHashSet<>());
            packagesMap.get(packageName).addAll(graph.entities());
        }
        for (EntityDescriptor entity : entities.values()) {
            EntityGraph graph = graphs.get(entity.modelName());
            String packageName = findModelPackageName(graph);
            if (entity.generatesAdditionalTypes()) {
                packagesMap.remove(packageName);
            }
        }
        generators.addAll(packagesMap.entrySet().stream().filter(entry -> !entry.getValue().isEmpty()).filter(entry -> !generatedModelPackages.contains(entry.getKey())).map(entry -> {
            generatedModelPackages.add(entry.getKey());
            return entry;
        }).map(entry -> new ModelGenerator(processingEnv, entry.getKey(), entry.getValue())).collect(Collectors.toList()));
    }
    for (SourceGenerator generator : generators) {
        try {
            generator.generate();
        } catch (IOException e) {
            processingEnv.getMessager().printMessage(Diagnostic.Kind.ERROR, e.getMessage());
        }
    }
    return false;
}
Also used : LinkedHashSet(java.util.LinkedHashSet) AbstractProcessor(javax.annotation.processing.AbstractProcessor) SupportedOptions(javax.annotation.processing.SupportedOptions) TypeElement(javax.lang.model.element.TypeElement) HashMap(java.util.HashMap) SupportedAnnotationTypes(javax.annotation.processing.SupportedAnnotationTypes) Elements(javax.lang.model.util.Elements) GENERATE_MODEL(io.requery.processor.EntityProcessor.GENERATE_MODEL) LinkedHashMap(java.util.LinkedHashMap) Embedded(io.requery.Embedded) Diagnostic(javax.tools.Diagnostic) Map(java.util.Map) GENERATE_JPA(io.requery.processor.EntityProcessor.GENERATE_JPA) LinkedHashSet(java.util.LinkedHashSet) Entity(io.requery.Entity) ElementKind(javax.lang.model.element.ElementKind) Collection(java.util.Collection) Set(java.util.Set) Element(javax.lang.model.element.Element) IOException(java.io.IOException) GENERATE_ALWAYS(io.requery.processor.EntityProcessor.GENERATE_ALWAYS) Superclass(io.requery.Superclass) Types(javax.lang.model.util.Types) Collectors(java.util.stream.Collectors) TypeKind(javax.lang.model.type.TypeKind) SourceVersion(javax.lang.model.SourceVersion) TypeMirror(javax.lang.model.type.TypeMirror) List(java.util.List) RoundEnvironment(javax.annotation.processing.RoundEnvironment) ProcessingEnvironment(javax.annotation.processing.ProcessingEnvironment) Optional(java.util.Optional) SupportedAnnotationTypes(javax.annotation.processing.SupportedAnnotationTypes) Types(javax.lang.model.util.Types) HashMap(java.util.HashMap) LinkedHashMap(java.util.LinkedHashMap) TypeElement(javax.lang.model.element.TypeElement) Element(javax.lang.model.element.Element) Elements(javax.lang.model.util.Elements) LinkedHashMap(java.util.LinkedHashMap) TypeMirror(javax.lang.model.type.TypeMirror) TypeElement(javax.lang.model.element.TypeElement) IOException(java.io.IOException) Collection(java.util.Collection)

Example 8 with Elements

use of javax.lang.model.util.Elements in project requery by requery.

the class EntityType method builderType.

@Override
public Optional<TypeMirror> builderType() {
    Optional<Entity> entityAnnotation = annotationOf(Entity.class);
    if (entityAnnotation.isPresent()) {
        Entity entity = entityAnnotation.get();
        Elements elements = processingEnvironment.getElementUtils();
        TypeMirror mirror = null;
        try {
            // easiest way to get the class TypeMirror
            Class<?> builderClass = entity.builder();
            if (builderClass != void.class) {
                mirror = elements.getTypeElement(builderClass.getName()).asType();
            }
        } catch (MirroredTypeException typeException) {
            mirror = typeException.getTypeMirror();
        }
        if (mirror != null && mirror.getKind() != TypeKind.VOID) {
            return Optional.of(mirror);
        }
    }
    if (builderFactoryMethod().isPresent()) {
        return Optional.of(builderFactoryMethod().get().getReturnType());
    }
    return ElementFilter.typesIn(element().getEnclosedElements()).stream().filter(element -> element.getSimpleName().toString().contains("Builder")).map(Element::asType).filter(Objects::nonNull).filter(type -> type.getKind() != TypeKind.VOID).findFirst();
}
Also used : MirroredTypeException(javax.lang.model.type.MirroredTypeException) Transient(io.requery.Transient) Table(io.requery.Table) Modifier(javax.lang.model.element.Modifier) VariableElement(javax.lang.model.element.VariableElement) TypeElement(javax.lang.model.element.TypeElement) Elements(javax.lang.model.util.Elements) ArrayList(java.util.ArrayList) LinkedHashMap(java.util.LinkedHashMap) Embedded(io.requery.Embedded) Diagnostic(javax.tools.Diagnostic) Map(java.util.Map) MirroredTypeException(javax.lang.model.type.MirroredTypeException) PropertyNameStyle(io.requery.PropertyNameStyle) NestingKind(javax.lang.model.element.NestingKind) ElementFilter(javax.lang.model.util.ElementFilter) LinkedHashSet(java.util.LinkedHashSet) Name(javax.lang.model.element.Name) View(io.requery.View) Entity(io.requery.Entity) ElementKind(javax.lang.model.element.ElementKind) ExecutableElement(javax.lang.model.element.ExecutableElement) Cacheable(javax.persistence.Cacheable) Set(java.util.Set) ReadOnly(io.requery.ReadOnly) Element(javax.lang.model.element.Element) Collectors(java.util.stream.Collectors) TypeKind(javax.lang.model.type.TypeKind) Objects(java.util.Objects) SourceVersion(javax.lang.model.SourceVersion) TypeMirror(javax.lang.model.type.TypeMirror) List(java.util.List) Stream(java.util.stream.Stream) Index(javax.persistence.Index) ProcessingEnvironment(javax.annotation.processing.ProcessingEnvironment) Annotation(java.lang.annotation.Annotation) Factory(io.requery.Factory) Optional(java.util.Optional) Embeddable(javax.persistence.Embeddable) Entity(io.requery.Entity) TypeMirror(javax.lang.model.type.TypeMirror) Objects(java.util.Objects) Elements(javax.lang.model.util.Elements)

Example 9 with Elements

use of javax.lang.model.util.Elements in project requery by requery.

the class EntityType method process.

@Override
public Set<ElementValidator> process(ProcessingEnvironment processingEnvironment) {
    // create attributes for fields that have no annotations
    if (element().getKind().isInterface() || isImmutable() || isUnimplementable()) {
        ElementFilter.methodsIn(element().getEnclosedElements()).stream().filter(this::isMethodProcessable).forEach(this::computeAttribute);
    } else {
        // private/static/final members fields are skipped
        Set<VariableElement> elements = ElementFilter.fieldsIn(element().getEnclosedElements()).stream().filter(element -> !element.getModifiers().contains(Modifier.PRIVATE) && !element.getModifiers().contains(Modifier.STATIC) && (!element.getModifiers().contains(Modifier.FINAL) || isImmutable())).collect(Collectors.toSet());
        if (elements.isEmpty()) {
            // if nothing to process try the getters instead
            ElementFilter.methodsIn(element().getEnclosedElements()).stream().filter(this::isMethodProcessable).forEach(this::computeAttribute);
        } else {
            elements.forEach(this::computeAttribute);
        }
    }
    // find listener annotated methods
    ElementFilter.methodsIn(element().getEnclosedElements()).forEach(element -> ListenerAnnotations.all().forEach(annotation -> {
        if (element.getAnnotation(annotation) != null) {
            ListenerMethod listener = listeners.computeIfAbsent(element, key -> new ListenerMethod(element));
            listener.annotations().put(annotation, element.getAnnotation(annotation));
        }
    }));
    Set<ProcessableElement<?>> elements = new LinkedHashSet<>();
    attributes().values().forEach(attribute -> elements.add((ProcessableElement<?>) attribute));
    elements.addAll(listeners.values());
    Set<ElementValidator> validations = new LinkedHashSet<>();
    elements.forEach(element -> validations.addAll(element.process(processingEnvironment)));
    ElementValidator validator = new ElementValidator(element(), processingEnvironment);
    Entity entity = annotationOf(Entity.class).orElse(null);
    if (entity != null && !Names.isEmpty(entity.name()) && !SourceVersion.isIdentifier(entity.name())) {
        validator.error("Invalid class identifier " + entity.name(), Entity.class);
    }
    if (element().getNestingKind() == NestingKind.ANONYMOUS) {
        validator.error("Entity annotation cannot be applied to anonymous class");
    }
    if (element().getKind() == ElementKind.ENUM) {
        validator.error("Entity annotation cannot be applied to an enum class");
    }
    if (attributes.values().isEmpty()) {
        validator.warning("Entity contains no attributes");
    }
    if (!isReadOnly() && !isEmbedded() && attributes.values().size() == 1 && attributes.values().iterator().next().isGenerated()) {
        validator.warning("Entity contains only a single generated attribute may fail to persist");
    }
    checkReserved(tableName(), validator);
    validations.add(validator);
    return validations;
}
Also used : Transient(io.requery.Transient) Table(io.requery.Table) Modifier(javax.lang.model.element.Modifier) VariableElement(javax.lang.model.element.VariableElement) TypeElement(javax.lang.model.element.TypeElement) Elements(javax.lang.model.util.Elements) ArrayList(java.util.ArrayList) LinkedHashMap(java.util.LinkedHashMap) Embedded(io.requery.Embedded) Diagnostic(javax.tools.Diagnostic) Map(java.util.Map) MirroredTypeException(javax.lang.model.type.MirroredTypeException) PropertyNameStyle(io.requery.PropertyNameStyle) NestingKind(javax.lang.model.element.NestingKind) ElementFilter(javax.lang.model.util.ElementFilter) LinkedHashSet(java.util.LinkedHashSet) Name(javax.lang.model.element.Name) View(io.requery.View) Entity(io.requery.Entity) ElementKind(javax.lang.model.element.ElementKind) ExecutableElement(javax.lang.model.element.ExecutableElement) Cacheable(javax.persistence.Cacheable) Set(java.util.Set) ReadOnly(io.requery.ReadOnly) Element(javax.lang.model.element.Element) Collectors(java.util.stream.Collectors) TypeKind(javax.lang.model.type.TypeKind) Objects(java.util.Objects) SourceVersion(javax.lang.model.SourceVersion) TypeMirror(javax.lang.model.type.TypeMirror) List(java.util.List) Stream(java.util.stream.Stream) Index(javax.persistence.Index) ProcessingEnvironment(javax.annotation.processing.ProcessingEnvironment) Annotation(java.lang.annotation.Annotation) Factory(io.requery.Factory) Optional(java.util.Optional) Embeddable(javax.persistence.Embeddable) LinkedHashSet(java.util.LinkedHashSet) Entity(io.requery.Entity) VariableElement(javax.lang.model.element.VariableElement)

Example 10 with Elements

use of javax.lang.model.util.Elements in project requery by requery.

the class EntityType method typeName.

@Override
public QualifiedName typeName() {
    String entityName = Stream.of(Mirrors.findAnnotationMirror(element(), Entity.class), Mirrors.findAnnotationMirror(element(), javax.persistence.Entity.class)).filter(Optional::isPresent).map(Optional::get).map(mirror -> Mirrors.findAnnotationValue(mirror, "name")).filter(Optional::isPresent).map(Optional::get).map(value -> value.getValue().toString()).filter(name -> !Names.isEmpty(name)).findAny().orElse("");
    Elements elements = processingEnvironment.getElementUtils();
    String packageName = elements.getPackageOf(element()).getQualifiedName().toString();
    // if set in the annotation just use that
    if (!Names.isEmpty(entityName)) {
        return new QualifiedName(packageName, entityName);
    }
    String typeName = element().getSimpleName().toString();
    if (element().getKind().isInterface()) {
        // maybe I<Something> style
        if (typeName.startsWith("I") && Character.isUpperCase(typeName.charAt(1))) {
            entityName = typeName.substring(1);
        } else {
            entityName = typeName + "Entity";
        }
    } else {
        entityName = Names.removeClassPrefixes(typeName);
        if (entityName.equals(typeName)) {
            entityName = typeName + (isImmutable() || isUnimplementable() ? "Type" : "Entity");
        }
    }
    return new QualifiedName(packageName, entityName);
}
Also used : Transient(io.requery.Transient) Table(io.requery.Table) Modifier(javax.lang.model.element.Modifier) VariableElement(javax.lang.model.element.VariableElement) TypeElement(javax.lang.model.element.TypeElement) Elements(javax.lang.model.util.Elements) ArrayList(java.util.ArrayList) LinkedHashMap(java.util.LinkedHashMap) Embedded(io.requery.Embedded) Diagnostic(javax.tools.Diagnostic) Map(java.util.Map) MirroredTypeException(javax.lang.model.type.MirroredTypeException) PropertyNameStyle(io.requery.PropertyNameStyle) NestingKind(javax.lang.model.element.NestingKind) ElementFilter(javax.lang.model.util.ElementFilter) LinkedHashSet(java.util.LinkedHashSet) Name(javax.lang.model.element.Name) View(io.requery.View) Entity(io.requery.Entity) ElementKind(javax.lang.model.element.ElementKind) ExecutableElement(javax.lang.model.element.ExecutableElement) Cacheable(javax.persistence.Cacheable) Set(java.util.Set) ReadOnly(io.requery.ReadOnly) Element(javax.lang.model.element.Element) Collectors(java.util.stream.Collectors) TypeKind(javax.lang.model.type.TypeKind) Objects(java.util.Objects) SourceVersion(javax.lang.model.SourceVersion) TypeMirror(javax.lang.model.type.TypeMirror) List(java.util.List) Stream(java.util.stream.Stream) Index(javax.persistence.Index) ProcessingEnvironment(javax.annotation.processing.ProcessingEnvironment) Annotation(java.lang.annotation.Annotation) Factory(io.requery.Factory) Optional(java.util.Optional) Embeddable(javax.persistence.Embeddable) Optional(java.util.Optional) Elements(javax.lang.model.util.Elements)

Aggregations

Elements (javax.lang.model.util.Elements)66 TypeElement (javax.lang.model.element.TypeElement)44 TypeMirror (javax.lang.model.type.TypeMirror)28 VariableElement (javax.lang.model.element.VariableElement)19 ExecutableElement (javax.lang.model.element.ExecutableElement)17 Types (javax.lang.model.util.Types)17 Element (javax.lang.model.element.Element)15 LinkedHashSet (java.util.LinkedHashSet)14 XmlElements (javax.xml.bind.annotation.XmlElements)14 Metadata (org.apache.camel.spi.Metadata)14 Test (org.junit.Test)14 AnnotationProcessorHelper.findTypeElement (org.apache.camel.tools.apt.AnnotationProcessorHelper.findTypeElement)12 Set (java.util.Set)9 TreeSet (java.util.TreeSet)9 Map (java.util.Map)8 ArrayList (java.util.ArrayList)6 LinkedHashMap (java.util.LinkedHashMap)6 List (java.util.List)6 Optional (java.util.Optional)6 ProcessingEnvironment (javax.annotation.processing.ProcessingEnvironment)6