use of javax.lang.model.element.ElementKind in project hibernate-orm by hibernate.
the class XmlMetaEntity method parseElementCollection.
private boolean parseElementCollection(ElementCollection collection) {
String[] types;
XmlMetaCollection metaCollection;
ElementKind elementKind = getElementKind(collection.getAccess());
String explicitTargetClass = determineExplicitTargetEntity(collection.getTargetClass());
String explicitMapKey = determineExplicitMapKeyClass(collection.getMapKeyClass());
try {
types = getCollectionTypes(collection.getName(), explicitTargetClass, explicitMapKey, elementKind);
} catch (MetaModelGenerationException e) {
logMetaModelException(collection.getName(), e);
return true;
}
if (types != null) {
if (types[2] == null) {
metaCollection = new XmlMetaCollection(this, collection.getName(), types[0], types[1]);
} else {
metaCollection = new XmlMetaMap(this, collection.getName(), types[0], types[1], types[2]);
}
members.add(metaCollection);
}
return false;
}
use of javax.lang.model.element.ElementKind in project hibernate-orm by hibernate.
the class XmlMetaEntity method parseManyToMany.
private boolean parseManyToMany(ManyToMany manyToMany) {
String[] types;
XmlMetaCollection metaCollection;
ElementKind elementKind = getElementKind(manyToMany.getAccess());
String explicitTargetClass = determineExplicitTargetEntity(manyToMany.getTargetEntity());
String explicitMapKey = determineExplicitMapKeyClass(manyToMany.getMapKeyClass());
try {
types = getCollectionTypes(manyToMany.getName(), explicitTargetClass, explicitMapKey, elementKind);
} catch (MetaModelGenerationException e) {
logMetaModelException(manyToMany.getName(), e);
return true;
}
if (types != null) {
if (types[2] == null) {
metaCollection = new XmlMetaCollection(this, manyToMany.getName(), types[0], types[1]);
} else {
metaCollection = new XmlMetaMap(this, manyToMany.getName(), types[0], types[1], types[2]);
}
members.add(metaCollection);
}
return false;
}
use of javax.lang.model.element.ElementKind in project hibernate-orm by hibernate.
the class XmlMetaEntity method parseEmbedded.
private void parseEmbedded(Embedded embedded) {
XmlMetaSingleAttribute attribute;
ElementKind elementKind = getElementKind(embedded.getAccess());
String type = getType(embedded.getName(), null, elementKind);
if (type != null) {
attribute = new XmlMetaSingleAttribute(this, embedded.getName(), type);
members.add(attribute);
}
}
use of javax.lang.model.element.ElementKind in project hibernate-orm by hibernate.
the class XmlMetaEntity method parseBasic.
private void parseBasic(Basic basic) {
XmlMetaSingleAttribute attribute;
ElementKind elementKind = getElementKind(basic.getAccess());
String type = getType(basic.getName(), null, elementKind);
if (type != null) {
attribute = new XmlMetaSingleAttribute(this, basic.getName(), type);
members.add(attribute);
}
}
use of javax.lang.model.element.ElementKind in project spring-framework by spring-projects.
the class IndexedStereotypesProvider method getStereotypes.
@Override
public Set<String> getStereotypes(Element element) {
Set<String> stereotypes = new LinkedHashSet<>();
ElementKind kind = element.getKind();
if (kind != ElementKind.CLASS && kind != ElementKind.INTERFACE) {
return stereotypes;
}
Set<Element> seen = new HashSet<>();
collectStereotypesOnAnnotations(seen, stereotypes, element);
seen = new HashSet<>();
collectStereotypesOnTypes(seen, stereotypes, element);
return stereotypes;
}
Aggregations