예제 #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;
  }
예제 #2
0
 public void endElement(String uri, String localName, String qName) throws SAXException {
   currentNode.setData(JOINER.join(currentNode.getData(), "]"));
   currentNode = (SwingTreeNodeImpl) currentNode.getParent();
 }
예제 #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()));
 }