Exemplo n.º 1
0
  public void startElement(String uri, String localName, String qName, Attributes atts)
      throws SAXException {
    SwingTreeNodeImpl<String> newNode = new SwingTreeNodeImpl<String>();

    if (currentNode == null) {
      rootNodes.add(newNode);
    } else {
      currentNode.addChild(newNode);
    }

    newNode.setData(JOINER.join(newNode.getData(), localName.toLowerCase(Locale.US), " ["));

    currentNode = newNode;
  }
Exemplo n.º 2
0
 public void endElement(String uri, String localName, String qName) throws SAXException {
   currentNode.setData(JOINER.join(currentNode.getData(), "]"));
   currentNode = (SwingTreeNodeImpl) currentNode.getParent();
 }
Exemplo n.º 3
0
 public void characters(char[] ch, int start, int length) throws SAXException {
   currentNode.setData(JOINER.join(currentNode.getData(), new String(ch, start, length).trim()));
 }