javax.xml.bind.annotation.adapters.CollapsedStringAdapter Java Examples

The following examples show how to use javax.xml.bind.annotation.adapters.CollapsedStringAdapter. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ObjectFactory.java    From freehealth-connector with GNU Affero General Public License v3.0 5 votes vote down vote up
@XmlElementDecl(
   namespace = "urn:oasis:names:tc:SAML:1.0:assertion",
   name = "AssertionIDReference"
)
@XmlJavaTypeAdapter(CollapsedStringAdapter.class)
public JAXBElement<String> createAssertionIDReference(String value) {
   return new JAXBElement(_AssertionIDReference_QNAME, String.class, (Class)null, value);
}
 
Example #2
Source File: ObjectFactory.java    From freehealth-connector with GNU Affero General Public License v3.0 5 votes vote down vote up
@XmlElementDecl(
   namespace = "urn:oasis:names:tc:dss:1.0:core:schema",
   name = "Language"
)
@XmlJavaTypeAdapter(CollapsedStringAdapter.class)
public JAXBElement<String> createLanguage(String value) {
   return new JAXBElement(_Language_QNAME, String.class, (Class)null, value);
}
 
Example #3
Source File: ObjectFactory.java    From freehealth-connector with GNU Affero General Public License v3.0 5 votes vote down vote up
@XmlElementDecl(
   namespace = "urn:oasis:names:tc:dss:1.0:core:schema",
   name = "Language"
)
@XmlJavaTypeAdapter(CollapsedStringAdapter.class)
public JAXBElement<String> createLanguage(String value) {
   return new JAXBElement(_Language_QNAME, String.class, (Class)null, value);
}
 
Example #4
Source File: ObjectFactory.java    From freehealth-connector with GNU Affero General Public License v3.0 5 votes vote down vote up
@XmlElementDecl(
   namespace = "urn:oasis:names:tc:SAML:1.0:assertion",
   name = "AssertionIDReference"
)
@XmlJavaTypeAdapter(CollapsedStringAdapter.class)
public JAXBElement<String> createAssertionIDReference(String value) {
   return new JAXBElement(_AssertionIDReference_QNAME, String.class, (Class)null, value);
}
 
Example #5
Source File: ObjectFactory.java    From freehealth-connector with GNU Affero General Public License v3.0 5 votes vote down vote up
@XmlElementDecl(
   namespace = "urn:oasis:names:tc:SAML:1.0:assertion",
   name = "AssertionIDReference"
)
@XmlJavaTypeAdapter(CollapsedStringAdapter.class)
public JAXBElement<String> createAssertionIDReference(String value) {
   return new JAXBElement(_AssertionIDReference_QNAME, String.class, (Class)null, value);
}
 
Example #6
Source File: ObjectFactory.java    From freehealth-connector with GNU Affero General Public License v3.0 5 votes vote down vote up
@XmlElementDecl(
   namespace = "urn:oasis:names:tc:dss:1.0:core:schema",
   name = "Language"
)
@XmlJavaTypeAdapter(CollapsedStringAdapter.class)
public JAXBElement<String> createLanguage(String value) {
   return new JAXBElement(_Language_QNAME, String.class, (Class)null, value);
}
 
Example #7
Source File: ObjectFactory.java    From freehealth-connector with GNU Affero General Public License v3.0 5 votes vote down vote up
@XmlElementDecl(
   namespace = "urn:oasis:names:tc:dss:1.0:core:schema",
   name = "Language"
)
@XmlJavaTypeAdapter(CollapsedStringAdapter.class)
public JAXBElement<String> createLanguage(String value) {
   return new JAXBElement(_Language_QNAME, String.class, (Class)null, value);
}
 
Example #8
Source File: ObjectFactory.java    From freehealth-connector with GNU Affero General Public License v3.0 5 votes vote down vote up
@XmlElementDecl(
   namespace = "urn:oasis:names:tc:SAML:1.0:assertion",
   name = "AssertionIDReference"
)
@XmlJavaTypeAdapter(CollapsedStringAdapter.class)
public JAXBElement<String> createAssertionIDReference(String value) {
   return new JAXBElement(_AssertionIDReference_QNAME, String.class, (Class)null, value);
}
 
Example #9
Source File: ObjectFactory.java    From freehealth-connector with GNU Affero General Public License v3.0 5 votes vote down vote up
@XmlElementDecl(
   namespace = "urn:oasis:names:tc:SAML:2.0:assertion",
   name = "AssertionIDRef"
)
@XmlJavaTypeAdapter(CollapsedStringAdapter.class)
public JAXBElement<String> createAssertionIDRef(String value) {
   return new JAXBElement(_AssertionIDRef_QNAME, String.class, (Class)null, value);
}
 
Example #10
Source File: ObjectFactory.java    From freehealth-connector with GNU Affero General Public License v3.0 5 votes vote down vote up
@XmlElementDecl(
   namespace = "urn:oasis:names:tc:SAML:1.0:assertion",
   name = "AssertionIDReference"
)
@XmlJavaTypeAdapter(CollapsedStringAdapter.class)
public JAXBElement<String> createAssertionIDReference(String value) {
   return new JAXBElement(_AssertionIDReference_QNAME, String.class, (Class)null, value);
}
 
Example #11
Source File: ObjectFactory.java    From freehealth-connector with GNU Affero General Public License v3.0 5 votes vote down vote up
@XmlElementDecl(
   namespace = "urn:oasis:names:tc:dss:1.0:core:schema",
   name = "Language"
)
@XmlJavaTypeAdapter(CollapsedStringAdapter.class)
public JAXBElement<String> createLanguage(String value) {
   return new JAXBElement(_Language_QNAME, String.class, (Class)null, value);
}
 
Example #12
Source File: ObjectFactory.java    From development with Apache License 2.0 5 votes vote down vote up
/**
 * Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >}
 * 
 */
@XmlElementDecl(namespace = "urn:oasis:names:tc:SAML:2.0:assertion", name = "AssertionIDRef")
@XmlJavaTypeAdapter(CollapsedStringAdapter.class)
public JAXBElement<String> createAssertionIDRef(String value) {
    return new JAXBElement<String>(_AssertionIDRef_QNAME, String.class,
            null, value);
}
 
Example #13
Source File: DefaultRepresentativeFraction.java    From sis with Apache License 2.0 5 votes vote down vote up
/**
 * Invoked by JAXB for fetching the unique identifier unique for the XML document.
 *
 * @see org.apache.sis.metadata.iso.ISOMetadata#getID()
 */
@XmlID
@XmlAttribute  // Defined in "gco" as unqualified attribute.
@XmlSchemaType(name = "ID")
@XmlJavaTypeAdapter(CollapsedStringAdapter.class)
private String getID() {
    return isNullOrEmpty(identifiers) ? null : MetadataUtilities.getObjectID(this);
}
 
Example #14
Source File: ISOMetadata.java    From sis with Apache License 2.0 5 votes vote down vote up
/**
 * Returns an identifier unique for the XML document, or {@code null} if none.
 * This method is invoked automatically by JAXB and should never be invoked explicitly.
 */
@XmlID
@XmlAttribute                           // Defined in "gco" as unqualified attribute.
@XmlSchemaType(name = "ID")
@XmlJavaTypeAdapter(CollapsedStringAdapter.class)
private String getID() {
    return isNullOrEmpty(identifiers) ? null : MetadataUtilities.getObjectID(this);
}
 
Example #15
Source File: ISOMetadata.java    From sis with Apache License 2.0 5 votes vote down vote up
/**
 * Returns an unique identifier, or {@code null} if none.
 * This method is invoked automatically by JAXB and should never be invoked explicitly.
 */
@XmlAttribute                           // Defined in "gco" as unqualified attribute.
@XmlJavaTypeAdapter(CollapsedStringAdapter.class)
private String getUUID() {
    /*
     * IdentifierMapAdapter will take care of converting UUID to String,
     * or to return a previously stored String if it was an unparsable UUID.
     */
    return isNullOrEmpty(identifiers) ? null : getIdentifierMap().get(IdentifierSpace.UUID);
}
 
Example #16
Source File: SessionBean$JAXB.java    From tomee with Apache License 2.0 5 votes vote down vote up
public final static void _readDependsOn(final XoXMLStreamReader reader, final RuntimeContext context, final SessionBean sessionBean)
    throws Exception {
    List<String> dependsOn = null;

    // Read elements
    for (final XoXMLStreamReader elementReader : reader.getChildElements()) {
        if (("ejb-name" == elementReader.getLocalName()) && ("http://java.sun.com/xml/ns/javaee" == elementReader.getNamespaceURI())) {
            // ELEMENT: dependsOn
            final String dependsOnItemRaw = elementReader.getElementAsString();

            final String dependsOnItem;
            try {
                dependsOnItem = Adapters.collapsedStringAdapterAdapter.unmarshal(dependsOnItemRaw);
            } catch (final Exception e) {
                context.xmlAdapterError(elementReader, CollapsedStringAdapter.class, String.class, String.class, e);
                continue;
            }

            if (dependsOn == null) {
                dependsOn = sessionBean.dependsOn;
                if (dependsOn != null) {
                    dependsOn.clear();
                } else {
                    dependsOn = new ArrayList<String>();
                }
            }
            dependsOn.add(dependsOnItem);
        }
    }
    if (dependsOn != null) {
        sessionBean.dependsOn = dependsOn;
    }
}
 
Example #17
Source File: AsyncMethod$JAXB.java    From tomee with Apache License 2.0 4 votes vote down vote up
public final static AsyncMethod _read(final XoXMLStreamReader reader, RuntimeContext context)
    throws Exception {

    // Check for xsi:nil
    if (reader.isXsiNil()) {
        return null;
    }

    if (context == null) {
        context = new RuntimeContext();
    }

    final AsyncMethod asyncMethod = new AsyncMethod();
    context.beforeUnmarshal(asyncMethod, LifecycleCallback.NONE);


    // Check xsi:type
    final QName xsiType = reader.getXsiType();
    if (xsiType != null) {
        if (("async-methodType" != xsiType.getLocalPart()) || ("http://java.sun.com/xml/ns/javaee" != xsiType.getNamespaceURI())) {
            return context.unexpectedXsiType(reader, AsyncMethod.class);
        }
    }

    // Read attributes
    for (final Attribute attribute : reader.getAttributes()) {
        if (("id" == attribute.getLocalName()) && (("" == attribute.getNamespace()) || (attribute.getNamespace() == null))) {
            // ATTRIBUTE: id
            final String id = Adapters.collapsedStringAdapterAdapter.unmarshal(attribute.getValue());
            context.addXmlId(reader, id, asyncMethod);
            asyncMethod.id = id;
        } else if (XMLConstants.W3C_XML_SCHEMA_INSTANCE_NS_URI != attribute.getNamespace()) {
            context.unexpectedAttribute(attribute, new QName("", "id"));
        }
    }

    // Read elements
    for (final XoXMLStreamReader elementReader : reader.getChildElements()) {
        if (("method-name" == elementReader.getLocalName()) && ("http://java.sun.com/xml/ns/javaee" == elementReader.getNamespaceURI())) {
            // ELEMENT: methodName
            final String methodNameRaw = elementReader.getElementAsString();

            final String methodName;
            try {
                methodName = Adapters.collapsedStringAdapterAdapter.unmarshal(methodNameRaw);
            } catch (final Exception e) {
                context.xmlAdapterError(elementReader, CollapsedStringAdapter.class, String.class, String.class, e);
                continue;
            }

            asyncMethod.methodName = methodName;
        } else if (("method-params" == elementReader.getLocalName()) && ("http://java.sun.com/xml/ns/javaee" == elementReader.getNamespaceURI())) {
            // ELEMENT: methodParams
            final MethodParams methodParams = readMethodParams(elementReader, context);
            asyncMethod.methodParams = methodParams;
        } else {
            context.unexpectedElement(elementReader, new QName("http://java.sun.com/xml/ns/javaee", "method-name"), new QName("http://java.sun.com/xml/ns/javaee", "method-params"));
        }
    }

    context.afterUnmarshal(asyncMethod, LifecycleCallback.NONE);

    return asyncMethod;
}
 
Example #18
Source File: ApplicationException$JAXB.java    From tomee with Apache License 2.0 4 votes vote down vote up
public final static ApplicationException _read(final XoXMLStreamReader reader, RuntimeContext context)
    throws Exception {

    // Check for xsi:nil
    if (reader.isXsiNil()) {
        return null;
    }

    if (context == null) {
        context = new RuntimeContext();
    }

    final ApplicationException applicationException = new ApplicationException();
    context.beforeUnmarshal(applicationException, LifecycleCallback.NONE);


    // Check xsi:type
    final QName xsiType = reader.getXsiType();
    if (xsiType != null) {
        if (("application-exceptionType" != xsiType.getLocalPart()) || ("http://java.sun.com/xml/ns/javaee" != xsiType.getNamespaceURI())) {
            return context.unexpectedXsiType(reader, ApplicationException.class);
        }
    }

    // Read attributes
    for (final Attribute attribute : reader.getAttributes()) {
        if (("id" == attribute.getLocalName()) && (("" == attribute.getNamespace()) || (attribute.getNamespace() == null))) {
            // ATTRIBUTE: id
            final String id = Adapters.collapsedStringAdapterAdapter.unmarshal(attribute.getValue());
            context.addXmlId(reader, id, applicationException);
            applicationException.id = id;
        } else if (XMLConstants.W3C_XML_SCHEMA_INSTANCE_NS_URI != attribute.getNamespace()) {
            context.unexpectedAttribute(attribute, new QName("", "id"));
        }
    }

    // Read elements
    for (final XoXMLStreamReader elementReader : reader.getChildElements()) {
        if (("exception-class" == elementReader.getLocalName()) && ("http://java.sun.com/xml/ns/javaee" == elementReader.getNamespaceURI())) {
            // ELEMENT: exceptionClass
            final String exceptionClassRaw = elementReader.getElementAsString();

            final String exceptionClass;
            try {
                exceptionClass = Adapters.collapsedStringAdapterAdapter.unmarshal(exceptionClassRaw);
            } catch (final Exception e) {
                context.xmlAdapterError(elementReader, CollapsedStringAdapter.class, String.class, String.class, e);
                continue;
            }

            applicationException.exceptionClass = exceptionClass;
        } else if (("rollback" == elementReader.getLocalName()) && ("http://java.sun.com/xml/ns/javaee" == elementReader.getNamespaceURI())) {
            // ELEMENT: rollback
            final Boolean rollback = ("1".equals(elementReader.getElementAsString()) || "true".equals(elementReader.getElementAsString()));
            applicationException.rollback = rollback;
        } else if (("inherited" == elementReader.getLocalName()) && ("http://java.sun.com/xml/ns/javaee" == elementReader.getNamespaceURI())) {
            // ELEMENT: inherited
            final Boolean inherited = ("1".equals(elementReader.getElementAsString()) || "true".equals(elementReader.getElementAsString()));
            applicationException.inherited = inherited;
        } else {
            context.unexpectedElement(elementReader, new QName("http://java.sun.com/xml/ns/javaee", "exception-class"), new QName("http://java.sun.com/xml/ns/javaee", "rollback"), new QName("http://java.sun.com/xml/ns/javaee", "inherited"));
        }
    }

    context.afterUnmarshal(applicationException, LifecycleCallback.NONE);

    return applicationException;
}
 
Example #19
Source File: ServiceInterfaceMapping$JAXB.java    From tomee with Apache License 2.0 4 votes vote down vote up
public final static ServiceInterfaceMapping _read(final XoXMLStreamReader reader, RuntimeContext context)
    throws Exception {

    // Check for xsi:nil
    if (reader.isXsiNil()) {
        return null;
    }

    if (context == null) {
        context = new RuntimeContext();
    }

    final ServiceInterfaceMapping serviceInterfaceMapping = new ServiceInterfaceMapping();
    context.beforeUnmarshal(serviceInterfaceMapping, LifecycleCallback.NONE);

    List<PortMapping> portMapping = null;

    // Check xsi:type
    final QName xsiType = reader.getXsiType();
    if (xsiType != null) {
        if (("service-interface-mappingType" != xsiType.getLocalPart()) || ("http://java.sun.com/xml/ns/javaee" != xsiType.getNamespaceURI())) {
            return context.unexpectedXsiType(reader, ServiceInterfaceMapping.class);
        }
    }

    // Read attributes
    for (final Attribute attribute : reader.getAttributes()) {
        if (("id" == attribute.getLocalName()) && (("" == attribute.getNamespace()) || (attribute.getNamespace() == null))) {
            // ATTRIBUTE: id
            final String id = Adapters.collapsedStringAdapterAdapter.unmarshal(attribute.getValue());
            context.addXmlId(reader, id, serviceInterfaceMapping);
            serviceInterfaceMapping.id = id;
        } else if (XMLConstants.W3C_XML_SCHEMA_INSTANCE_NS_URI != attribute.getNamespace()) {
            context.unexpectedAttribute(attribute, new QName("", "id"));
        }
    }

    // Read elements
    for (final XoXMLStreamReader elementReader : reader.getChildElements()) {
        if (("service-interface" == elementReader.getLocalName()) && ("http://java.sun.com/xml/ns/javaee" == elementReader.getNamespaceURI())) {
            // ELEMENT: serviceInterface
            final String serviceInterfaceRaw = elementReader.getElementAsString();

            final String serviceInterface;
            try {
                serviceInterface = Adapters.collapsedStringAdapterAdapter.unmarshal(serviceInterfaceRaw);
            } catch (final Exception e) {
                context.xmlAdapterError(elementReader, CollapsedStringAdapter.class, String.class, String.class, e);
                continue;
            }

            serviceInterfaceMapping.serviceInterface = serviceInterface;
        } else if (("wsdl-service-name" == elementReader.getLocalName()) && ("http://java.sun.com/xml/ns/javaee" == elementReader.getNamespaceURI())) {
            // ELEMENT: wsdlServiceName
            final QName wsdlServiceName = elementReader.getElementAsQName();
            serviceInterfaceMapping.wsdlServiceName = wsdlServiceName;
        } else if (("port-mapping" == elementReader.getLocalName()) && ("http://java.sun.com/xml/ns/javaee" == elementReader.getNamespaceURI())) {
            // ELEMENT: portMapping
            final PortMapping portMappingItem = readPortMapping(elementReader, context);
            if (portMapping == null) {
                portMapping = serviceInterfaceMapping.portMapping;
                if (portMapping != null) {
                    portMapping.clear();
                } else {
                    portMapping = new ArrayList<PortMapping>();
                }
            }
            portMapping.add(portMappingItem);
        } else {
            context.unexpectedElement(elementReader, new QName("http://java.sun.com/xml/ns/javaee", "service-interface"), new QName("http://java.sun.com/xml/ns/javaee", "wsdl-service-name"), new QName("http://java.sun.com/xml/ns/javaee", "port-mapping"));
        }
    }
    if (portMapping != null) {
        serviceInterfaceMapping.portMapping = portMapping;
    }

    context.afterUnmarshal(serviceInterfaceMapping, LifecycleCallback.NONE);

    return serviceInterfaceMapping;
}
 
Example #20
Source File: Text$JAXB.java    From tomee with Apache License 2.0 4 votes vote down vote up
public final static Text _read(final XoXMLStreamReader reader, RuntimeContext context)
    throws Exception {

    // Check for xsi:nil
    if (reader.isXsiNil()) {
        return null;
    }

    if (context == null) {
        context = new RuntimeContext();
    }

    final Text text = new Text();
    context.beforeUnmarshal(text, LifecycleCallback.NONE);


    // Check xsi:type
    final QName xsiType = reader.getXsiType();
    if (xsiType != null) {
        if (("string" != xsiType.getLocalPart()) || ("http://java.sun.com/xml/ns/javaee" != xsiType.getNamespaceURI())) {
            return context.unexpectedXsiType(reader, Text.class);
        }
    }

    // Read attributes
    for (final Attribute attribute : reader.getAttributes()) {
        if (("id" == attribute.getLocalName()) && (("" == attribute.getNamespace()) || (attribute.getNamespace() == null))) {
            // ATTRIBUTE: id
            final String id = Adapters.collapsedStringAdapterAdapter.unmarshal(attribute.getValue());
            context.addXmlId(reader, id, text);
            text.id = id;
        } else if (("lang" == attribute.getLocalName()) && ("http://www.w3.org/XML/1998/namespace" == attribute.getNamespace())) {
            // ATTRIBUTE: lang
            text.lang = Adapters.collapsedStringAdapterAdapter.unmarshal(attribute.getValue());
        } else if (XMLConstants.W3C_XML_SCHEMA_INSTANCE_NS_URI != attribute.getNamespace()) {
            context.unexpectedAttribute(attribute, new QName("", "id"), new QName("http://www.w3.org/XML/1998/namespace", "lang"));
        }
    }

    // VALUE: value
    final String valueRaw = reader.getElementText();

    String value = null;
    boolean valueConverted;
    try {
        value = Adapters.collapsedStringAdapterAdapter.unmarshal(valueRaw);
        valueConverted = true;
    } catch (final Exception e) {
        context.xmlAdapterError(reader, CollapsedStringAdapter.class, String.class, String.class, e);
        valueConverted = false;
    }

    if (valueConverted) {
        text.value = value;
    }

    context.afterUnmarshal(text, LifecycleCallback.NONE);

    return text;
}
 
Example #21
Source File: Query$JAXB.java    From tomee with Apache License 2.0 4 votes vote down vote up
public final static Query _read(final XoXMLStreamReader reader, RuntimeContext context)
    throws Exception {

    // Check for xsi:nil
    if (reader.isXsiNil()) {
        return null;
    }

    if (context == null) {
        context = new RuntimeContext();
    }

    final Query query = new Query();
    context.beforeUnmarshal(query, LifecycleCallback.NONE);


    // Check xsi:type
    final QName xsiType = reader.getXsiType();
    if (xsiType != null) {
        if (("queryType" != xsiType.getLocalPart()) || ("http://java.sun.com/xml/ns/javaee" != xsiType.getNamespaceURI())) {
            return context.unexpectedXsiType(reader, Query.class);
        }
    }

    // Read attributes
    for (final Attribute attribute : reader.getAttributes()) {
        if (("id" == attribute.getLocalName()) && (("" == attribute.getNamespace()) || (attribute.getNamespace() == null))) {
            // ATTRIBUTE: id
            final String id = Adapters.collapsedStringAdapterAdapter.unmarshal(attribute.getValue());
            context.addXmlId(reader, id, query);
            query.id = id;
        } else if (XMLConstants.W3C_XML_SCHEMA_INSTANCE_NS_URI != attribute.getNamespace()) {
            context.unexpectedAttribute(attribute, new QName("", "id"));
        }
    }

    // Read elements
    for (final XoXMLStreamReader elementReader : reader.getChildElements()) {
        if (("description" == elementReader.getLocalName()) && ("http://java.sun.com/xml/ns/javaee" == elementReader.getNamespaceURI())) {
            // ELEMENT: description
            final Text description = readText(elementReader, context);
            query.description = description;
        } else if (("query-method" == elementReader.getLocalName()) && ("http://java.sun.com/xml/ns/javaee" == elementReader.getNamespaceURI())) {
            // ELEMENT: queryMethod
            final QueryMethod queryMethod = readQueryMethod(elementReader, context);
            query.queryMethod = queryMethod;
        } else if (("result-type-mapping" == elementReader.getLocalName()) && ("http://java.sun.com/xml/ns/javaee" == elementReader.getNamespaceURI())) {
            // ELEMENT: resultTypeMapping
            final ResultTypeMapping resultTypeMapping = parseResultTypeMapping(elementReader, context, elementReader.getElementAsString());
            if (resultTypeMapping != null) {
                query.resultTypeMapping = resultTypeMapping;
            }
        } else if (("ejb-ql" == elementReader.getLocalName()) && ("http://java.sun.com/xml/ns/javaee" == elementReader.getNamespaceURI())) {
            // ELEMENT: ejbQl
            final String ejbQlRaw = elementReader.getElementAsString();

            final String ejbQl;
            try {
                ejbQl = Adapters.collapsedStringAdapterAdapter.unmarshal(ejbQlRaw);
            } catch (final Exception e) {
                context.xmlAdapterError(elementReader, CollapsedStringAdapter.class, String.class, String.class, e);
                continue;
            }

            query.ejbQl = ejbQl;
        } else {
            context.unexpectedElement(elementReader, new QName("http://java.sun.com/xml/ns/javaee", "description"), new QName("http://java.sun.com/xml/ns/javaee", "query-method"), new QName("http://java.sun.com/xml/ns/javaee", "result-type-mapping"), new QName("http://java.sun.com/xml/ns/javaee", "ejb-ql"));
        }
    }

    context.afterUnmarshal(query, LifecycleCallback.NONE);

    return query;
}
 
Example #22
Source File: TldDeferredMethod$JAXB.java    From tomee with Apache License 2.0 4 votes vote down vote up
public final static TldDeferredMethod _read(final XoXMLStreamReader reader, RuntimeContext context)
    throws Exception {

    // Check for xsi:nil
    if (reader.isXsiNil()) {
        return null;
    }

    if (context == null) {
        context = new RuntimeContext();
    }

    final TldDeferredMethod tldDeferredMethod = new TldDeferredMethod();
    context.beforeUnmarshal(tldDeferredMethod, LifecycleCallback.NONE);


    // Check xsi:type
    final QName xsiType = reader.getXsiType();
    if (xsiType != null) {
        if (("tld-deferred-methodType" != xsiType.getLocalPart()) || ("http://java.sun.com/xml/ns/javaee" != xsiType.getNamespaceURI())) {
            return context.unexpectedXsiType(reader, TldDeferredMethod.class);
        }
    }

    // Read attributes
    for (final Attribute attribute : reader.getAttributes()) {
        if (("id" == attribute.getLocalName()) && (("" == attribute.getNamespace()) || (attribute.getNamespace() == null))) {
            // ATTRIBUTE: id
            final String id = Adapters.collapsedStringAdapterAdapter.unmarshal(attribute.getValue());
            context.addXmlId(reader, id, tldDeferredMethod);
            tldDeferredMethod.id = id;
        } else if (XMLConstants.W3C_XML_SCHEMA_INSTANCE_NS_URI != attribute.getNamespace()) {
            context.unexpectedAttribute(attribute, new QName("", "id"));
        }
    }

    // Read elements
    for (final XoXMLStreamReader elementReader : reader.getChildElements()) {
        if (("method-signature" == elementReader.getLocalName()) && ("http://java.sun.com/xml/ns/javaee" == elementReader.getNamespaceURI())) {
            // ELEMENT: methodSignature
            final String methodSignatureRaw = elementReader.getElementAsString();

            final String methodSignature;
            try {
                methodSignature = Adapters.collapsedStringAdapterAdapter.unmarshal(methodSignatureRaw);
            } catch (final Exception e) {
                context.xmlAdapterError(elementReader, CollapsedStringAdapter.class, String.class, String.class, e);
                continue;
            }

            tldDeferredMethod.methodSignature = methodSignature;
        } else {
            context.unexpectedElement(elementReader, new QName("http://java.sun.com/xml/ns/javaee", "method-signature"));
        }
    }

    context.afterUnmarshal(tldDeferredMethod, LifecycleCallback.NONE);

    return tldDeferredMethod;
}
 
Example #23
Source File: ObjectFactory.java    From tomee with Apache License 2.0 4 votes vote down vote up
/**
 * Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >}}
 */
@XmlElementDecl(namespace = "http://java.sun.com/xml/ns/javaee", name = "http-method", scope = WebResourceCollection.class)
@XmlJavaTypeAdapter(CollapsedStringAdapter.class)
public JAXBElement<String> createWebResourceCollectionTypeHttpMethod(final String value) {
    return new JAXBElement<String>(_WebResourceCollectionTypeHttpMethod_QNAME, String.class, WebResourceCollection.class, value);
}
 
Example #24
Source File: FacesListEntries$JAXB.java    From tomee with Apache License 2.0 4 votes vote down vote up
public final static FacesListEntries _read(final XoXMLStreamReader reader, RuntimeContext context)
    throws Exception {

    // Check for xsi:nil
    if (reader.isXsiNil()) {
        return null;
    }

    if (context == null) {
        context = new RuntimeContext();
    }

    final FacesListEntries facesListEntries = new FacesListEntries();
    context.beforeUnmarshal(facesListEntries, LifecycleCallback.NONE);

    List<Object> nullValueOrValue = null;

    // Check xsi:type
    final QName xsiType = reader.getXsiType();
    if (xsiType != null) {
        if (("faces-config-list-entriesType" != xsiType.getLocalPart()) || ("http://java.sun.com/xml/ns/javaee" != xsiType.getNamespaceURI())) {
            return context.unexpectedXsiType(reader, FacesListEntries.class);
        }
    }

    // Read attributes
    for (final Attribute attribute : reader.getAttributes()) {
        if (("id" == attribute.getLocalName()) && (("" == attribute.getNamespace()) || (attribute.getNamespace() == null))) {
            // ATTRIBUTE: id
            final java.lang.String id = Adapters.collapsedStringAdapterAdapter.unmarshal(attribute.getValue());
            context.addXmlId(reader, id, facesListEntries);
            facesListEntries.id = id;
        } else if (XMLConstants.W3C_XML_SCHEMA_INSTANCE_NS_URI != attribute.getNamespace()) {
            context.unexpectedAttribute(attribute, new QName("", "id"));
        }
    }

    // Read elements
    for (final XoXMLStreamReader elementReader : reader.getChildElements()) {
        if (("value-class" == elementReader.getLocalName()) && ("http://java.sun.com/xml/ns/javaee" == elementReader.getNamespaceURI())) {
            // ELEMENT: valueClass
            final java.lang.String valueClassRaw = elementReader.getElementAsString();

            final java.lang.String valueClass;
            try {
                valueClass = Adapters.collapsedStringAdapterAdapter.unmarshal(valueClassRaw);
            } catch (final Exception e) {
                context.xmlAdapterError(elementReader, CollapsedStringAdapter.class, java.lang.String.class, java.lang.String.class, e);
                continue;
            }

            facesListEntries.valueClass = valueClass;
        } else if (("value" == elementReader.getLocalName()) && ("http://java.sun.com/xml/ns/javaee" == elementReader.getNamespaceURI())) {
            // ELEMENT: nullValueOrValue
            final java.lang.String nullValueOrValueItem = elementReader.getElementAsString();
            if (nullValueOrValue == null) {
                nullValueOrValue = facesListEntries.nullValueOrValue;
                if (nullValueOrValue != null) {
                    nullValueOrValue.clear();
                } else {
                    nullValueOrValue = new ArrayList<Object>();
                }
            }
            nullValueOrValue.add(nullValueOrValueItem);
        } else if (("null-value" == elementReader.getLocalName()) && ("http://java.sun.com/xml/ns/javaee" == elementReader.getNamespaceURI())) {
            // ELEMENT: nullValueOrValue
            final org.apache.openejb.jee.FacesNullValue nullValueOrValueItem1 = readFacesNullValue(elementReader, context);
            if (nullValueOrValue == null) {
                nullValueOrValue = facesListEntries.nullValueOrValue;
                if (nullValueOrValue != null) {
                    nullValueOrValue.clear();
                } else {
                    nullValueOrValue = new ArrayList<Object>();
                }
            }
            nullValueOrValue.add(nullValueOrValueItem1);
        } else {
            context.unexpectedElement(elementReader, new QName("http://java.sun.com/xml/ns/javaee", "value-class"), new QName("http://java.sun.com/xml/ns/javaee", "value"), new QName("http://java.sun.com/xml/ns/javaee", "null-value"));
        }
    }
    if (nullValueOrValue != null) {
        facesListEntries.nullValueOrValue = nullValueOrValue;
    }

    context.afterUnmarshal(facesListEntries, LifecycleCallback.NONE);

    return facesListEntries;
}
 
Example #25
Source File: WelcomeFileList$JAXB.java    From tomee with Apache License 2.0 4 votes vote down vote up
public final static WelcomeFileList _read(final XoXMLStreamReader reader, RuntimeContext context)
    throws Exception {

    // Check for xsi:nil
    if (reader.isXsiNil()) {
        return null;
    }

    if (context == null) {
        context = new RuntimeContext();
    }

    final WelcomeFileList welcomeFileList = new WelcomeFileList();
    context.beforeUnmarshal(welcomeFileList, LifecycleCallback.NONE);

    List<String> welcomeFile = null;

    // Check xsi:type
    final QName xsiType = reader.getXsiType();
    if (xsiType != null) {
        if (("welcome-file-listType" != xsiType.getLocalPart()) || ("http://java.sun.com/xml/ns/javaee" != xsiType.getNamespaceURI())) {
            return context.unexpectedXsiType(reader, WelcomeFileList.class);
        }
    }

    // Read attributes
    for (final Attribute attribute : reader.getAttributes()) {
        if (("id" == attribute.getLocalName()) && (("" == attribute.getNamespace()) || (attribute.getNamespace() == null))) {
            // ATTRIBUTE: id
            final String id = Adapters.collapsedStringAdapterAdapter.unmarshal(attribute.getValue());
            context.addXmlId(reader, id, welcomeFileList);
            welcomeFileList.id = id;
        } else if (XMLConstants.W3C_XML_SCHEMA_INSTANCE_NS_URI != attribute.getNamespace()) {
            context.unexpectedAttribute(attribute, new QName("", "id"));
        }
    }

    // Read elements
    for (final XoXMLStreamReader elementReader : reader.getChildElements()) {
        if (("welcome-file" == elementReader.getLocalName()) && ("http://java.sun.com/xml/ns/javaee" == elementReader.getNamespaceURI())) {
            // ELEMENT: welcomeFile
            final String welcomeFileItemRaw = elementReader.getElementAsString();

            final String welcomeFileItem;
            try {
                welcomeFileItem = Adapters.collapsedStringAdapterAdapter.unmarshal(welcomeFileItemRaw);
            } catch (final Exception e) {
                context.xmlAdapterError(elementReader, CollapsedStringAdapter.class, String.class, String.class, e);
                continue;
            }

            if (welcomeFile == null) {
                welcomeFile = welcomeFileList.welcomeFile;
                if (welcomeFile != null) {
                    welcomeFile.clear();
                } else {
                    welcomeFile = new ArrayList<String>();
                }
            }
            welcomeFile.add(welcomeFileItem);
        } else {
            context.unexpectedElement(elementReader, new QName("http://java.sun.com/xml/ns/javaee", "welcome-file"));
        }
    }
    if (welcomeFile != null) {
        welcomeFileList.welcomeFile = welcomeFile;
    }

    context.afterUnmarshal(welcomeFileList, LifecycleCallback.NONE);

    return welcomeFileList;
}
 
Example #26
Source File: FacesLifecycle$JAXB.java    From tomee with Apache License 2.0 4 votes vote down vote up
public final static FacesLifecycle _read(final XoXMLStreamReader reader, RuntimeContext context)
    throws Exception {

    // Check for xsi:nil
    if (reader.isXsiNil()) {
        return null;
    }

    if (context == null) {
        context = new RuntimeContext();
    }

    final FacesLifecycle facesLifecycle = new FacesLifecycle();
    context.beforeUnmarshal(facesLifecycle, LifecycleCallback.NONE);

    List<String> phaseListener = null;
    List<FacesLifecycleExtension> lifecycleExtension = null;

    // Check xsi:type
    final QName xsiType = reader.getXsiType();
    if (xsiType != null) {
        if (("faces-config-lifecycleType" != xsiType.getLocalPart()) || ("http://java.sun.com/xml/ns/javaee" != xsiType.getNamespaceURI())) {
            return context.unexpectedXsiType(reader, FacesLifecycle.class);
        }
    }

    // Read attributes
    for (final Attribute attribute : reader.getAttributes()) {
        if (("id" == attribute.getLocalName()) && (("" == attribute.getNamespace()) || (attribute.getNamespace() == null))) {
            // ATTRIBUTE: id
            final String id = Adapters.collapsedStringAdapterAdapter.unmarshal(attribute.getValue());
            context.addXmlId(reader, id, facesLifecycle);
            facesLifecycle.id = id;
        } else if (XMLConstants.W3C_XML_SCHEMA_INSTANCE_NS_URI != attribute.getNamespace()) {
            context.unexpectedAttribute(attribute, new QName("", "id"));
        }
    }

    // Read elements
    for (final XoXMLStreamReader elementReader : reader.getChildElements()) {
        if (("phase-listener" == elementReader.getLocalName()) && ("http://java.sun.com/xml/ns/javaee" == elementReader.getNamespaceURI())) {
            // ELEMENT: phaseListener
            final String phaseListenerItemRaw = elementReader.getElementAsString();

            final String phaseListenerItem;
            try {
                phaseListenerItem = Adapters.collapsedStringAdapterAdapter.unmarshal(phaseListenerItemRaw);
            } catch (final Exception e) {
                context.xmlAdapterError(elementReader, CollapsedStringAdapter.class, String.class, String.class, e);
                continue;
            }

            if (phaseListener == null) {
                phaseListener = facesLifecycle.phaseListener;
                if (phaseListener != null) {
                    phaseListener.clear();
                } else {
                    phaseListener = new ArrayList<String>();
                }
            }
            phaseListener.add(phaseListenerItem);
        } else if (("lifecycle-extension" == elementReader.getLocalName()) && ("http://java.sun.com/xml/ns/javaee" == elementReader.getNamespaceURI())) {
            // ELEMENT: lifecycleExtension
            final FacesLifecycleExtension lifecycleExtensionItem = readFacesLifecycleExtension(elementReader, context);
            if (lifecycleExtension == null) {
                lifecycleExtension = facesLifecycle.lifecycleExtension;
                if (lifecycleExtension != null) {
                    lifecycleExtension.clear();
                } else {
                    lifecycleExtension = new ArrayList<FacesLifecycleExtension>();
                }
            }
            lifecycleExtension.add(lifecycleExtensionItem);
        } else {
            // just here ATM to not prevent users to get JSF 2.2 feature because we can't read it
            // TODO: handle it properly
            // context.unexpectedElement(elementReader, new QName("http://java.sun.com/xml/ns/javaee", "phase-listener"), new QName("http://java.sun.com/xml/ns/javaee", "lifecycle-extension"));
        }
    }
    if (phaseListener != null) {
        facesLifecycle.phaseListener = phaseListener;
    }
    if (lifecycleExtension != null) {
        facesLifecycle.lifecycleExtension = lifecycleExtension;
    }

    context.afterUnmarshal(facesLifecycle, LifecycleCallback.NONE);

    return facesLifecycle;
}
 
Example #27
Source File: FacesOrderingOrdering$JAXB.java    From tomee with Apache License 2.0 4 votes vote down vote up
public final static FacesOrderingOrdering _read(final XoXMLStreamReader reader, RuntimeContext context)
    throws Exception {

    // Check for xsi:nil
    if (reader.isXsiNil()) {
        return null;
    }

    if (context == null) {
        context = new RuntimeContext();
    }

    final FacesOrderingOrdering facesOrderingOrdering = new FacesOrderingOrdering();
    context.beforeUnmarshal(facesOrderingOrdering, LifecycleCallback.NONE);

    List<String> name = null;

    // Check xsi:type
    final QName xsiType = reader.getXsiType();
    if (xsiType != null) {
        if (("faces-config-ordering-orderingType" != xsiType.getLocalPart()) || ("http://java.sun.com/xml/ns/javaee" != xsiType.getNamespaceURI())) {
            return context.unexpectedXsiType(reader, FacesOrderingOrdering.class);
        }
    }

    // Read attributes
    for (final Attribute attribute : reader.getAttributes()) {
        if (XMLConstants.W3C_XML_SCHEMA_INSTANCE_NS_URI != attribute.getNamespace()) {
            context.unexpectedAttribute(attribute);
        }
    }

    // Read elements
    for (final XoXMLStreamReader elementReader : reader.getChildElements()) {
        if (("name" == elementReader.getLocalName()) && ("http://java.sun.com/xml/ns/javaee" == elementReader.getNamespaceURI())) {
            // ELEMENT: name
            String nameItemRaw = null;
            if (!elementReader.isXsiNil()) {
                nameItemRaw = elementReader.getElementAsString();
            }

            final String nameItem;
            try {
                nameItem = Adapters.collapsedStringAdapterAdapter.unmarshal(nameItemRaw);
            } catch (final Exception e) {
                context.xmlAdapterError(elementReader, CollapsedStringAdapter.class, String.class, String.class, e);
                continue;
            }

            if (name == null) {
                name = facesOrderingOrdering.name;
                if (name != null) {
                    name.clear();
                } else {
                    name = new ArrayList<String>();
                }
            }
            name.add(nameItem);
        } else if (("others" == elementReader.getLocalName()) && ("http://java.sun.com/xml/ns/javaee" == elementReader.getNamespaceURI())) {
            // ELEMENT: others
            final FacesOrderingOthers others = readFacesOrderingOthers(elementReader, context);
            facesOrderingOrdering.others = others;
        } else {
            context.unexpectedElement(elementReader, new QName("http://java.sun.com/xml/ns/javaee", "name"), new QName("http://java.sun.com/xml/ns/javaee", "others"));
        }
    }
    if (name != null) {
        facesOrderingOrdering.name = name;
    }

    context.afterUnmarshal(facesOrderingOrdering, LifecycleCallback.NONE);

    return facesOrderingOrdering;
}
 
Example #28
Source File: ServiceEndpointInterfaceMapping$JAXB.java    From tomee with Apache License 2.0 4 votes vote down vote up
public final static ServiceEndpointInterfaceMapping _read(final XoXMLStreamReader reader, RuntimeContext context)
    throws Exception {

    // Check for xsi:nil
    if (reader.isXsiNil()) {
        return null;
    }

    if (context == null) {
        context = new RuntimeContext();
    }

    final ServiceEndpointInterfaceMapping serviceEndpointInterfaceMapping = new ServiceEndpointInterfaceMapping();
    context.beforeUnmarshal(serviceEndpointInterfaceMapping, LifecycleCallback.NONE);

    List<ServiceEndpointMethodMapping> serviceEndpointMethodMapping = null;

    // Check xsi:type
    final QName xsiType = reader.getXsiType();
    if (xsiType != null) {
        if (("service-endpoint-interface-mappingType" != xsiType.getLocalPart()) || ("http://java.sun.com/xml/ns/javaee" != xsiType.getNamespaceURI())) {
            return context.unexpectedXsiType(reader, ServiceEndpointInterfaceMapping.class);
        }
    }

    // Read attributes
    for (final Attribute attribute : reader.getAttributes()) {
        if (("id" == attribute.getLocalName()) && (("" == attribute.getNamespace()) || (attribute.getNamespace() == null))) {
            // ATTRIBUTE: id
            final String id = Adapters.collapsedStringAdapterAdapter.unmarshal(attribute.getValue());
            context.addXmlId(reader, id, serviceEndpointInterfaceMapping);
            serviceEndpointInterfaceMapping.id = id;
        } else if (XMLConstants.W3C_XML_SCHEMA_INSTANCE_NS_URI != attribute.getNamespace()) {
            context.unexpectedAttribute(attribute, new QName("", "id"));
        }
    }

    // Read elements
    for (final XoXMLStreamReader elementReader : reader.getChildElements()) {
        if (("service-endpoint-interface" == elementReader.getLocalName()) && ("http://java.sun.com/xml/ns/javaee" == elementReader.getNamespaceURI())) {
            // ELEMENT: serviceEndpointInterface
            final String serviceEndpointInterfaceRaw = elementReader.getElementAsString();

            final String serviceEndpointInterface;
            try {
                serviceEndpointInterface = Adapters.collapsedStringAdapterAdapter.unmarshal(serviceEndpointInterfaceRaw);
            } catch (final Exception e) {
                context.xmlAdapterError(elementReader, CollapsedStringAdapter.class, String.class, String.class, e);
                continue;
            }

            serviceEndpointInterfaceMapping.serviceEndpointInterface = serviceEndpointInterface;
        } else if (("wsdl-port-type" == elementReader.getLocalName()) && ("http://java.sun.com/xml/ns/javaee" == elementReader.getNamespaceURI())) {
            // ELEMENT: wsdlPortType
            final QName wsdlPortType = elementReader.getElementAsQName();
            serviceEndpointInterfaceMapping.wsdlPortType = wsdlPortType;
        } else if (("wsdl-binding" == elementReader.getLocalName()) && ("http://java.sun.com/xml/ns/javaee" == elementReader.getNamespaceURI())) {
            // ELEMENT: wsdlBinding
            final QName wsdlBinding = elementReader.getElementAsQName();
            serviceEndpointInterfaceMapping.wsdlBinding = wsdlBinding;
        } else if (("service-endpoint-method-mapping" == elementReader.getLocalName()) && ("http://java.sun.com/xml/ns/javaee" == elementReader.getNamespaceURI())) {
            // ELEMENT: serviceEndpointMethodMapping
            final ServiceEndpointMethodMapping serviceEndpointMethodMappingItem = readServiceEndpointMethodMapping(elementReader, context);
            if (serviceEndpointMethodMapping == null) {
                serviceEndpointMethodMapping = serviceEndpointInterfaceMapping.serviceEndpointMethodMapping;
                if (serviceEndpointMethodMapping != null) {
                    serviceEndpointMethodMapping.clear();
                } else {
                    serviceEndpointMethodMapping = new ArrayList<ServiceEndpointMethodMapping>();
                }
            }
            serviceEndpointMethodMapping.add(serviceEndpointMethodMappingItem);
        } else {
            context.unexpectedElement(elementReader, new QName("http://java.sun.com/xml/ns/javaee", "service-endpoint-interface"), new QName("http://java.sun.com/xml/ns/javaee", "wsdl-port-type"), new QName("http://java.sun.com/xml/ns/javaee", "wsdl-binding"), new QName("http://java.sun.com/xml/ns/javaee", "service-endpoint-method-mapping"));
        }
    }
    if (serviceEndpointMethodMapping != null) {
        serviceEndpointInterfaceMapping.serviceEndpointMethodMapping = serviceEndpointMethodMapping;
    }

    context.afterUnmarshal(serviceEndpointInterfaceMapping, LifecycleCallback.NONE);

    return serviceEndpointInterfaceMapping;
}
 
Example #29
Source File: TldExtension$JAXB.java    From tomee with Apache License 2.0 4 votes vote down vote up
public final static TldExtension _read(final XoXMLStreamReader reader, RuntimeContext context)
    throws Exception {

    // Check for xsi:nil
    if (reader.isXsiNil()) {
        return null;
    }

    if (context == null) {
        context = new RuntimeContext();
    }

    final TldExtension tldExtension = new TldExtension();
    context.beforeUnmarshal(tldExtension, LifecycleCallback.NONE);

    List<String> extensionElement = null;

    // Check xsi:type
    final QName xsiType = reader.getXsiType();
    if (xsiType != null) {
        if (("tld-extensionType" != xsiType.getLocalPart()) || ("http://java.sun.com/xml/ns/javaee" != xsiType.getNamespaceURI())) {
            return context.unexpectedXsiType(reader, TldExtension.class);
        }
    }

    // Read attributes
    for (final Attribute attribute : reader.getAttributes()) {
        if (("id" == attribute.getLocalName()) && (("" == attribute.getNamespace()) || (attribute.getNamespace() == null))) {
            // ATTRIBUTE: id
            final String id = Adapters.collapsedStringAdapterAdapter.unmarshal(attribute.getValue());
            context.addXmlId(reader, id, tldExtension);
            tldExtension.id = id;
        } else if (("namespace" == attribute.getLocalName()) && (("" == attribute.getNamespace()) || (attribute.getNamespace() == null))) {
            // ATTRIBUTE: namespace
            tldExtension.namespace = Adapters.collapsedStringAdapterAdapter.unmarshal(attribute.getValue());
        } else if (XMLConstants.W3C_XML_SCHEMA_INSTANCE_NS_URI != attribute.getNamespace()) {
            context.unexpectedAttribute(attribute, new QName("", "id"), new QName("", "namespace"));
        }
    }

    // Read elements
    for (final XoXMLStreamReader elementReader : reader.getChildElements()) {
        if (("extension-element" == elementReader.getLocalName()) && ("http://java.sun.com/xml/ns/javaee" == elementReader.getNamespaceURI())) {
            // ELEMENT: extensionElement
            final String extensionElementItemRaw = elementReader.getElementAsString();

            final String extensionElementItem;
            try {
                extensionElementItem = Adapters.collapsedStringAdapterAdapter.unmarshal(extensionElementItemRaw);
            } catch (final Exception e) {
                context.xmlAdapterError(elementReader, CollapsedStringAdapter.class, String.class, String.class, e);
                continue;
            }

            if (extensionElement == null) {
                extensionElement = tldExtension.extensionElement;
                if (extensionElement != null) {
                    extensionElement.clear();
                } else {
                    extensionElement = new ArrayList<String>();
                }
            }
            extensionElement.add(extensionElementItem);
        } else {
            context.unexpectedElement(elementReader, new QName("http://java.sun.com/xml/ns/javaee", "extension-element"));
        }
    }
    if (extensionElement != null) {
        tldExtension.extensionElement = extensionElement;
    }

    context.afterUnmarshal(tldExtension, LifecycleCallback.NONE);

    return tldExtension;
}
 
Example #30
Source File: MethodParamPartsMapping$JAXB.java    From tomee with Apache License 2.0 4 votes vote down vote up
public final static MethodParamPartsMapping _read(final XoXMLStreamReader reader, RuntimeContext context)
    throws Exception {

    // Check for xsi:nil
    if (reader.isXsiNil()) {
        return null;
    }

    if (context == null) {
        context = new RuntimeContext();
    }

    final MethodParamPartsMapping methodParamPartsMapping = new MethodParamPartsMapping();
    context.beforeUnmarshal(methodParamPartsMapping, LifecycleCallback.NONE);


    // Check xsi:type
    final QName xsiType = reader.getXsiType();
    if (xsiType != null) {
        if (("method-param-parts-mappingType" != xsiType.getLocalPart()) || ("http://java.sun.com/xml/ns/javaee" != xsiType.getNamespaceURI())) {
            return context.unexpectedXsiType(reader, MethodParamPartsMapping.class);
        }
    }

    // Read attributes
    for (final Attribute attribute : reader.getAttributes()) {
        if (("id" == attribute.getLocalName()) && (("" == attribute.getNamespace()) || (attribute.getNamespace() == null))) {
            // ATTRIBUTE: id
            final String id = Adapters.collapsedStringAdapterAdapter.unmarshal(attribute.getValue());
            context.addXmlId(reader, id, methodParamPartsMapping);
            methodParamPartsMapping.id = id;
        } else if (XMLConstants.W3C_XML_SCHEMA_INSTANCE_NS_URI != attribute.getNamespace()) {
            context.unexpectedAttribute(attribute, new QName("", "id"));
        }
    }

    // Read elements
    for (final XoXMLStreamReader elementReader : reader.getChildElements()) {
        if (("param-position" == elementReader.getLocalName()) && ("http://java.sun.com/xml/ns/javaee" == elementReader.getNamespaceURI())) {
            // ELEMENT: paramPosition
            final BigInteger paramPosition = new BigInteger(elementReader.getElementAsString());
            methodParamPartsMapping.paramPosition = paramPosition;
        } else if (("param-type" == elementReader.getLocalName()) && ("http://java.sun.com/xml/ns/javaee" == elementReader.getNamespaceURI())) {
            // ELEMENT: paramType
            final String paramTypeRaw = elementReader.getElementAsString();

            final String paramType;
            try {
                paramType = Adapters.collapsedStringAdapterAdapter.unmarshal(paramTypeRaw);
            } catch (final Exception e) {
                context.xmlAdapterError(elementReader, CollapsedStringAdapter.class, String.class, String.class, e);
                continue;
            }

            methodParamPartsMapping.paramType = paramType;
        } else if (("wsdl-message-mapping" == elementReader.getLocalName()) && ("http://java.sun.com/xml/ns/javaee" == elementReader.getNamespaceURI())) {
            // ELEMENT: wsdlMessageMapping
            final WsdlMessageMapping wsdlMessageMapping = readWsdlMessageMapping(elementReader, context);
            methodParamPartsMapping.wsdlMessageMapping = wsdlMessageMapping;
        } else {
            context.unexpectedElement(elementReader, new QName("http://java.sun.com/xml/ns/javaee", "param-position"), new QName("http://java.sun.com/xml/ns/javaee", "param-type"), new QName("http://java.sun.com/xml/ns/javaee", "wsdl-message-mapping"));
        }
    }

    context.afterUnmarshal(methodParamPartsMapping, LifecycleCallback.NONE);

    return methodParamPartsMapping;
}