Пример #1
0
 /**
  * Processes elements and its sub-elements.
  *
  * @param reader XML stream reader
  * @throws XMLStreamException Thrown if problem occurred while reading XML stream.
  * @throws SQLException Thrown if problem occurred while communicating with database.
  */
 private static void processElement(final XMLStreamReader reader)
     throws XMLStreamException, SQLException {
   switch (reader.getNamespaceURI()) {
     case Namespaces.VYMENNY_FORMAT_TYPY:
       switch (reader.getLocalName()) {
         case "VymennyFormat":
           exchangeFormatConvertor.convert(reader);
           break;
         default:
           XMLUtils.processUnsupported(reader);
       }
       break;
     case Namespaces.SPECIALNI_VYMENNY_FORMAT_TYPY:
       switch (reader.getLocalName()) {
         case "SpecialniVymennyFormat":
           specialExchangeFormatConvertor.convert(reader);
           break;
         default:
           XMLUtils.processUnsupported(reader);
       }
       break;
     default:
       XMLUtils.processUnsupported(reader);
   }
 }
Пример #2
0
  @Override
  protected void processElement(final XMLStreamReader reader, final Pou item)
      throws XMLStreamException {
    switch (reader.getNamespaceURI()) {
      case NAMESPACE:
        switch (reader.getLocalName()) {
          case "Geometrie":
            Utils.processGeometrie(reader, getConnection(), item, NAMESPACE);
            break;
          case "GlobalniIdNavrhuZmeny":
            item.setNzIdGlobalni(Long.parseLong(reader.getElementText()));
            break;
          case "IdTransakce":
            item.setIdTransRuian(Long.parseLong(reader.getElementText()));
            break;
          case "Kod":
            item.setKod(Integer.parseInt(reader.getElementText()));
            break;
          case "Nazev":
            item.setNazev(reader.getElementText());
            break;
          case "Nespravny":
            item.setNespravny(Boolean.valueOf(reader.getElementText()));
            break;
          case "Orp":
            item.setOrpKod(Utils.getOrpKod(reader, NAMESPACE));
            break;
          case "PlatiOd":
            item.setPlatiOd(Utils.parseTimestamp(reader.getElementText()));
            break;
          case "SpravniObecKod":
            item.setSpravniObecKod(Integer.parseInt(reader.getElementText()));
            break;
          default:
            XMLUtils.processUnsupported(reader);
        }

        break;
      default:
        XMLUtils.processUnsupported(reader);
    }
  }