Search in sources :

Example 1 with JavaPackage

use of org.eclipse.persistence.jaxb.javamodel.JavaPackage in project eclipselink by eclipse-ee4j.

the class AnnotationsProcessor method processPackageLevelAdapters.

/**
 * Process any package-level @XmlJavaTypeAdapters.
 */
private void processPackageLevelAdapters(JavaClass javaClass, TypeInfo info) {
    JavaPackage pack = javaClass.getPackage();
    if (helper.isAnnotationPresent(pack, XmlJavaTypeAdapters.class)) {
        XmlJavaTypeAdapters adapters = (XmlJavaTypeAdapters) helper.getAnnotation(pack, XmlJavaTypeAdapters.class);
        XmlJavaTypeAdapter[] adapterArray = adapters.value();
        for (XmlJavaTypeAdapter next : adapterArray) {
            processPackageLevelAdapter(next, info);
        }
    }
    if (helper.isAnnotationPresent(pack, XmlJavaTypeAdapter.class)) {
        XmlJavaTypeAdapter adapter = (XmlJavaTypeAdapter) helper.getAnnotation(pack, XmlJavaTypeAdapter.class);
        processPackageLevelAdapter(adapter, info);
    }
}
Also used : XmlJavaTypeAdapter(jakarta.xml.bind.annotation.adapters.XmlJavaTypeAdapter) XmlJavaTypeAdapters(jakarta.xml.bind.annotation.adapters.XmlJavaTypeAdapters) JavaPackage(org.eclipse.persistence.jaxb.javamodel.JavaPackage)

Example 2 with JavaPackage

use of org.eclipse.persistence.jaxb.javamodel.JavaPackage 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));
    }
}
Also used : XmlSchemaType(jakarta.xml.bind.annotation.XmlSchemaType) JavaPackage(org.eclipse.persistence.jaxb.javamodel.JavaPackage) XmlSchemaTypes(jakarta.xml.bind.annotation.XmlSchemaTypes)

Aggregations

JavaPackage (org.eclipse.persistence.jaxb.javamodel.JavaPackage)2 XmlSchemaType (jakarta.xml.bind.annotation.XmlSchemaType)1 XmlSchemaTypes (jakarta.xml.bind.annotation.XmlSchemaTypes)1 XmlJavaTypeAdapter (jakarta.xml.bind.annotation.adapters.XmlJavaTypeAdapter)1 XmlJavaTypeAdapters (jakarta.xml.bind.annotation.adapters.XmlJavaTypeAdapters)1