Examples of OMDataSource


Examples of org.apache.axiom.om.OMDataSource

        if (getEventType() != XMLStreamReader.START_ELEMENT ||
                !(state == this.NAVIGABLE ||
                  state == this.SWITCH_AT_NEXT)) {
            return null;
        }
        OMDataSource ds = null;
        if (lastNode != null &&
            lastNode instanceof OMSourcedElement) {
            try {
                ds = ((OMSourcedElement) lastNode).getDataSource();
            } catch (UnsupportedOperationException e) {
View Full Code Here

Examples of org.apache.axiom.om.OMDataSource

     * @param key
     * @return requested OMDataSourceExt property or null
     */
    protected boolean hasOMDataSourceProperty(String key) {
        if (!this.isExpanded()) {
            OMDataSource ds = this.getDataSource();
            if (ds instanceof OMDataSourceExt) {
                return ((OMDataSourceExt)ds).hasProperty(key);
            }
        }
        return false;
View Full Code Here

Examples of org.apache.axiom.om.OMDataSource

        for (int i=0; i<40000; i++) {
            buffer.append((char)(32 + random.nextInt(96)));
        }
        String testData = buffer.toString();
        QName qname = new QName("data");
        OMDataSource ds = new WrappedTextNodeOMDataSourceFromReader(qname, new StringReader(testData));
        OMFactory factory = metaFactory.getOMFactory();
        OMSourcedElement element = factory.createOMElement(ds, qname);
        assertEquals(testData, element.getText());
    }
View Full Code Here

Examples of org.apache.axiom.om.OMDataSource

            Object jaxb = jdsContext.unmarshal(reader);
            if (log.isDebugEnabled()) {
                log.debug("Successfully unmarshalled jaxb object " + jaxb);
            }
           
            OMDataSource ds = new JAXBDataSource(jaxb, jdsContext);
            if (log.isDebugEnabled()) {
                log.debug("The JAXBDataSource is " + ds);
            }
            OMSourcedElement omse = factory.createOMElement(ds, localPart, ns);
           
View Full Code Here

Examples of org.apache.axiom.om.OMDataSource

    protected Object _getBOFromOM(OMElement omElement, Object busContext)
        throws XMLStreamException, WebServiceException {
       
        // Shortcut to get business object from existing data source
        if (omElement instanceof OMSourcedElement) {
            OMDataSource ds = ((OMSourcedElement) omElement).getDataSource();
            if (ds instanceof XMLStringDataSource) {
                return ((XMLStringDataSource) ds).getObject();
            }
        }
        return super._getBOFromOM(omElement, busContext);
View Full Code Here

Examples of org.apache.axiom.om.OMDataSource

            // If the response is something like JSON calling toString on it wont work. We need to
            // call toStringWithConsume instead, the following checks are checking for this
            // condition.
            if (responseXML instanceof OMSourcedElementImpl) {
                OMSourcedElementImpl sourcedElement = (OMSourcedElementImpl) responseXML;
                OMDataSource dataSource = sourcedElement.getDataSource();
                if (dataSource != null && dataSource instanceof JSONDataSource) {
                    JSONDataSource jsonDataSource = (JSONDataSource) dataSource;
                    responseText = jsonDataSource.getCompleteJOSNString();
                }
            } else {
View Full Code Here

Examples of org.apache.axiom.om.OMDataSource

    private Object call(String method, Reader reader, Object args) throws AxisFault {
        Object functionArgs[];
        try {
            // Handle JSON messages
            if (args instanceof OMSourcedElementImpl) {
                OMDataSource datasource = ((OMSourcedElementImpl) args).getDataSource();
                if (datasource instanceof JSONDataSource) {
                    args = ((JSONDataSource) datasource).getCompleteJOSNString();
                } else if (datasource instanceof JSONBadgerfishDataSource) {
                    args = ((JSONBadgerfishDataSource) datasource).getCompleteJOSNString();
                } else {
View Full Code Here

Examples of org.apache.axiom.om.OMDataSource

    private static void copyOMSourcedElement(SOAPFactory factory,
                                             OMContainer targetParent,
                                             OMSourcedElement sourceOMSE) {
        // If already expanded or this is not an OMDataSourceExt, then
        // create a copy of the OM Tree
        OMDataSource ds = sourceOMSE.getDataSource();
        if (ds == null ||
            sourceOMSE.isExpanded() ||
            !(ds instanceof OMDataSourceExt)) {
            copyOMElement(factory, targetParent, sourceOMSE);
            return;
View Full Code Here

Examples of org.apache.axiom.om.OMDataSource

    private static void copySOAPHeaderBlock(SOAPFactory factory,
                                            OMContainer targetParent,
                                            SOAPHeaderBlock sourceSHB) {
        // If already expanded or this is not an OMDataSourceExt, then
        // create a copy of the OM Tree
        OMDataSource ds = sourceSHB.getDataSource();
        if (ds == null ||
            sourceSHB.isExpanded() ||
            !(ds instanceof OMDataSourceExt)) {
            copySOAPHeaderBlock_NoDataSource(factory, targetParent, sourceSHB);
            return;
View Full Code Here

Examples of org.apache.axiom.om.OMDataSource

        // Get the OM element
        OMElement om = builder.getDocumentElement()
       
        // Verify that the OM Element is backed by an unmarshalled jaxb object
        assertTrue(om instanceof OMSourcedElement);
        OMDataSource ds = ((OMSourcedElement) om).getDataSource();
        assertTrue(ds instanceof JAXBDataSource);
        JAXBDataSource jaxbDS = (JAXBDataSource) ds;
        Object jaxbObject = jaxbDS.getObject();
        assertTrue(jaxbObject instanceof EchoString);
        EchoString result = (EchoString) jaxbObject;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.