Ejemplo n.º 1
0
 /** Register a namespace prefix */
 private java.lang.String registerPrefix(
     javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace)
     throws javax.xml.stream.XMLStreamException {
   java.lang.String prefix = xmlWriter.getPrefix(namespace);
   if (prefix == null) {
     prefix = hr.ponge.pfa.axis.env.operations.UpdateUserResp.generatePrefix(namespace);
     javax.xml.namespace.NamespaceContext nsContext = xmlWriter.getNamespaceContext();
     while (true) {
       java.lang.String uri = nsContext.getNamespaceURI(prefix);
       if ((uri == null) || ((uri.length()) == 0)) {
         break;
       }
       prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix();
     }
     xmlWriter.writeNamespace(prefix, namespace);
     xmlWriter.setPrefix(prefix, namespace);
   }
   return prefix;
 }
Ejemplo n.º 2
0
 /** Utility method to write an element start tag. */
 private void writeStartElement(
     java.lang.String prefix,
     java.lang.String namespace,
     java.lang.String localPart,
     javax.xml.stream.XMLStreamWriter xmlWriter)
     throws javax.xml.stream.XMLStreamException {
   java.lang.String writerPrefix = xmlWriter.getPrefix(namespace);
   if (writerPrefix != null) {
     xmlWriter.writeStartElement(namespace, localPart);
   } else {
     if ((namespace.length()) == 0) {
       prefix = "";
     } else if (prefix == null) {
       prefix = hr.ponge.pfa.axis.env.operations.UpdateUserResp.generatePrefix(namespace);
     }
     xmlWriter.writeStartElement(prefix, localPart, namespace);
     xmlWriter.writeNamespace(prefix, namespace);
     xmlWriter.setPrefix(prefix, namespace);
   }
 }
Ejemplo n.º 3
0
 private void writeQNames(
     javax.xml.namespace.QName[] qnames, javax.xml.stream.XMLStreamWriter xmlWriter)
     throws javax.xml.stream.XMLStreamException {
   if (qnames != null) {
     java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer();
     java.lang.String namespaceURI = null;
     java.lang.String prefix = null;
     for (int i = 0; i < (qnames.length); i++) {
       if (i > 0) {
         stringToWrite.append(" ");
       }
       namespaceURI = qnames[i].getNamespaceURI();
       if (namespaceURI != null) {
         prefix = xmlWriter.getPrefix(namespaceURI);
         if ((prefix == null) || ((prefix.length()) == 0)) {
           prefix = hr.ponge.pfa.axis.env.operations.UpdateUserResp.generatePrefix(namespaceURI);
           xmlWriter.writeNamespace(prefix, namespaceURI);
           xmlWriter.setPrefix(prefix, namespaceURI);
         }
         if ((prefix.trim().length()) > 0) {
           stringToWrite
               .append(prefix)
               .append(":")
               .append(
                   org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i]));
         } else {
           stringToWrite.append(
               org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i]));
         }
       } else {
         stringToWrite.append(
             org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i]));
       }
     }
     xmlWriter.writeCharacters(stringToWrite.toString());
   }
 }
Ejemplo n.º 4
0
 /** method to handle Qnames */
 private void writeQName(
     javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter)
     throws javax.xml.stream.XMLStreamException {
   java.lang.String namespaceURI = qname.getNamespaceURI();
   if (namespaceURI != null) {
     java.lang.String prefix = xmlWriter.getPrefix(namespaceURI);
     if (prefix == null) {
       prefix = hr.ponge.pfa.axis.env.operations.UpdateUserResp.generatePrefix(namespaceURI);
       xmlWriter.writeNamespace(prefix, namespaceURI);
       xmlWriter.setPrefix(prefix, namespaceURI);
     }
     if ((prefix.trim().length()) > 0) {
       xmlWriter.writeCharacters(
           ((prefix + ":")
               + (org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname))));
     } else {
       xmlWriter.writeCharacters(
           org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname));
     }
   } else {
     xmlWriter.writeCharacters(
         org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname));
   }
 }
Ejemplo n.º 5
0
    /**
     * static method to create the object Precondition: If this object is an element, the current or
     * next start element starts this object and any intervening reader events are ignorable If this
     * object is not an element, it is a complex type and the reader is at the event just after the
     * outer start element Postcondition: If this object is an element, the reader is positioned at
     * its end element If this object is a complex type, the reader is positioned at the end element
     * of its outer element
     */
    public static hr.ponge.pfa.axis.env.operations.UpdateUserResp parse(
        javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception {
      hr.ponge.pfa.axis.env.operations.UpdateUserResp object =
          new hr.ponge.pfa.axis.env.operations.UpdateUserResp();
      int event;
      java.lang.String nillableValue = null;
      java.lang.String prefix = "";
      java.lang.String namespaceuri = "";
      try {
        while ((!(reader.isStartElement())) && (!(reader.isEndElement()))) reader.next();
        if ((reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"))
            != null) {
          java.lang.String fullTypeName =
              reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type");
          if (fullTypeName != null) {
            java.lang.String nsPrefix = null;
            if ((fullTypeName.indexOf(":")) > (-1)) {
              nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":"));
            }
            nsPrefix = nsPrefix == null ? "" : nsPrefix;
            java.lang.String type = fullTypeName.substring(((fullTypeName.indexOf(":")) + 1));
            if (!("UpdateUserResp".equals(type))) {
              java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix);
              return ((hr.ponge.pfa.axis.env.operations.UpdateUserResp)
                  (hr.ponge.pfa.axis.ExtensionMapper.getTypeObject(nsUri, type, reader)));
            }
          }
        }
        java.util.Vector handledAttributes = new java.util.Vector();
        reader.next();
        java.util.ArrayList list2 = new java.util.ArrayList();
        while ((!(reader.isStartElement())) && (!(reader.isEndElement()))) reader.next();
        if ((reader.isStartElement())
            && (new javax.xml.namespace.QName("http://ponge.hr/pfa/axis/env/operations", "user")
                .equals(reader.getName()))) {
          object.setUser(hr.ponge.pfa.axis.env.User.Factory.parse(reader));
          reader.next();
        } else {
        }
        while ((!(reader.isStartElement())) && (!(reader.isEndElement()))) reader.next();
        if ((reader.isStartElement())
            && (new javax.xml.namespace.QName("http://ponge.hr/pfa/axis/env/operations", "errors")
                .equals(reader.getName()))) {
          list2.add(hr.ponge.pfa.axis.base.ErrorType.Factory.parse(reader));
          boolean loopDone2 = false;
          while (!loopDone2) {
            while (!(reader.isEndElement())) reader.next();
            reader.next();
            while ((!(reader.isStartElement())) && (!(reader.isEndElement()))) reader.next();
            if (reader.isEndElement()) {
              loopDone2 = true;
            } else {
              if (new javax.xml.namespace.QName("http://ponge.hr/pfa/axis/env/operations", "errors")
                  .equals(reader.getName())) {
                list2.add(hr.ponge.pfa.axis.base.ErrorType.Factory.parse(reader));
              } else {
                loopDone2 = true;
              }
            }
          }
          object.setErrors(
              ((hr.ponge.pfa.axis.base.ErrorType[])
                  (org.apache.axis2.databinding.utils.ConverterUtil.convertToArray(
                      hr.ponge.pfa.axis.base.ErrorType.class, list2))));
        } else {
        }
        while ((!(reader.isStartElement())) && (!(reader.isEndElement()))) reader.next();
        if (reader.isStartElement())
          throw new org.apache.axis2.databinding.ADBException(
              ("Unexpected subelement " + (reader.getName())));

      } catch (javax.xml.stream.XMLStreamException e) {
        throw new java.lang.Exception(e);
      }
      return object;
    }