Package org.apache.axis2.om

Examples of org.apache.axis2.om.OMAttribute


            } else {
                continue;
            }
            classType = (Class) javaTypes[count];
            //handling refs
            OMAttribute omatribute = MultirefHelper.processRefAtt(omElement);
            String ref = null;
            if (omatribute != null) {
                hasRef = true;
                ref = MultirefHelper.getAttvalue(omatribute);
            }
View Full Code Here


                Object key = attributes[i];

                if ((key == null) && (attributes[i + 1] instanceof OMAttribute[])) {
                    OMAttribute[] omAttributesArray = ((OMAttribute[]) attributes[i + 1]);
                    for (int j = 0; j < omAttributesArray.length; j++) {
                        OMAttribute omAttribute = omAttributesArray[j];
                        checkNamespaceList(omAttribute.getQName().getNamespaceURI(),
                                omAttribute.getQName().getPrefix());
                        attributesList.add(omAttribute.getQName());
                        attributesList.add(omAttribute.getAttributeValue());
                    }

                } else if (key instanceof QName) {
                    QName qName = (QName) key;
                    checkNamespaceList(qName.getNamespaceURI(), qName.getPrefix());
View Full Code Here

    public void processRest(OMElement rpcElement) throws Exception {
        // The siblings of this should be SOAP 1.1 independent elements
        OMNode nextElement = rpcElement.getNextSibling();
        while (nextElement != null) {
            if (nextElement instanceof OMElement) {
                OMAttribute idAttr =
                        ((OMElement)nextElement).getAttribute(new QName("id"));
                if (idAttr != null) {
                    idFound(idAttr.getValue(), (OMElement)nextElement);
                }
            }
            nextElement = nextElement.getNextSibling();
        }
    }
View Full Code Here


    private void compareAttibutes(OMElement elementOne, OMElement elementTwo) throws XMLComparisonException {
        Iterator attributes = elementOne.getAttributes();
        while (attributes.hasNext()) {
            OMAttribute omAttribute = (OMAttribute) attributes.next();
            OMAttribute attr = elementTwo.getFirstAttribute(
                    omAttribute.getQName());
            if (attr == null) {
                throw new XMLComparisonException(
                        "Attributes are not the same in two elements. Attribute " +
                        omAttribute.getLocalName() +
View Full Code Here

        OMNamespaceImpl mime = new OMNamespaceImpl(
                "http://www.w3.org/2003/06/xmlmime", "m");

        OMElement text = new OMElementImpl("name", dataName);
        OMAttribute cType1 = new OMAttributeImpl("contentType", mime,
                "text/plain");
        text.addAttribute(cType1);
        byte[] byteArray = new byte[]{13, 56, 65, 32, 12, 12, 7, -3, -2, -1,
                                      98};
        dataHandler = new DataHandler(new ByteArrayDataSource(byteArray));
View Full Code Here

                    continue;
                }
                Iterator attributes = headerBlock.getAttributes();

                if (attributes.hasNext()) {
                    OMAttribute firstAttribute = (OMAttribute) attributes.next();
                    attributeNS = firstAttribute.getNamespace();
                    attributePresent = true;
                }

                String roleValue = headerBlock.getRole();
                boolean mustUnderstand = headerBlock.getMustUnderstand();
View Full Code Here

     * @param attrValue
     */
    protected void setAttribute(String attributeName,
                                String attrValue,
                                String soapEnvelopeNamespaceURI) {
        OMAttribute omAttribute = this.getFirstAttribute(
                new QName(soapEnvelopeNamespaceURI, attributeName));
        if (omAttribute != null) {
            omAttribute.setValue(attrValue);
        } else {
            OMAttribute attribute = new OMAttributeImpl(attributeName,
                    new OMNamespaceImpl(soapEnvelopeNamespaceURI,
                            SOAPConstants.SOAP_DEFAULT_NAMESPACE_PREFIX),
                    attrValue);
            this.addAttribute(attribute);
        }
View Full Code Here

     * @param attrName
     * @return
     */
    protected String getAttribute(String attrName,
                                  String soapEnvelopeNamespaceURI) {
        OMAttribute omAttribute = this.getFirstAttribute(
                new QName(soapEnvelopeNamespaceURI, attrName));
        return (omAttribute != null)
                ? omAttribute.getValue()
                : null;
    }
View Full Code Here

    }

    public OMElement echoAttachment(OMElement omEle) {
        OMElement child  = (OMElement)omEle.getFirstChild();
        OMAttribute attr = child.getFirstAttribute(new QName("href"));
        String contentID = attr.getValue();
        MIMEHelper attachment = (MIMEHelper)msgcts.getProperty(MTOMConstants.ATTACHMENTS);
        contentID = contentID.trim();

        if (contentID.substring(0, 3).equalsIgnoreCase("cid")) {
            contentID = contentID.substring(4);
View Full Code Here

    protected HandlerDescription processHandler(OMElement handler_element, ParameterInclude parent)
            throws DeploymentException {
        HandlerDescription handler = new HandlerDescription();

        //Setting Handler name
        OMAttribute name_attribute = handler_element.getAttribute(
                new QName(ATTNAME));
        if(name_attribute == null){
            throw new DeploymentException("Invalid Handler");
        } else {
            handler.setName(new QName(name_attribute.getValue()));
        }

        //Setting Handler Class name
        OMAttribute class_attribute = handler_element.getAttribute(
                new QName(CLASSNAME));
        if(class_attribute == null){
            throw new DeploymentException("Invalid Handler");
        } else {
            handler.setClassName(class_attribute.getValue());
        }

        //processing phase Rules (order)
        OMElement order_element = handler_element.getFirstChildWithName(
                new QName(ORDER));
        if(order_element == null){
            throw new DeploymentException("Invaid Handler , phase rule does not specify");
        } else {
            Iterator order_itr = order_element.getAttributes();
            while (order_itr.hasNext()) {
                OMAttribute orderAttribut = (OMAttribute) order_itr.next();
                String name  = orderAttribut.getQName().getLocalPart();
                String value = orderAttribut.getValue();
                if (AFTER.equals(name)) {
                    handler.getRules().setAfter(value);
                } else if (BEFORE.equals(name)) {
                    handler.getRules().setBefore(value);
                } else if (PHASE.equals(name)) {
View Full Code Here

TOP

Related Classes of org.apache.axis2.om.OMAttribute

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.