Пример #1
0
    public static GetStatus parse(final XMLStreamReader reader) throws Exception {
      final GetStatus object = new GetStatus();

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

        while (!reader.isEndElement()) {
          if (reader.isStartElement()) {
            if (reader.isStartElement()
                && new QName("http://remotelabs.eng.uts.edu.au/rigclient/protocol", "getStatus")
                    .equals(reader.getName())) {
              object.setGetStatus(NullType.Factory.parse(reader));
            } else {
              throw new ADBException("Unexpected subelement " + reader.getLocalName());
            }
          } else {
            reader.next();
          }
        }
      } catch (final XMLStreamException e) {
        throw new Exception(e);
      }

      return object;
    }
Пример #2
0
    public static RigStateType parse(final XMLStreamReader reader) throws Exception {
      RigStateType object = null;
      new HashMap<Object, Object>();

      String prefix = "";
      String namespaceuri = "";
      try {
        while (!reader.isStartElement() && !reader.isEndElement()) {
          reader.next();
        }

        while (!reader.isEndElement()) {
          if (reader.isStartElement() || reader.hasText()) {
            final String content = reader.getElementText();
            if (content.indexOf(":") > 0) {
              prefix = content.substring(0, content.indexOf(":"));
              namespaceuri = reader.getNamespaceURI(prefix);
              object = RigStateType.Factory.fromString(content, namespaceuri);
            } else {
              object = RigStateType.Factory.fromString(content, "");
            }
          } else {
            reader.next();
          }
        }
      } catch (final XMLStreamException e) {
        throw new Exception(e);
      }

      return object;
    }
    public static PerformPrimitiveControl parse(final XMLStreamReader reader) throws Exception {
      final PerformPrimitiveControl object = new PerformPrimitiveControl();
      try {
        while (!reader.isStartElement() && !reader.isEndElement()) {
          reader.next();
        }

        while (!reader.isEndElement()) {
          if (reader.isStartElement()) {
            if (reader.isStartElement()
                && new QName(
                        "http://remotelabs.eng.uts.edu.au/rigclient/protocol",
                        "performPrimitiveControl")
                    .equals(reader.getName())) {
              object.setPerformPrimitiveControl(PrimitiveControlRequestType.Factory.parse(reader));
            } else {
              throw new ADBException("Unexpected subelement " + reader.getLocalName());
            }
          } else {
            reader.next();
          }
        }
      } catch (final XMLStreamException e) {
        throw new Exception(e);
      }
      return object;
    }
Пример #4
0
  /**
   * Parse the
   *
   * <p>elements
   *
   * @return a list of tokens from the dictionary's entry
   * @throws javax.xml.stream.XMLStreamException
   */
  EntryToken procTransduction() throws XMLStreamException {
    ArrayList<Integer> lhs = new ArrayList<Integer>();
    ArrayList<Integer> rhs = new ArrayList<Integer>();
    skipUntil("", COMPILER_LEFT_ELEM);
    reader.next();
    String name = "";
    while (true) {
      if (reader.isEndElement() && reader.getLocalName().equals(COMPILER_LEFT_ELEM)) {
        break;
      }
      if (reader.isStartElement()) {
        name = reader.getLocalName();
        readString(lhs, name);
        reader.next();
      } else if (reader.isCharacters()) {
        readString(lhs, "");
        reader.next();
      } else if (reader.isEndElement()) {
        reader.next();
      } else {
        throw new RuntimeException(
            "Error ("
                + reader.getLocation().getLineNumber()
                + ","
                + reader.getLocation().getColumnNumber()
                + "): unexpected type of event.");
      }
    }
    skipUntil(name, COMPILER_RIGHT_ELEM);
    reader.next();
    while (true) {
      if (reader.isEndElement() && reader.getLocalName().equals(COMPILER_RIGHT_ELEM)) {
        break;
      }
      if (reader.isStartElement()) {
        name = reader.getLocalName();
        readString(rhs, name);
        reader.next();
      } else if (reader.isCharacters()) {
        readString(rhs, "");
        reader.next();
      } else if (reader.isEndElement()) {
        reader.next();
      } else {
        throw new RuntimeException(
            "Error ("
                + reader.getLocation().getLineNumber()
                + ","
                + reader.getLocation().getColumnNumber()
                + "): unexpected type of event.");
      }
    }

    skipUntil(name, COMPILER_PAIR_ELEM);
    EntryToken e = new EntryToken();
    e.setSingleTransduction(lhs, rhs);
    return e;
  }
Пример #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 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;
    }
Пример #6
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 LifecycleManager parse(javax.xml.stream.XMLStreamReader reader)
        throws java.lang.Exception {
      LifecycleManager object = null;

      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 (!"LifecycleManager".equals(type)) {
              // find namespace for the prefix
              java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix);
              return (LifecycleManager)
                  org.apache.axis2.transaction.xsd.ExtensionMapper.getTypeObject(
                      nsUri, type, reader);
            }

            throw new org.apache.axis2.databinding.ADBException(
                "The an abstract class can not be instantiated !!!");
          }
        }

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

        reader.next();

        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;
    }
Пример #7
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 DebugLevel parse(javax.xml.stream.XMLStreamReader reader)
        throws java.lang.Exception {
      DebugLevel object = null;
      // initialize a hash map to keep values
      java.util.Map attributeMap = new java.util.HashMap();
      java.util.List extraAttributeList =
          new java.util.ArrayList<org.apache.axiom.om.OMAttribute>();

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

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

        // 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() || reader.hasText()) {

            nillableValue =
                reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil");
            if ("true".equals(nillableValue) || "1".equals(nillableValue)) {
              throw new org.apache.axis2.databinding.ADBException(
                  "The element: " + "DebugLevel" + "  cannot be null");
            }

            java.lang.String content = reader.getElementText();

            if (content.indexOf(":") > 0) {
              // this seems to be a Qname so find the namespace and send
              prefix = content.substring(0, content.indexOf(":"));
              namespaceuri = reader.getNamespaceURI(prefix);
              object = DebugLevel.Factory.fromString(content, namespaceuri);
            } else {
              // this seems to be not a qname send and empty namespace incase of it is
              // check is done in fromString method
              object = DebugLevel.Factory.fromString(content, "");
            }

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

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

      return object;
    }
Пример #8
0
  /**
   * Parse the <f> elements
   *
   * @return a list of tokens from the dictionary's entry
   */
  EntryToken procFlag() throws XMLStreamException {
    ArrayList<Integer> both_sides = new ArrayList<Integer>();
    // String n = attrib(COMPILER_N_ATTR);
    // String v = attrib(COMPILER_VALUE_ATTR);
    String name = "";
    reader.next();
    while (true) {
      if (reader.isEndElement() && reader.getLocalName().equals(COMPILER_FLAG_ELEM)) {
        break;
      }
      if (reader.isStartElement()) {
        name = reader.getLocalName();
        readString(both_sides, name);
        reader.next();
      } else if (reader.isCharacters()) {
        readString(both_sides, "");
        reader.next();
      } else if (reader.isEndElement()) {
        reader.next();
      } else {
        throw new RuntimeException(
            "Error ("
                + reader.getLocation().getLineNumber()
                + ","
                + reader.getLocation().getColumnNumber()
                + "): unexpected type of event.");
      }
    }

    /*
     * while (true) {
     * reader.next();
     * int type = reader.getEventType();
     * if (type == XMLStreamConstants.END_ELEMENT || type == XMLStreamConstants.START_ELEMENT) {
     * name = reader.getLocalName();
     *
     * System.err.println("name = " + name);
     * }
     * if (name.equals(COMPILER_FLAG_ELEM)) {
     * break;
     * }
     * readString(both_sides, name);
     * }
     */
    EntryToken e = new EntryToken();

    if (direction.equals(COMPILER_RESTRICTION_LR_VAL)) {
      e.setSingleTransduction(new ArrayList<Integer>(), both_sides);
    } else {
      e.setSingleTransduction(both_sides, new ArrayList<Integer>());
    }
    return e;
  }
Пример #9
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 ClassificationReason_type0 parse(javax.xml.stream.XMLStreamReader reader)
        throws java.lang.Exception {
      ClassificationReason_type0 object = new ClassificationReason_type0();

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

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

        // 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() || reader.hasText()) {

            if (reader.isStartElement() || reader.hasText()) {

              nillableValue =
                  reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil");
              if ("true".equals(nillableValue) || "1".equals(nillableValue)) {
                throw new org.apache.axis2.databinding.ADBException(
                    "The element: " + "classificationReason_type0" + "  cannot be null");
              }

              java.lang.String content = reader.getElementText();

              object.setClassificationReason_type0(
                  org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content));

            } // 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;
    }
Пример #10
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.core.operations.CreateDocumentReq parse(
        javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception {
      hr.ponge.pfa.axis.core.operations.CreateDocumentReq object =
          new hr.ponge.pfa.axis.core.operations.CreateDocumentReq();
      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 (!("CreateDocumentReq".equals(type))) {
              java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix);
              return ((hr.ponge.pfa.axis.core.operations.CreateDocumentReq)
                  (hr.ponge.pfa.axis.ExtensionMapper.getTypeObject(nsUri, type, reader)));
            }
          }
        }
        java.util.Vector handledAttributes = new java.util.Vector();
        reader.next();
        while ((!(reader.isStartElement())) && (!(reader.isEndElement()))) reader.next();
        if ((reader.isStartElement())
            && (new javax.xml.namespace.QName(
                    "http://ponge.hr/pfa/axis/core/operations", "document")
                .equals(reader.getName()))) {
          object.setDocument(hr.ponge.pfa.axis.core.Document.Factory.parse(reader));
          reader.next();
        } else {
          throw new org.apache.axis2.databinding.ADBException(
              ("Unexpected subelement " + (reader.getName())));
        }
        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;
    }
    /**
     * 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 EnumMWSAttributeFormCategories_type0 parse(
        javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception {
      EnumMWSAttributeFormCategories_type0 object = null;
      // initialize a hash map to keep values
      java.util.Map attributeMap = new java.util.HashMap();
      java.util.List extraAttributeList = new java.util.ArrayList();

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

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

        // 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() || reader.hasText()) {

            java.lang.String content = reader.getElementText();

            if (content.indexOf(":") > 0) {
              // this seems to be a Qname so find the namespace
              // and send
              prefix = content.substring(0, content.indexOf(":"));
              namespaceuri = reader.getNamespaceURI(prefix);
              object =
                  EnumMWSAttributeFormCategories_type0.Factory.fromString(content, namespaceuri);
            } else {
              // this seems to be not a qname send and empty
              // namespace incase of it is
              // check is done in fromString method
              object = EnumMWSAttributeFormCategories_type0.Factory.fromString(content, "");
            }

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

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

      return object;
    }
Пример #12
0
  public void parse(XMLStreamReader xtr, BpmnModel model) throws Exception {

    String id = xtr.getAttributeValue(null, ATTRIBUTE_DI_BPMNELEMENT);
    while (xtr.hasNext()) {
      xtr.next();
      if (xtr.isStartElement() && ELEMENT_DI_BOUNDS.equalsIgnoreCase(xtr.getLocalName())) {
        GraphicInfo graphicInfo = new GraphicInfo();
        graphicInfo.x = Double.valueOf(xtr.getAttributeValue(null, ATTRIBUTE_DI_X)).intValue();
        graphicInfo.y = Double.valueOf(xtr.getAttributeValue(null, ATTRIBUTE_DI_Y)).intValue();
        FlowElement flowElement = model.getMainProcess().getFlowElement(id);
        if (flowElement instanceof Event) {
          graphicInfo.width = 30;
          graphicInfo.height = 30;
        } else {
          graphicInfo.width =
              Double.valueOf(xtr.getAttributeValue(null, ATTRIBUTE_DI_WIDTH)).intValue();
          graphicInfo.height =
              Double.valueOf(xtr.getAttributeValue(null, ATTRIBUTE_DI_HEIGHT)).intValue();
        }

        model.addGraphicInfo(id, graphicInfo);
        break;
      } else if (xtr.isEndElement() && ELEMENT_DI_SHAPE.equalsIgnoreCase(xtr.getLocalName())) {
        break;
      }
    }
  }
Пример #13
0
  protected void parseChildElements(
      String elementName, BaseElement parentElement, XMLStreamReader xtr) {
    Map<String, BaseChildElementParser> childParsers =
        new HashMap<String, BaseChildElementParser>();
    childParsers.putAll(genericChildParserMap);
    if (childElementParsers != null) {
      childParsers.putAll(childElementParsers);
    }

    boolean readyWithChildElements = false;
    try {
      while (readyWithChildElements == false && xtr.hasNext()) {
        xtr.next();
        if (xtr.isStartElement()) {
          if (childParsers.containsKey(xtr.getLocalName())) {
            childParsers.get(xtr.getLocalName()).parseChildElement(xtr, parentElement);
          }

        } else if (xtr.isEndElement() && elementName.equalsIgnoreCase(xtr.getLocalName())) {
          readyWithChildElements = true;
        }
      }
    } catch (Exception e) {
      LOGGER.log(Level.WARNING, "Error parsing child elements for " + elementName, e);
    }
  }
Пример #14
0
  public void parse(XMLStreamReader xtr, BpmnModel model) throws Exception {

    String id = xtr.getAttributeValue(null, ATTRIBUTE_DI_BPMNELEMENT);
    GraphicInfo graphicInfo = new GraphicInfo();
    BpmnXMLUtil.addXMLLocation(graphicInfo, xtr);
    while (xtr.hasNext()) {
      xtr.next();
      if (xtr.isStartElement() && ELEMENT_DI_BOUNDS.equalsIgnoreCase(xtr.getLocalName())) {
        graphicInfo.setX(Double.valueOf(xtr.getAttributeValue(null, ATTRIBUTE_DI_X)).intValue());
        graphicInfo.setY(Double.valueOf(xtr.getAttributeValue(null, ATTRIBUTE_DI_Y)).intValue());
        graphicInfo.setWidth(
            Double.valueOf(xtr.getAttributeValue(null, ATTRIBUTE_DI_WIDTH)).intValue());
        graphicInfo.setHeight(
            Double.valueOf(xtr.getAttributeValue(null, ATTRIBUTE_DI_HEIGHT)).intValue());

        String strIsExpanded = xtr.getAttributeValue(null, ATTRIBUTE_DI_IS_EXPANDED);
        if ("true".equalsIgnoreCase(strIsExpanded)) {
          graphicInfo.setExpanded(true);
        }

        model.addGraphicInfo(id, graphicInfo);
        break;
      } else if (xtr.isEndElement() && ELEMENT_DI_SHAPE.equalsIgnoreCase(xtr.getLocalName())) {
        break;
      }
    }
  }
Пример #15
0
  Pair<Stroke, Continuation<Stroke>> parseStroke(XMLStreamReader in) throws XMLStreamException {
    in.require(START_ELEMENT, null, "Stroke");

    Stroke base = new Stroke();
    Continuation<Stroke> contn = null;

    while (!(in.isEndElement() && in.getLocalName().equals("Stroke"))) {
      in.nextTag();

      if (in.getLocalName().endsWith("Parameter")) {
        contn = parseParameter(contn, in, base);
      } else if (in.getLocalName().equals("GraphicFill")) {
        contn = parseGraphicFill(contn, in, base);
      } else if (in.getLocalName().equals("GraphicStroke")) {
        contn = parseGraphicStroke(contn, in, base);
      } else if (in.isStartElement()) {
        LOG.error("Found unknown element '{}', skipping.", in.getLocalName());
        skipElement(in);
      }
    }

    in.require(END_ELEMENT, null, "Stroke");

    return new Pair<Stroke, Continuation<Stroke>>(base, contn);
  }
Пример #16
0
  @SuppressWarnings("unchecked")
  protected ExtensionElement parseExtensionElement(XMLStreamReader xtr) throws Exception {
    ExtensionElement extensionElement = new ExtensionElement();
    extensionElement.setName(xtr.getLocalName());
    if (StringUtils.isNotEmpty(xtr.getNamespaceURI())) {
      extensionElement.setNamespace(xtr.getNamespaceURI());
    }
    if (StringUtils.isNotEmpty(xtr.getPrefix())) {
      extensionElement.setNamespacePrefix(xtr.getPrefix());
    }

    BpmnXMLUtil.addCustomAttributes(xtr, extensionElement, defaultElementAttributes);

    boolean readyWithExtensionElement = false;
    while (readyWithExtensionElement == false && xtr.hasNext()) {
      xtr.next();
      if (xtr.isCharacters()) {
        if (StringUtils.isNotEmpty(xtr.getText().trim())) {
          extensionElement.setElementText(xtr.getText().trim());
        }
      } else if (xtr.isStartElement()) {
        ExtensionElement childExtensionElement = parseExtensionElement(xtr);
        extensionElement.addChildElement(childExtensionElement);
      } else if (xtr.isEndElement()
          && extensionElement.getName().equalsIgnoreCase(xtr.getLocalName())) {
        readyWithExtensionElement = true;
      }
    }
    return extensionElement;
  }
    /**
     * 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 UploadDataResponseType parse(javax.xml.stream.XMLStreamReader reader)
        throws java.lang.Exception {
      UploadDataResponseType object = new UploadDataResponseType();

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

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

        // 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()
                && new javax.xml.namespace.QName(
                        "http://mcs.ucsc.com/SensorService/", "UploadDataResponseType")
                    .equals(reader.getName())) {

              java.lang.String content = reader.getElementText();

              object.setUploadDataResponseType(
                  org.apache.axis2.databinding.utils.ConverterUtil.convertToBoolean(content));

            } // 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.getLocalName());
            }

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

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

      return object;
    }
    /**
     * 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 SyncMSISDNChangeResponseE parse(javax.xml.stream.XMLStreamReader reader)
        throws java.lang.Exception {
      SyncMSISDNChangeResponseE object = new SyncMSISDNChangeResponseE();

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

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

        // 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()
                && new javax.xml.namespace.QName(
                        "http://www.csapi.org/schema/parlayx/data/sync/v1_0/local",
                        "syncMSISDNChangeResponse")
                    .equals(reader.getName())) {

              object.setSyncMSISDNChangeResponse(
                  org.csapi.www.schema.parlayx.data.sync.v1_0.local.SyncMSISDNChangeResponse.Factory
                      .parse(reader));

            } // 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.getLocalName());
            }

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

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

      return object;
    }
Пример #19
0
 /**
  * Parse the <i> elements
  *
  * @return a list of tokens from the dictionary's entry
  * @throws javax.xml.stream.XMLStreamException
  */
 EntryToken procIdentity() throws XMLStreamException {
   ArrayList<Integer> both_sides = new ArrayList<Integer>();
   if (!(reader.isStartElement() && reader.isEndElement())) {
     // not an emoty node
   }
   String name = "";
   reader.next();
   while (true) {
     if (reader.isEndElement() && reader.getLocalName().equals(COMPILER_IDENTITY_ELEM)) {
       break;
     }
     if (reader.isStartElement()) {
       name = reader.getLocalName();
       readString(both_sides, name);
       reader.next();
     } else if (reader.isCharacters()) {
       readString(both_sides, "");
       reader.next();
     } else if (reader.isEndElement()) {
       reader.next();
     } else {
       throw new RuntimeException(
           "Error ("
               + reader.getLocation().getLineNumber()
               + ","
               + reader.getLocation().getColumnNumber()
               + "): unexpected type of event.");
     }
   }
   /*
    * while (true) {
    * reader.next();
    * int type = reader.getEventType();
    * if (type == XMLStreamConstants.END_ELEMENT || type == XMLStreamConstants.START_ELEMENT) {
    * name = reader.getLocalName();
    * }
    * if (name.equals(COMPILER_IDENTITY_ELEM)) {
    * break;
    * }
    * readString(both_sides, name);
    * }
    */
   EntryToken e = new EntryToken();
   e.setSingleTransduction(both_sides, both_sides);
   return e;
 }
    /**
     * 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 RevokeSecurityGroupIngressResponse parse(javax.xml.stream.XMLStreamReader reader)
        throws java.lang.Exception {
      RevokeSecurityGroupIngressResponse object = new RevokeSecurityGroupIngressResponse();

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

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

        // 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()
                && new javax.xml.namespace.QName(
                        "http://ec2.amazonaws.com/doc/2010-11-15/",
                        "RevokeSecurityGroupIngressResponse")
                    .equals(reader.getName())) {

              object.setRevokeSecurityGroupIngressResponse(
                  com.amazon.ec2.RevokeSecurityGroupIngressResponseType.Factory.parse(reader));

            } // 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.getLocalName());
            }

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

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

      return object;
    }
  public void parse() {
    String bundlePath = null;
    if (bundle.getBundleFile() != null)
      bundlePath = FilenameNormalization.normalize(bundle.getBundleFile().getAbsolutePath());

    try {
      while (reader.hasNext()) {
        final int next = reader.next();
        if (next != XMLStreamConstants.START_ELEMENT) continue;

        final String tagName = reader.getName().getLocalPart();
        if (tagName.equals(TAG_LIBRARY)) {
          if (reader.isStartElement()) {
            library = new BundleLibrary(reader.getAttributeValue(null, "name"));
            bundle.addLibrary(library);
          } else if (reader.isEndElement()) {

            library = null;
          }
        } else if (library != null) {
          final String containerType = tagName;
          final String categoryType = reader.getAttributeValue(null, "type");
          BundleContainer container =
              (BundleContainer) library.getContainer(IBundleContainer.Type.toType(containerType));

          if (container == null) {
            container =
                (BundleContainer) library.addContainer(IBundleContainer.Type.toType(containerType));
          }

          IBundleCategory category =
              container.addCategory(IBundleCategory.Type.toType(categoryType));

          category.addFile(bundlePath, reader.getAttributeValue(null, "path"));
        } else if (tagName.equals("versions")) {
          version = (BundleVersion) bundle.getVersion();
        } else if (tagName.equals("bundle")) {
          version.setBundleVersion(reader.getAttributeValue(null, "version"));
        } else if (tagName.equals("randori")) {
          version.setRandoriVersion(reader.getAttributeValue(null, "version"));
          version.setRandoriBuild(reader.getAttributeValue(null, "build"));
          version.setRandoriMinSupportedVersion(
              reader.getAttributeValue(null, "minimumSupportedVersion"));
        } else if (tagName.equals("compiler")) {
          version.setCompilerName(reader.getAttributeValue(null, "name"));
          version.setCompilerVersion(reader.getAttributeValue(null, "version"));
        } else if (tagName.equals("version")) {

        }
      }
    } catch (XMLStreamException e) {
      File bundleFile = bundle.getBundleFile();
      final String file =
          (bundleFile != null) ? FilenameNormalization.normalize(bundleFile.getAbsolutePath()) : "";
      bundle.addProblem(
          new FileInLibraryIOProblem(BundleReader.MANIFEST_XML, file, e.getLocalizedMessage()));
    }
  }
Пример #22
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 GMonthDay parse(javax.xml.stream.XMLStreamReader reader)
        throws java.lang.Exception {
      GMonthDay object = new GMonthDay();

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

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

        // 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()
                && new javax.xml.namespace.QName(
                        "http://schemas.xmlsoap.org/soap/encoding/", "gMonthDay")
                    .equals(reader.getName())) {

              object.setGMonthDay(
                  org.apache.axis2.databinding.types.soapencoding.GMonthDay.Factory.parse(reader));

            } // 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;
    }
Пример #23
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 GetGroupE parse(javax.xml.stream.XMLStreamReader reader)
        throws java.lang.Exception {
      GetGroupE object = new GetGroupE();

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

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

        // 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()
                && new javax.xml.namespace.QName(
                        "https://org.comverse.rtbd.sec/webservice/auth", "getGroup")
                    .equals(reader.getName())) {

              object.setGetGroup(
                  sec.rtbd.comverse.org.webservice.auth.GetGroup.Factory.parse(reader));

            } // 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;
    }
Пример #24
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 FaultInstanceOut parse(javax.xml.stream.XMLStreamReader reader)
        throws java.lang.Exception {
      FaultInstanceOut object = new FaultInstanceOut();

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

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

        // 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()
                && new javax.xml.namespace.QName(
                        "http://wso2.org/bps/management/schema", "faultInstanceOut")
                    .equals(reader.getName())) {

              object.setFaultInstanceOut(
                  org.wso2.bps.management.schema.InstanceInfoType.Factory.parse(reader));

            } // 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.getLocalName());
            }

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

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

      return object;
    }
Пример #25
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 RequestSOAPHeaderE parse(javax.xml.stream.XMLStreamReader reader)
        throws java.lang.Exception {
      RequestSOAPHeaderE object = new RequestSOAPHeaderE();

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

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

        // 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()
                && new javax.xml.namespace.QName(
                        "http://www.huawei.com.cn/schema/common/v2_1", "RequestSOAPHeader")
                    .equals(reader.getName())) {

              object.setRequestSOAPHeader(
                  vms.cn.com.huawei.www.schema.common.v2_1.RequestSOAPHeader.Factory.parse(reader));

            } // 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.getLocalName());
            }

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

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

      return object;
    }
Пример #26
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 ReferenceParameters parse(javax.xml.stream.XMLStreamReader reader)
        throws java.lang.Exception {
      ReferenceParameters object = new ReferenceParameters();

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

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

        // 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()
                && new javax.xml.namespace.QName(
                        "http://www.w3.org/2005/08/addressing", "ReferenceParameters")
                    .equals(reader.getName())) {

              object.setReferenceParameters(
                  org.w3.www._2005._08.addressing.ReferenceParametersType.Factory.parse(reader));

            } // 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.getLocalName());
            }

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

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

      return object;
    }
    /**
     * 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 NamedIDHierarchyE parse(javax.xml.stream.XMLStreamReader reader)
        throws java.lang.Exception {
      NamedIDHierarchyE object = new NamedIDHierarchyE();

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

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

        // 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()
                && new javax.xml.namespace.QName(
                        "urn:base.ws.rightnow.com/v1_2", "NamedIDHierarchy")
                    .equals(reader.getName())) {

              object.setNamedIDHierarchy(
                  com.rightnow.ws.base.NamedIDHierarchy.Factory.parse(reader));

            } // 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.getLocalName());
            }

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

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

      return object;
    }
Пример #28
0
      public static NfeCabecMsgE parse(final javax.xml.stream.XMLStreamReader reader)
          throws java.lang.Exception {
        final NfeCabecMsgE object = new NfeCabecMsgE();

        try {

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

          // Note all attributes that were handled. Used to differ normal attributes
          // from anyAttributes.

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

              if (reader.isStartElement()
                  && new javax.xml.namespace.QName(
                          "http://www.portalfiscal.inf.br/nfe/wsdl/CadConsultaCadastro2",
                          "nfeCabecMsg")
                      .equals(reader.getName())) {

                object.setNfeCabecMsg(NfeCabecMsg.Factory.parse(reader));

              } // 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 (final javax.xml.stream.XMLStreamException e) {
          throw new java.lang.Exception(e);
        }

        return object;
      }
Пример #29
0
 /**
  * Skips to the next element if the reader points the required element. Post: reader will be at
  * {@link XMLStreamConstants#START_ELEMENT} of the next element.
  *
  * @param reader
  * @param elementName
  * @throws XMLStreamException
  */
 public static void skipRequiredElement(XMLStreamReader reader, QName elementName)
     throws XMLStreamException {
   if (reader.isStartElement() && reader.getName().equals(elementName)) {
     nextElement(reader);
     if (reader.isEndElement() && reader.getName().equals(elementName)) {
       nextElement(reader);
     }
     return;
   }
   throw new XMLParsingException(
       reader, "Required element " + elementName + " was not found at given stream position.");
 }
Пример #30
0
 /**
  * Move the reader to the next {@link XMLStreamConstants #START_ELEMENT} or {@link
  * XMLStreamConstants #END_ELEMENT} event.
  *
  * @param xmlReader
  * @return event type
  * @throws XMLStreamException
  * @throws NoSuchElementException if the end of the document is reached
  */
 public static int nextElement(XMLStreamReader xmlReader)
     throws XMLStreamException, NoSuchElementException {
   xmlReader.next();
   while (xmlReader.getEventType() != END_DOCUMENT
       && !xmlReader.isStartElement()
       && !xmlReader.isEndElement()) {
     xmlReader.next();
   }
   if (xmlReader.getEventType() == END_DOCUMENT) {
     throw new NoSuchElementException();
   }
   return xmlReader.getEventType();
 }