public final void endNode() {
   endNodeInternally();
   final Object node = nodeStack.pop();
   if (nodeStack.size() == 0) {
     result.add(node);
   }
 }
Beispiel #2
0
  public void startNode(String name) {
    startPointer = writer.getPointer();
    quickNodeValue = false;
    lastTagHadAttributes = false;
    tagIsEmpty = false;
    finishTag();
    if (depth != 0) writer.write(LF);
    writer.write(
        WikiTableDriver.DELIM
            + WikiTableDriver.QUOTES
            + WikiTableDriver.START_NODE
            + WikiTableDriver.QUOTES
            + WikiTableDriver.DELIM);

    if (this.useLineSeparateBetweenTags) {
      writer.write(LF + WikiTableDriver.DELIM);
    }

    writer.write(name + WikiTableDriver.DELIM);
    elementStack.push(name);
    tagInProgress = true;
    depth++;
    readyForNewLine = true;
    tagIsEmpty = true;
  }
 /**
  * Constructs an AbstractDocumentWriter.
  *
  * @param container the top level container for the nodes to create (may be <code>null</code>)
  * @param replacer the object that creates XML-friendly names
  * @since 1.2.1
  */
 public AbstractDocumentWriter(final Object container, final XmlFriendlyReplacer replacer) {
   super(replacer);
   if (container != null) {
     nodeStack.push(container);
     result.add(container);
   }
 }
Beispiel #4
0
 /** Marks end of node */
 public void endNode() {
   depth--;
   if (tagIsEmpty) {
     String prevTag = (String) elementStack.pop(); // Silently();
     if (!quickNodeValue) {
       writer.write(
           LF
               + WikiTableDriver.DELIM
               + WikiTableDriver.QUOTES
               + WikiTableDriver.END_NODE
               + WikiTableDriver.QUOTES
               + WikiTableDriver.DELIM);
       if (this.useLineSeparateBetweenTags) {
         writer.write(LF + WikiTableDriver.DELIM);
       }
       writer.write(prevTag + WikiTableDriver.DELIM);
     }
     readyForNewLine = false;
   } else {
     String prevTag = (String) elementStack.pop();
     if (!quickNodeValue) {
       writer.write(
           LF
               + WikiTableDriver.DELIM
               + WikiTableDriver.QUOTES
               + WikiTableDriver.END_NODE
               + WikiTableDriver.QUOTES
               + WikiTableDriver.DELIM);
       if (this.useLineSeparateBetweenTags) {
         writer.write(LF + WikiTableDriver.DELIM);
       }
       writer.write(prevTag + WikiTableDriver.DELIM);
     }
   }
   finishTag();
   readyForNewLine = true;
   if (depth == 0) {
     writer.flush();
   }
   quickNodeValue = false;
 }
 /** @since 1.2.1 */
 protected final Object getCurrent() {
   return nodeStack.peek();
 }
 public final void startNode(final String name) {
   final Object node = createNode(name);
   nodeStack.push(node);
 }