Package org.apache.ws.commons.om

Examples of org.apache.ws.commons.om.OMAttribute


    }


    private void extractRelatesToInformation(SOAPHeaderBlock soapHeaderBlock, String addressingNamespace, Options messageContextOptions) {
        String address = soapHeaderBlock.getText();
        OMAttribute relationshipType =
                soapHeaderBlock.getAttribute(
                        new QName(AddressingConstants.WSA_RELATES_TO_RELATIONSHIP_TYPE));
        String relationshipTypeDefaultValue =
                Submission.WSA_NAMESPACE.equals(addressingNamespace)
                        ? Submission.WSA_RELATES_TO_RELATIONSHIP_TYPE_DEFAULT_VALUE
                        : Final.WSA_RELATES_TO_RELATIONSHIP_TYPE_DEFAULT_VALUE;
        RelatesTo relatesTo =
                new RelatesTo(
                        address,
                        relationshipType == null
                                ? relationshipTypeDefaultValue
                                : relationshipType.getAttributeValue());
        messageContextOptions.setRelatesTo(relatesTo);
        soapHeaderBlock.setProcessed();
    }
View Full Code Here


            }

            //go through the attributes
            NamedNodeMap map = ele.getAttributes();
            Iterator attIterator = omele.getAllAttributes();
            OMAttribute omattribute;
            while (attIterator != null && attIterator.hasNext() && map == null) {
                omattribute = (OMAttribute) attIterator.next();
                Node node = map.getNamedItemNS(
                        omattribute.getNamespace().getName(),
                        omattribute.getLocalName());
                if (node.getNodeType() == Node.ATTRIBUTE_NODE) {
                    Attr attr = (Attr) node;
                    TestCase.assertEquals(attr.getValue(),
                            omattribute.getAttributeValue());
                } else {
                    throw new OMException("return type is not a Attribute");
                }

            }
View Full Code Here

     *
     * @param object the context attribute node
     * @return Returns the namespace URI of the attribute node.
     */
    public String getAttributeNamespaceUri(Object object) {
        OMAttribute attr = (OMAttribute) object;
        return attr.getQName().getNamespaceURI();
    }
View Full Code Here

     *
     * @param object the context attribute node
     * @return Returns the name of the attribute node.
     */
    public String getAttributeName(Object object) {
        OMAttribute attr = (OMAttribute) object;
        return attr.getQName().getLocalPart();
    }
View Full Code Here

     *
     * @param object the context attribute node
     * @return Returns the qualified name of the attribute node.
     */
    public String getAttributeQName(Object object) {
        OMAttribute attr = (OMAttribute) object;
        String prefix = attr.getNamespace().getPrefix();
        if (prefix == null || "".equals(prefix)) {
            return attr.getQName().getLocalPart();
        }
        return prefix + ":" + attr.getNamespace().getName();
    }
View Full Code Here

                declaredNS.add(i.next());
            }
            declaredNS.add(element.getNamespace());
            for (Iterator iter = element.getAllAttributes();
                 iter != null && iter.hasNext();) {
                OMAttribute attr = (OMAttribute) iter.next();
                declaredNS.add(attr.getNamespace());
            }
            for (Iterator iter = declaredNS.iterator();
                 iter != null && iter.hasNext();) {
                OMNamespace namespace = (OMNamespace) iter.next();
                if (namespace != null) {
View Full Code Here

  }

  public Policy readPolicy(OMElement element) {
    Policy policy = new Policy();

    OMAttribute attri;
    attri = element.getAttribute(new QName(
        PolicyConstants.WSU_NAMESPACE_URI, "Id"));
    if (attri != null) {
      policy.setId(attri.getAttributeValue());
    }
    attri = element.getAttribute(new QName(
        PolicyConstants.XML_NAMESPACE_URI, "base"));
    if (attri != null) {
      policy.setBase(attri.getAttributeValue());
    }

    policy.addTerms(readTerms(element));
    return policy;
  }
View Full Code Here

    xorCompositeAssertion.addTerms(readTerms(element));
    return xorCompositeAssertion;
  }

  public PolicyReference readPolicyReference(OMElement element) {
    OMAttribute attribute = element.getAttribute(new QName("URI"));
    return new PolicyReference(attribute.getAttributeValue());
  }
View Full Code Here

  private Hashtable getAttributes(OMElement element) {
    Hashtable attributes = new Hashtable();
    Iterator iterator = element.getAllAttributes();

    while (iterator.hasNext()) {
      OMAttribute attribute = (OMAttribute) iterator.next();
      attributes.put(attribute.getQName(), attribute.getAttributeValue());
    }

    return attributes;
  }
View Full Code Here

TOP

Related Classes of org.apache.ws.commons.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.