Package org.apache.axiom.om

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


        if (messageType.equalsIgnoreCase(HTTPConstants.MEDIA_TYPE_APPLICATION_XML)) {
            outMsgCtx.setProperty(Constants.Configuration.MESSAGE_TYPE, "application/json");
        } else if (messageType.indexOf("json") < 0) {
            throw new AxisFault("Type of the Received Message is not JSON");
        }
        OMDataSource omdataOSuce = ((OMSourcedElement) omEle).getDataSource();
        OMElement newOmEle = (OMElement) omEle.detach();
        ((OMSourcedElement) newOmEle).setDataSource(omdataOSuce);
        return omEle;
    }
View Full Code Here

    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

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

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

    public OMElement getOutputOMElement(final Object returnObject,
                                        final Operation operation,
                                        final JavaObjectSerializer javaObjectSerializer,
                                        SOAPFactory soapFactory) {
        OMDataSource omDataSource = new RMIDataSource() {

            public void serialize(MTOMAwareXMLStreamWriter xmlWriter) throws XMLStreamException {
                try {
                    javaObjectSerializer.serializeOutputElement(returnObject,
                            operation.getOutPutElement(),
View Full Code Here

    public OMElement getParameterOMElement(final Object exceptionObject,
                                           final Parameter parameter,
                                           final JavaObjectSerializer javaObjectSerializer,
                                           SOAPFactory soapFactory){
        OMDataSource omDataSource = new RMIDataSource(){

            public void serialize(MTOMAwareXMLStreamWriter xmlWriter) throws XMLStreamException {
                try {
                    javaObjectSerializer.serializeParameter(exceptionObject,parameter,xmlWriter, new NamespacePrefix());
                } catch (XmlSerializingException e) {
View Full Code Here

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

     * @return true if this OMNode should be considered a leaf node
     */
    private boolean isLeaf(OMNode n) {
        if (n instanceof OMElement) {
            if (this.isDataSourceALeaf && (n instanceof OMSourcedElement) && n != root) {
                OMDataSource ds = null;
                try {
                    ds = ((OMSourcedElement) n).getDataSource();
                } catch (UnsupportedOperationException e) {
                    ; // Operation unsupported for some implementations
                }
View Full Code Here

        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

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.