Пример #1
0
 public SOAPElement addAttribute(Name name, String value) throws SOAPException {
   addAttributeBare(name, value);
   if (!"".equals(name.getURI())) {
     ensureNamespaceIsDeclared(name.getPrefix(), name.getURI());
   }
   return this;
 }
Пример #2
0
 public Iterator getAllAttributes() {
   Iterator i = getAllAttributesFrom(this);
   ArrayList list = new ArrayList();
   while (i.hasNext()) {
     Name name = (Name) i.next();
     if (!"xmlns".equalsIgnoreCase(name.getPrefix())) list.add(name);
   }
   return list.iterator();
 }
Пример #3
0
  protected SOAPElement createElement(Name name) {

    if (isNamespaceQualified(name)) {
      return (SOAPElement)
          getOwnerDocument().createElementNS(name.getURI(), name.getQualifiedName());
    } else {
      return (SOAPElement) getOwnerDocument().createElement(name.getQualifiedName());
    }
  }
Пример #4
0
  protected SOAPElement circumventBug5034339(SOAPElement element) {

    Name elementName = element.getElementName();
    if (!isNamespaceQualified(elementName)) {
      String prefix = elementName.getPrefix();
      String defaultNamespace = getNamespaceURI(prefix);
      if (defaultNamespace != null) {
        Name newElementName =
            NameImpl.create(elementName.getLocalName(), elementName.getPrefix(), defaultNamespace);
        SOAPElement newElement = createElement(newElementName);
        replaceChild(newElement, element);
        return newElement;
      }
    }
    return element;
  }
Пример #5
0
  protected String getSOAPNamespace() {
    String soapNamespace = null;

    SOAPElement antecedent = this;
    while (antecedent != null) {
      Name antecedentName = antecedent.getElementName();
      String antecedentNamespace = antecedentName.getURI();

      if (NameImpl.SOAP11_NAMESPACE.equals(antecedentNamespace)
          || NameImpl.SOAP12_NAMESPACE.equals(antecedentNamespace)) {

        soapNamespace = antecedentNamespace;
        break;
      }

      antecedent = antecedent.getParentElement();
    }

    return soapNamespace;
  }
Пример #6
0
 protected static String getAttributeValueFrom(Element element, Name name) {
   return getAttributeValueFrom(
       element, name.getURI(), name.getLocalName(), name.getPrefix(), name.getQualifiedName());
 }
Пример #7
0
 public ElementImpl(SOAPDocumentImpl ownerDoc, Name name) {
   super(ownerDoc, name.getURI(), name.getQualifiedName(), name.getLocalName());
   elementQName = NameImpl.convertToQName(name);
 }
Пример #8
0
 public Iterator getChildElements(final Name name) {
   return getChildElements(name.getURI(), name.getLocalName());
 }
Пример #9
0
 public boolean removeAttribute(Name name) {
   return removeAttribute(name.getURI(), name.getLocalName());
 }
Пример #10
0
 private void addAttributeBare(Name name, String value) {
   addAttributeBare(name.getURI(), name.getPrefix(), name.getQualifiedName(), value);
 }
Пример #11
0
 protected boolean isNamespaceQualified(Name name) {
   return !"".equals(name.getURI());
 }