use of jakarta.xml.bind.annotation.XmlSchemaTypes in project jaxb-ri by eclipse-ee4j.
the class Util method calcSchemaType.
static <T, C, F, M> QName calcSchemaType(AnnotationReader<T, C, F, M> reader, AnnotationSource primarySource, C enclosingClass, T individualType, Locatable src) {
XmlSchemaType xst = primarySource.readAnnotation(XmlSchemaType.class);
if (xst != null) {
return new QName(xst.namespace(), xst.name());
}
// check the defaulted annotation
XmlSchemaTypes xsts = reader.getPackageAnnotation(XmlSchemaTypes.class, enclosingClass, src);
XmlSchemaType[] values = null;
if (xsts != null)
values = xsts.value();
else {
xst = reader.getPackageAnnotation(XmlSchemaType.class, enclosingClass, src);
if (xst != null) {
values = new XmlSchemaType[1];
values[0] = xst;
}
}
if (values != null) {
for (XmlSchemaType item : values) {
if (reader.getClassValue(item, "type").equals(individualType)) {
return new QName(item.namespace(), item.name());
}
}
}
return null;
}
use of jakarta.xml.bind.annotation.XmlSchemaTypes in project eclipselink by eclipse-ee4j.
the class AnnotationsProcessor method processSchemaTypes.
/**
* Process any @XmlSchemaType(s).
*/
private void processSchemaTypes(JavaClass javaClass, TypeInfo info) {
JavaPackage pack = javaClass.getPackage();
if (helper.isAnnotationPresent(pack, XmlSchemaTypes.class)) {
XmlSchemaTypes types = (XmlSchemaTypes) helper.getAnnotation(pack, XmlSchemaTypes.class);
XmlSchemaType[] typeArray = types.value();
for (XmlSchemaType next : typeArray) {
processSchemaType(next);
}
} else if (helper.isAnnotationPresent(pack, XmlSchemaType.class)) {
processSchemaType((XmlSchemaType) helper.getAnnotation(pack, XmlSchemaType.class));
}
}
Aggregations