com.sun.xml.internal.ws.spi.db.XMLBridge Java Examples

The following examples show how to use com.sun.xml.internal.ws.spi.db.XMLBridge. 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: BodyBuilder.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Creates a {@link BodyBuilder} from a {@link WrapperParameter}.
 */
DocLit(WrapperParameter wp, SOAPVersion soapVersion, ValueGetterFactory getter) {
    super(wp, soapVersion, getter);
    bindingContext = wp.getOwner().getBindingContext();
    wrapper = (Class)wp.getXMLBridge().getTypeInfo().type;
    dynamicWrapper = WrapperComposite.class.equals(wrapper);
    parameterBridges = new XMLBridge[children.size()];
    accessors = new PropertyAccessor[children.size()];
    for( int i=0; i<accessors.length; i++ ) {
        ParameterImpl p = children.get(i);
        QName name = p.getName();
        if (dynamicWrapper) {
            parameterBridges[i] = children.get(i).getInlinedRepeatedElementBridge();
            if (parameterBridges[i] == null) parameterBridges[i] = children.get(i).getXMLBridge();
        } else {
            try {
                accessors[i] = p.getOwner().getBindingContext().getElementPropertyAccessor(
                    wrapper, name.getNamespaceURI(), name.getLocalPart() );
            } catch (JAXBException e) {
                throw new WebServiceException(  // TODO: i18n
                    wrapper+" do not have a property of the name "+name,e);
            }
        }
    }

}
 
Example #2
Source File: BodyBuilder.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Creates a {@link BodyBuilder} from a {@link WrapperParameter}.
 */
DocLit(WrapperParameter wp, SOAPVersion soapVersion, ValueGetterFactory getter) {
    super(wp, soapVersion, getter);
    bindingContext = wp.getOwner().getBindingContext();
    wrapper = (Class)wp.getXMLBridge().getTypeInfo().type;
    dynamicWrapper = WrapperComposite.class.equals(wrapper);
    parameterBridges = new XMLBridge[children.size()];
    accessors = new PropertyAccessor[children.size()];
    for( int i=0; i<accessors.length; i++ ) {
        ParameterImpl p = children.get(i);
        QName name = p.getName();
        if (dynamicWrapper) {
            parameterBridges[i] = children.get(i).getInlinedRepeatedElementBridge();
            if (parameterBridges[i] == null) parameterBridges[i] = children.get(i).getXMLBridge();
        } else {
            try {
                accessors[i] = p.getOwner().getBindingContext().getElementPropertyAccessor(
                    wrapper, name.getNamespaceURI(), name.getLocalPart() );
            } catch (JAXBException e) {
                throw new WebServiceException(  // TODO: i18n
                    wrapper+" do not have a property of the name "+name,e);
            }
        }
    }

}
 
Example #3
Source File: ParameterImpl.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public XMLBridge getInlinedRepeatedElementBridge() {
    TypeInfo itemType = getItemType();
    if (itemType != null) {
        XMLBridge xb = getOwner().getXMLBridge(itemType);
        if (xb != null) return new RepeatedElementBridge(typeInfo, xb);
    }
    return null;
}
 
Example #4
Source File: AbstractHeaderImpl.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public <T> T readAsJAXB(XMLBridge<T> bridge) throws JAXBException {
    try {
        return bridge.unmarshal(readHeader(), null);
    } catch (XMLStreamException e) {
        throw new JAXBException(e);
    }
}
 
Example #5
Source File: JAXBBridgeSource.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public JAXBBridgeSource( XMLBridge bridge, Object contentObject ) {
    this.bridge = bridge;
    this.contentObject = contentObject;

    super.setXMLReader(pseudoParser);
    // pass a dummy InputSource. We don't care
    super.setInputSource(new InputSource());
}
 
Example #6
Source File: JAXBBridgeSource.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
public JAXBBridgeSource( XMLBridge bridge, Object contentObject ) {
    this.bridge = bridge;
    this.contentObject = contentObject;

    super.setXMLReader(pseudoParser);
    // pass a dummy InputSource. We don't care
    super.setInputSource(new InputSource());
}
 
Example #7
Source File: StreamMessage.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public <T> T readPayloadAsJAXB(XMLBridge<T> bridge) throws JAXBException {
    if(!hasPayload())
        return null;
    assert unconsumed();
    T r = bridge.unmarshal(reader,
        hasAttachments() ? new AttachmentUnmarshallerImpl(getAttachments()) : null);
    XMLStreamReaderUtil.readRest(reader);
    XMLStreamReaderUtil.close(reader);
    XMLStreamReaderFactory.recycle(reader);
    return r;
}
 
Example #8
Source File: JAXBBridgeSource.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
public JAXBBridgeSource( XMLBridge bridge, Object contentObject ) {
    this.bridge = bridge;
    this.contentObject = contentObject;

    super.setXMLReader(pseudoParser);
    // pass a dummy InputSource. We don't care
    super.setInputSource(new InputSource());
}
 
Example #9
Source File: ParameterImpl.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
public XMLBridge getInlinedRepeatedElementBridge() {
    TypeInfo itemType = getItemType();
    if (itemType != null) {
        XMLBridge xb = getOwner().getXMLBridge(itemType);
        if (xb != null) return new RepeatedElementBridge(typeInfo, xb);
    }
    return null;
}
 
Example #10
Source File: AbstractHeaderImpl.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
public <T> T readAsJAXB(XMLBridge<T> bridge) throws JAXBException {
    try {
        return bridge.unmarshal(readHeader(), null);
    } catch (XMLStreamException e) {
        throw new JAXBException(e);
    }
}
 
Example #11
Source File: JAXBMessage.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
private JAXBMessage(XMLBridge bridge, Object jaxbObject, SOAPVersion soapVer) {
    super(soapVer);
    // TODO: think about a better way to handle BridgeContext
    this.bridge = bridge;
    this.rawContext = null;
    this.jaxbObject = jaxbObject;
    QName tagName = bridge.getTypeInfo().tagName;
    this.nsUri = tagName.getNamespaceURI();
    this.localName = tagName.getLocalPart();
    this.attachmentSet = new AttachmentSetImpl();
}
 
Example #12
Source File: JAXBHeader.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public JAXBHeader(XMLBridge bridge, Object jaxbObject) {
    this.jaxbObject = jaxbObject;
    this.bridge = bridge;

    QName tagName = bridge.getTypeInfo().tagName;
    this.nsUri = tagName.getNamespaceURI();
    this.localName = tagName.getLocalPart();
}
 
Example #13
Source File: JAXBMessage.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
private JAXBMessage(XMLBridge bridge, Object jaxbObject, SOAPVersion soapVer) {
    super(soapVer);
    // TODO: think about a better way to handle BridgeContext
    this.bridge = bridge;
    this.rawContext = null;
    this.jaxbObject = jaxbObject;
    QName tagName = bridge.getTypeInfo().tagName;
    this.nsUri = tagName.getNamespaceURI();
    this.localName = tagName.getLocalPart();
    this.attachmentSet = new AttachmentSetImpl();
}
 
Example #14
Source File: JAXBMessage.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
private JAXBMessage(XMLBridge bridge, Object jaxbObject, SOAPVersion soapVer) {
    super(soapVer);
    // TODO: think about a better way to handle BridgeContext
    this.bridge = bridge;
    this.rawContext = null;
    this.jaxbObject = jaxbObject;
    QName tagName = bridge.getTypeInfo().tagName;
    this.nsUri = tagName.getNamespaceURI();
    this.localName = tagName.getLocalPart();
    this.attachmentSet = new AttachmentSetImpl();
}
 
Example #15
Source File: ParameterImpl.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
public XMLBridge getInlinedRepeatedElementBridge() {
    TypeInfo itemType = getItemType();
    if (itemType != null) {
        XMLBridge xb = getOwner().getXMLBridge(itemType);
        if (xb != null) return new RepeatedElementBridge(typeInfo, xb);
    }
    return null;
}
 
Example #16
Source File: AbstractHeaderImpl.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
public <T> T readAsJAXB(XMLBridge<T> bridge) throws JAXBException {
    try {
        return bridge.unmarshal(readHeader(), null);
    } catch (XMLStreamException e) {
        throw new JAXBException(e);
    }
}
 
Example #17
Source File: JAXBRIContextWrapper.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public XMLBridge createBridge(TypeInfo ti) {
    TypeReference tr = typeRefs.get(ti);
    com.sun.xml.internal.bind.api.Bridge b = context.createBridge(tr);
    return WrapperComposite.class.equals(ti.type)
            ? new WrapperBridge(this, b)
            : new BridgeWrapper(this, b);
}
 
Example #18
Source File: AbstractHeaderImpl.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
public <T> T readAsJAXB(XMLBridge<T> bridge) throws JAXBException {
    try {
        return bridge.unmarshal(readHeader(), null);
    } catch (XMLStreamException e) {
        throw new JAXBException(e);
    }
}
 
Example #19
Source File: EndpointResponseMessageBuilder.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Creates a {@link EndpointResponseMessageBuilder} from a {@link WrapperParameter}.
 */
public DocLit(WrapperParameter wp, SOAPVersion soapVersion) {
    super(wp, soapVersion);
    bindingContext = wp.getOwner().getBindingContext();
    wrapper = (Class)wp.getXMLBridge().getTypeInfo().type;
    dynamicWrapper = WrapperComposite.class.equals(wrapper);
    children = wp.getWrapperChildren();
    parameterBridges = new XMLBridge[children.size()];
    accessors = new PropertyAccessor[children.size()];
    for( int i=0; i<accessors.length; i++ ) {
        ParameterImpl p = children.get(i);
        QName name = p.getName();
        if (dynamicWrapper) {
            parameterBridges[i] = children.get(i).getInlinedRepeatedElementBridge();
            if (parameterBridges[i] == null) parameterBridges[i] = children.get(i).getXMLBridge();
        } else {
            try {
                accessors[i] = (dynamicWrapper) ? null :
                    p.getOwner().getBindingContext().getElementPropertyAccessor(
                    wrapper, name.getNamespaceURI(), name.getLocalPart() );
            } catch (JAXBException e) {
                throw new WebServiceException(  // TODO: i18n
                    wrapper+" do not have a property of the name "+name,e);
            }
        }
    }

}
 
Example #20
Source File: ParameterImpl.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public XMLBridge getInlinedRepeatedElementBridge() {
    TypeInfo itemType = getItemType();
    if (itemType != null) {
        XMLBridge xb = getOwner().getXMLBridge(itemType);
        if (xb != null) return new RepeatedElementBridge(typeInfo, xb);
    }
    return null;
}
 
Example #21
Source File: StreamMessage.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
public <T> T readPayloadAsJAXB(XMLBridge<T> bridge) throws JAXBException {
    if(!hasPayload())
        return null;
    assert unconsumed();
    T r = bridge.unmarshal(reader,
        hasAttachments() ? new AttachmentUnmarshallerImpl(getAttachments()) : null);
    XMLStreamReaderUtil.readRest(reader);
    XMLStreamReaderUtil.close(reader);
    XMLStreamReaderFactory.recycle(reader);
    return r;
}
 
Example #22
Source File: JAXBRIContextWrapper.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public XMLBridge createBridge(TypeInfo ti) {
    TypeReference tr = typeRefs.get(ti);
    com.sun.xml.internal.bind.api.Bridge b = context.createBridge(tr);
    return WrapperComposite.class.equals(ti.type)
            ? new WrapperBridge(this, b)
            : new BridgeWrapper(this, b);
}
 
Example #23
Source File: JAXBRIContextWrapper.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
@Override
public XMLBridge createBridge(TypeInfo ti) {
    TypeReference tr = typeRefs.get(ti);
    com.sun.xml.internal.bind.api.Bridge b = context.createBridge(tr);
    return WrapperComposite.class.equals(ti.type)
            ? new WrapperBridge(this, b)
            : new BridgeWrapper(this, b);
}
 
Example #24
Source File: JAXBMessage.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
private JAXBMessage(XMLBridge bridge, Object jaxbObject, SOAPVersion soapVer) {
    super(soapVer);
    // TODO: think about a better way to handle BridgeContext
    this.bridge = bridge;
    this.rawContext = null;
    this.jaxbObject = jaxbObject;
    QName tagName = bridge.getTypeInfo().tagName;
    this.nsUri = tagName.getNamespaceURI();
    this.localName = tagName.getLocalPart();
    this.attachmentSet = new AttachmentSetImpl();
}
 
Example #25
Source File: StreamMessage.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
public <T> T readPayloadAsJAXB(XMLBridge<T> bridge) throws JAXBException {
    if(!hasPayload())
        return null;
    assert unconsumed();
    T r = bridge.unmarshal(reader,
        hasAttachments() ? new AttachmentUnmarshallerImpl(getAttachments()) : null);
    XMLStreamReaderUtil.readRest(reader);
    XMLStreamReaderUtil.close(reader);
    XMLStreamReaderFactory.recycle(reader);
    return r;
}
 
Example #26
Source File: StreamMessage.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public <T> T readPayloadAsJAXB(XMLBridge<T> bridge) throws JAXBException {
    if(!hasPayload())
        return null;
    assert unconsumed();
    T r = bridge.unmarshal(reader,
        hasAttachments() ? new AttachmentUnmarshallerImpl(getAttachments()) : null);
    XMLStreamReaderUtil.readRest(reader);
    XMLStreamReaderUtil.close(reader);
    XMLStreamReaderFactory.recycle(reader);
    return r;
}
 
Example #27
Source File: Headers.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
public static Header create(XMLBridge bridge, Object jaxbObject) {
    return new JAXBHeader(bridge, jaxbObject);
}
 
Example #28
Source File: EndpointResponseMessageBuilder.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
protected JAXB(XMLBridge bridge, SOAPVersion soapVersion) {
    assert bridge!=null;
    this.bridge = bridge;
    this.soapVersion = soapVersion;
}
 
Example #29
Source File: CheckedExceptionImpl.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
public XMLBridge getBond() {
    return getOwner().getXMLBridge(detail);
}
 
Example #30
Source File: FilterMessageImpl.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
public <T> T readPayloadAsJAXB(XMLBridge<T> bridge) throws JAXBException {
    return delegate.readPayloadAsJAXB(bridge);
}