コード例 #1
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 ListMethods parse(javax.xml.stream.XMLStreamReader reader)
        throws java.lang.Exception {
      ListMethods object = new ListMethods();

      int event;
      java.lang.String nillableValue = null;
      java.lang.String prefix = "";
      java.lang.String namespaceuri = "";
      try {

        while (!reader.isStartElement() && !reader.isEndElement()) reader.next();

        nillableValue =
            reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil");
        if ("true".equals(nillableValue) || "1".equals(nillableValue)) {
          // Skip the element and report the null value.  It cannot have subelements.
          while (!reader.isEndElement()) reader.next();

          return object;
        }

        // Note all attributes that were handled. Used to differ normal attributes
        // from anyAttributes.
        java.util.Vector handledAttributes = new java.util.Vector();

        while (!reader.isEndElement()) {
          if (reader.isStartElement()) {

            if (reader.isStartElement()) {

              // use the QName from the parser as the name for the builder
              javax.xml.namespace.QName startQname1 = reader.getName();

              // We need to wrap the reader so that it produces a fake START_DOCUMENT event
              // this is needed by the builder classes
              org.apache.axis2.databinding.utils.NamedStaxOMBuilder builder1 =
                  new org.apache.axis2.databinding.utils.NamedStaxOMBuilder(
                      new org.apache.axis2.util.StreamWrapper(reader), startQname1);
              object.setListMethods(builder1.getOMElement());

            } // End of if for expected property start element
            else {
              // A start element we are not expecting indicates an invalid parameter was passed
              throw new org.apache.axis2.databinding.ADBException(
                  "Unexpected subelement " + reader.getName());
            }

          } else {
            reader.next();
          }
        } // end of while loop

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

      return object;
    }
コード例 #2
0
      public static ConsultaCadastro2Result parse(final javax.xml.stream.XMLStreamReader reader)
          throws java.lang.Exception {
        final ConsultaCadastro2Result object = new ConsultaCadastro2Result();

        try {

          while (!reader.isStartElement() && !reader.isEndElement()) {
            reader.next();
          }

          if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type")
              != null) {
            final java.lang.String fullTypeName =
                reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type");
            if (fullTypeName != null) {
              java.lang.String nsPrefix = null;
              if (fullTypeName.contains(":")) {
                nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":"));
              }
              nsPrefix = nsPrefix == null ? "" : nsPrefix;

              final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1);

              if (!"consultaCadastro2Result".equals(type)) {
                // find namespace for the prefix
                final java.lang.String nsUri =
                    reader.getNamespaceContext().getNamespaceURI(nsPrefix);
                return (ConsultaCadastro2Result) ExtensionMapper.getTypeObject(nsUri, type, reader);
              }
            }
          }

          reader.next();

          while (!reader.isStartElement() && !reader.isEndElement()) {
            reader.next();
          }

          if (reader.isStartElement()) {

            // use the QName from the parser as the name for the builder
            final javax.xml.namespace.QName startQname1 = reader.getName();

            // We need to wrap the reader so that it produces a fake START_DOCUMENT event
            // this is needed by the builder classes
            final org.apache.axis2.databinding.utils.NamedStaxOMBuilder builder1 =
                new org.apache.axis2.databinding.utils.NamedStaxOMBuilder(
                    new org.apache.axis2.util.StreamWrapper(reader), startQname1);
            object.setExtraElement(builder1.getOMElement());

            reader.next();

          } // End of if for expected property start element
          else {
            // A start element we are not expecting indicates an invalid parameter was passed
            throw new org.apache.axis2.databinding.ADBException(
                "Unexpected subelement " + reader.getName());
          }

          while (!reader.isStartElement() && !reader.isEndElement()) {
            reader.next();
          }

          if (reader.isStartElement()) {
            // A start element we are not expecting indicates a trailing invalid property
            throw new org.apache.axis2.databinding.ADBException(
                "Unexpected subelement " + reader.getName());
          }

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

        return object;
      }
コード例 #3
0
ファイル: Data_type0.java プロジェクト: nagyistge/TMP-Java
    /**
     * 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 Data_type0 parse(javax.xml.stream.XMLStreamReader reader)
        throws java.lang.Exception {
      Data_type0 object = new Data_type0();

      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 (!"data_type0".equals(type)) {
              // find namespace for the prefix
              java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix);
              return (Data_type0)
                  com.intalio.www.bpms.workflow.taskmanagementservices_20051109.ExtensionMapper
                      .getTypeObject(nsUri, type, reader);
            }
          }
        }

        // Note all attributes that were handled. Used to differ normal attributes
        // from anyAttributes.
        java.util.Vector handledAttributes = new java.util.Vector();

        reader.next();

        java.util.ArrayList list1 = new java.util.ArrayList();

        while (!reader.isStartElement() && !reader.isEndElement()) reader.next();

        if (reader.isStartElement()) {

          // Process the array and step past its final element's end.

          boolean loopDone1 = false;

          while (!loopDone1) {
            event = reader.getEventType();
            if (javax.xml.stream.XMLStreamConstants.START_ELEMENT == event) {

              // We need to wrap the reader so that it produces a fake START_DOCUEMENT event
              org.apache.axis2.databinding.utils.NamedStaxOMBuilder builder1 =
                  new org.apache.axis2.databinding.utils.NamedStaxOMBuilder(
                      new org.apache.axis2.util.StreamWrapper(reader), reader.getName());

              list1.add(builder1.getOMElement());
              reader.next();
              if (reader.isEndElement()) {
                // we have two countinuos end elements
                loopDone1 = true;
              }

            } else if (javax.xml.stream.XMLStreamConstants.END_ELEMENT == event) {
              loopDone1 = true;
            } else {
              reader.next();
            }
          }

          object.setExtraElement(
              (org.apache.axiom.om.OMElement[])
                  org.apache.axis2.databinding.utils.ConverterUtil.convertToArray(
                      org.apache.axiom.om.OMElement.class, list1));

        } // End of if for expected property start element
        else {

        }

        while (!reader.isStartElement() && !reader.isEndElement()) reader.next();

        if (reader.isStartElement())
          // A start element we are not expecting indicates a trailing invalid property
          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;
    }