Search in sources :

Example 1 with LocalElement

use of org.glassfish.jaxb.runtime.v2.schemagen.xmlschema.LocalElement in project metro-jax-ws by eclipse-ee4j.

the class ServiceArtifactSchemaGenerator method addChild.

protected Occurs addChild(ExplicitGroup sq, QName name, TypeInfo typeInfo) {
    LocalElement le = null;
    QName type = model.getBindingContext().getTypeName(typeInfo);
    if (type != null) {
        le = sq.element();
        le._attribute("name", name.getLocalPart());
        le.type(type);
    } else {
        if (typeInfo.type instanceof Class) {
            try {
                QName elemName = model.getBindingContext().getElementName((Class) typeInfo.type);
                if (elemName.getLocalPart().equals("any") && elemName.getNamespaceURI().equals(WSDLGenerator.XsdNs)) {
                    return sq.any();
                } else {
                    le = sq.element();
                    le.ref(elemName);
                }
            } catch (JAXBException je) {
                throw new WebServiceException(je.getMessage(), je);
            }
        }
    }
    return le;
}
Also used : WebServiceException(jakarta.xml.ws.WebServiceException) QName(javax.xml.namespace.QName) LocalElement(org.glassfish.jaxb.runtime.v2.schemagen.xmlschema.LocalElement) JAXBException(jakarta.xml.bind.JAXBException)

Aggregations

JAXBException (jakarta.xml.bind.JAXBException)1 WebServiceException (jakarta.xml.ws.WebServiceException)1 QName (javax.xml.namespace.QName)1 LocalElement (org.glassfish.jaxb.runtime.v2.schemagen.xmlschema.LocalElement)1