Example #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;
    }
Example #2
0
  @SuppressWarnings("unused")
  private String registerPrefix(final XMLStreamWriter xmlWriter, final String namespace)
      throws XMLStreamException {
    String prefix = xmlWriter.getPrefix(namespace);
    if (prefix == null) {
      prefix = GetStatus.generatePrefix(namespace);
      while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) {
        prefix = BeanUtil.getUniquePrefix();
      }
      xmlWriter.writeNamespace(prefix, namespace);
      xmlWriter.setPrefix(prefix, namespace);
    }

    return prefix;
  }