Package org.apache.axiom.om

Examples of org.apache.axiom.om.OMDataSource


    /**
     * setOMDataSource
     */
    public OMDataSource setDataSource(OMDataSource dataSource) {
        if (!isExpanded()) {
            OMDataSource oldDS = this.dataSource;
            this.dataSource = dataSource;
            return oldDS;  // Caller is responsible for closing the data source
        } else {
            // TODO
            // Remove the entire subtree and replace with
            // new datasource.  There maybe a more performant way to do this.
            OMDataSource oldDS = this.dataSource;
            Iterator it = getChildren();
            while(it.hasNext()) {
                OMNode node = (OMNode) it.next();
                node.detach();
            }
View Full Code Here


     * @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

    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

    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

            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

        // 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

        SOAPBody body = env.getBody();
        OMElement child = body.getFirstElement();
        assertTrue(child instanceof OMSourcedElement);
        OMSourcedElement omse = (OMSourcedElement) child;
        assertTrue(!omse.isExpanded());
        OMDataSource ds = omse.getDataSource();
        assertTrue(ds instanceof JAXBBlockImpl);
       
        // Now simulate persisting the message
        File theFile = null;
        String theFilename = null;
View Full Code Here

        SOAPBody body = env.getBody();
        OMElement child = body.getFirstElement();
        assertTrue(child instanceof OMSourcedElement);
        OMSourcedElement omse = (OMSourcedElement) child;
        assertTrue(!omse.isExpanded());
        OMDataSource ds = omse.getDataSource();
        assertTrue(ds instanceof JAXBBlockImpl);
       
        // Now simulate persisting the message in memory
        SOAPEnvelope env2 = CopyUtils.copy(env);
       
View Full Code Here

        SOAPBody body = env.getBody();
        OMElement child = body.getFirstElement();
        assertTrue(child instanceof OMSourcedElement);
        OMSourcedElement omse = (OMSourcedElement) child;
        assertTrue(!omse.isExpanded());
        OMDataSource ds = omse.getDataSource();
        assertTrue(ds instanceof JAXBBlockImpl);
       
        // Now simulate persisting the message
        File theFile = null;
        String theFilename = null;
View Full Code Here

        SOAPBody body = env.getBody();
        OMElement child = body.getFirstElement();
        assertTrue(child instanceof OMSourcedElement);
        OMSourcedElement omse = (OMSourcedElement) child;
        assertTrue(!omse.isExpanded());
        OMDataSource ds = omse.getDataSource();
        assertTrue(ds instanceof JAXBBlockImpl);
       
        // Now simulate persisting the message in memory
        SOAPEnvelope env2 = CopyUtils.copy(env);
       
View Full Code Here

TOP

Related Classes of org.apache.axiom.om.OMDataSource

Copyright © 2018 www.massapicom. 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.