Package org.apache.axiom.om.impl.dom

Examples of org.apache.axiom.om.impl.dom.ElementImpl


                    ns = new NamespaceImpl("", "");
                   
                }
            }
        }
        ElementImpl eleImpl =
                new ElementImpl((DocumentImpl)this.getOwnerDocument(),
                                localName, ns, this.element.getOMFactory());

        SOAPElementImpl saajEle = new SOAPElementImpl(eleImpl);

        saajEle.setParentElement(parent);
View Full Code Here


                      // Axis2 SAAJ stores the acutal faultcode text under a SOAPFaultValue object, so we have to
                        // get that and add it as a text node under the original element.
                        Node value = se.getFirstChild();
                        if (value != null && value instanceof org.apache.axis2.saaj.SOAPElementImpl) {
                            org.apache.axis2.saaj.SOAPElementImpl valueElement = (org.apache.axis2.saaj.SOAPElementImpl) value;
                            ElementImpl e = valueElement.getElement();
                            String content = e.getText();
                           
                            SOAPElement child = fault.addChildElement(new QName(se.getNamespaceURI(), SOAP11Constants.SOAP_FAULT_CODE_LOCAL_NAME));
                            child.addTextNode(content);
                           
                            se.detachNode();
                        }
                    }
                    else if (se.getLocalName().equals(SOAP12Constants.SOAP_FAULT_DETAIL_LOCAL_NAME)) {
                      if (log.isDebugEnabled()) {
                        log.debug("Converting: detail");
                      }
                        se.setElementQName(new QName(se.getNamespaceURI(), SOAP11Constants.SOAP_FAULT_DETAIL_LOCAL_NAME));
                    }
                    else if (se.getLocalName().equals(SOAP12Constants.SOAP_FAULT_REASON_LOCAL_NAME)) {
                      if (log.isDebugEnabled()) {
                        log.debug("Converting: faultstring");
                      }
                        se.setElementQName(new QName(se.getNamespaceURI(), SOAP11Constants.SOAP_FAULT_STRING_LOCAL_NAME));
                        // Axis2 SAAJ stores the acutal faultstring text under a SOAPFaultValue object, so we have to
                        // get that and add it as a text node under the original element.
                        Node value = se.getFirstChild();
                        if (value != null && value instanceof org.apache.axis2.saaj.SOAPElementImpl) {
                            org.apache.axis2.saaj.SOAPElementImpl valueElement = (org.apache.axis2.saaj.SOAPElementImpl) value;
                            ElementImpl e = valueElement.getElement();
                            String content = e.getText();
                          
                            SOAPElement child = fault.addChildElement(new QName(se.getNamespaceURI(), SOAP11Constants.SOAP_FAULT_STRING_LOCAL_NAME));
                            child.addTextNode(content);
                           
                            se.detachNode();
                        }
                    }
                }
            }
        } catch (SOAPException e) {
          if (log.isDebugEnabled()) {
            log.debug("An error occured while converting fault elements: " + e.getMessage());
          }
            throw ExceptionFactory.makeWebServiceException(e);
        }
    }
View Full Code Here

            }
           
            domNode.setUserData(SAAJ_NODE, saajSOAPPart, null);
            return saajSOAPPart;
        } else { // instanceof org.apache.axis2.om.impl.dom.ElementImpl
            ElementImpl doomElement = (ElementImpl)domNode;
            SOAPElementImpl saajSOAPElement = new SOAPElementImpl(doomElement);
            doomElement.setUserData(SAAJ_NODE, saajSOAPElement, null);
            return saajSOAPElement;
        }
    }
View Full Code Here

                      // Axis2 SAAJ stores the acutal faultcode text under a SOAPFaultValue object, so we have to
                        // get that and add it as a text node under the original element.
                        Node value = se.getFirstChild();
                        if (value != null && value instanceof org.apache.axis2.saaj.SOAPElementImpl) {
                            org.apache.axis2.saaj.SOAPElementImpl valueElement = (org.apache.axis2.saaj.SOAPElementImpl) value;
                            ElementImpl e = valueElement.getElement();
                            String content = e.getText();
                           
                            SOAPElement child = fault.addChildElement(new QName(se.getNamespaceURI(), SOAP11Constants.SOAP_FAULT_CODE_LOCAL_NAME));
                            child.addTextNode(content);
                           
                            se.detachNode();
                        }
                    }
                    else if (se.getLocalName().equals(SOAP12Constants.SOAP_FAULT_DETAIL_LOCAL_NAME)) {
                      if (log.isDebugEnabled()) {
                        log.debug("Converting: detail");
                      }
                        se.setElementQName(new QName(se.getNamespaceURI(), SOAP11Constants.SOAP_FAULT_DETAIL_LOCAL_NAME));
                    }
                    else if (se.getLocalName().equals(SOAP12Constants.SOAP_FAULT_REASON_LOCAL_NAME)) {
                      if (log.isDebugEnabled()) {
                        log.debug("Converting: faultstring");
                      }
                        se.setElementQName(new QName(se.getNamespaceURI(), SOAP11Constants.SOAP_FAULT_STRING_LOCAL_NAME));
                        // Axis2 SAAJ stores the acutal faultstring text under a SOAPFaultValue object, so we have to
                        // get that and add it as a text node under the original element.
                        Node value = se.getFirstChild();
                        if (value != null && value instanceof org.apache.axis2.saaj.SOAPElementImpl) {
                            org.apache.axis2.saaj.SOAPElementImpl valueElement = (org.apache.axis2.saaj.SOAPElementImpl) value;
                            ElementImpl e = valueElement.getElement();
                            String content = e.getText();
                          
                            SOAPElement child = fault.addChildElement(new QName(se.getNamespaceURI(), SOAP11Constants.SOAP_FAULT_STRING_LOCAL_NAME));
                            child.addTextNode(content);
                           
                            se.detachNode();
                        }
                    }
                }
            }
        } catch (SOAPException e) {
          if (log.isDebugEnabled()) {
            log.debug("An error occured while converting fault elements: " + e.getMessage());
          }
            throw ExceptionFactory.makeWebServiceException(e);
        }
    }
View Full Code Here

    getDetail();
    if (getDetail() == null) {
      setDetail(getNewSOAPFaultDetail(this));

    }
    OMElement faultDetailEnty = new ElementImpl(this,
        SOAPConstants.SOAP_FAULT_DETAIL_EXCEPTION_ENTRY,
        null, this.factory);
    faultDetailEnty.setText(sw.getBuffer().toString());
  }
View Full Code Here

    public void setDocument(DocumentImpl document) {
        this.document = document;
    }

    public OMElement createOMElement(String localName, OMNamespace ns) {
        return new ElementImpl((DocumentImpl) this.createOMDocument(),
                localName, (NamespaceImpl) ns, this);
    }
View Full Code Here

    public OMElement createOMElement(String localName, OMNamespace ns,
            OMContainer parent) throws OMDOMException {
        switch (((ParentNode) parent).getNodeType()) {
        case Node.ELEMENT_NODE: // We are adding a new child to an elem
            ElementImpl parentElem = (ElementImpl) parent;
            ElementImpl elem = new ElementImpl((DocumentImpl) parentElem
                    .getOwnerDocument(), localName, (NamespaceImpl) ns, this);
            parentElem.appendChild(elem);
            return elem;

        case Node.DOCUMENT_NODE:
            DocumentImpl docImpl = (DocumentImpl) parent;
            return new ElementImpl(docImpl, localName,
                    (NamespaceImpl) ns, this);

        case Node.DOCUMENT_FRAGMENT_NODE:
            DocumentFragmentimpl docFragImpl = (DocumentFragmentimpl) parent;
            return new ElementImpl((DocumentImpl) docFragImpl
                    .getOwnerDocument(), localName, (NamespaceImpl) ns, this);
        default:
            throw new OMDOMException(
                    "The parent container can only be an ELEMENT, DOCUMENT " +
                    "or a DOCUMENT FRAGMENT");
View Full Code Here

     */
    public OMElement createOMElement(String localName, OMNamespace ns,
            OMContainer parent, OMXMLParserWrapper builder) {
        switch (((ParentNode) parent).getNodeType()) {
        case Node.ELEMENT_NODE: // We are adding a new child to an elem
            ElementImpl parentElem = (ElementImpl) parent;
            ElementImpl elem = new ElementImpl((DocumentImpl) parentElem
                    .getOwnerDocument(), localName, (NamespaceImpl) ns,
                    builder, this);
            parentElem.appendChild(elem);
            return elem;
        case Node.DOCUMENT_NODE:
            DocumentImpl docImpl = (DocumentImpl) parent;
            ElementImpl elem2 = new ElementImpl(docImpl, localName,
                    (NamespaceImpl) ns, builder, this);
            docImpl.appendChild(elem2);
            return elem2;

        case Node.DOCUMENT_FRAGMENT_NODE:
            DocumentFragmentimpl docFragImpl = (DocumentFragmentimpl) parent;
            return new ElementImpl((DocumentImpl) docFragImpl
                    .getOwnerDocument(), localName, (NamespaceImpl) ns,
                    builder, this);
        default:
            throw new OMDOMException(
                    "The parent container can only be an ELEMENT, DOCUMENT " +
View Full Code Here

     *
     * @see org.apache.axiom.om.OMFactory#createOMText(
     *      org.apache.axiom.om.OMElement,java.lang.String)
     */
    public OMText createOMText(OMContainer parent, String text) {
        ElementImpl parentElem = (ElementImpl) parent;
        TextImpl txt = new TextImpl((DocumentImpl) parentElem
                .getOwnerDocument(), text, this);
        parentElem.addChild(txt);
        return txt;
    }
View Full Code Here

        ((OMNodeEx) textNode).setType(type);
        return textNode;
    }

    public OMText createOMText(OMContainer parent, char[] charArary, int type) {
        ElementImpl parentElem = (ElementImpl) parent;
        TextImpl txt = new TextImpl((DocumentImpl) parentElem
                .getOwnerDocument(), charArary, this);
        parentElem.addChild(txt);
        return txt;
    }
View Full Code Here

TOP

Related Classes of org.apache.axiom.om.impl.dom.ElementImpl

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.