コード例 #1
0
ファイル: XMLSkin.java プロジェクト: olamedia/jagatoo
  private void doParsing(XMLStreamReader parser) throws XMLStreamException {
    for (int i = 0; i < parser.getAttributeCount(); i++) {
      QName attr = parser.getAttributeName(i);
      if (attr.getLocalPart().equals("source")) {
        source = XMLIDREFUtils.parse(parser.getAttributeValue(i));
      } else {
        JAGTLog.exception(
            "Unsupported ", this.getClass().getSimpleName(), " Attr tag: ", attr.getLocalPart());
      }
    }

    for (int event = parser.next();
        event != XMLStreamConstants.END_DOCUMENT;
        event = parser.next()) {
      switch (event) {
        case XMLStreamConstants.START_ELEMENT:
          {
            String localName = parser.getLocalName();
            if (localName.equals("source")) {
              XMLSource src = new XMLSource();
              src.parse(parser);
              sources.add(src);
            } else if (localName.equals("bind_shape_matrix")) {
              if (bindShapeMatrix != null) {
                JAGTLog.exception(
                    this.getClass().getSimpleName(), " too many bind_shape_matrix tags.");
              }

              bindShapeMatrix = XMLMatrixUtils.readColumnMajor(StAXHelper.parseText(parser));
              // bindShapeMatrix = XMLMatrixUtils.readRowMajor( StAXHelper.parseText( parser ) );
            } else if (localName.equals("joints")) {
              jointsInputs = getJointInputs(parser);
            } else if (localName.equals("vertex_weights")) {
              vertexWeights = new XMLVertexWeights();
              vertexWeights.parse(parser);
            } else {
              JAGTLog.exception(
                  "Unsupported ",
                  this.getClass().getSimpleName(),
                  " Start tag: ",
                  parser.getLocalName());
            }
            break;
          }
        case XMLStreamConstants.END_ELEMENT:
          {
            if (parser.getLocalName().equals("skin")) {
              return;
            }
            break;
          }
      }
    }
  }
コード例 #2
0
ファイル: XMList.java プロジェクト: Orestad/OLRSS
  /*!*/
  @SuppressWarnings("unchecked")
  protected void showSource(
      XMLSource target, ContentHandler handler, Datatype template, AdapterView visual) {

    checkNull(target, handler, template, visual);

    synchronized (m_synchronizer) {
      clear(template);
      target.parse(handler);
      m_template = null;
    }

    visual.setAdapter(this);
  }