Class SerializingDependencyNodeVisitor

  • All Implemented Interfaces:
    DependencyNodeVisitor

    public class SerializingDependencyNodeVisitor
    extends java.lang.Object
    implements DependencyNodeVisitor
    A dependency node visitor that serializes visited nodes to a writer.
    Since:
    1.1
    Version:
    $Id: SerializingDependencyNodeVisitor.java 1595642 2014-05-18 17:32:08Z jvanzyl $
    Author:
    Mark Hobson
    • Constructor Detail

      • SerializingDependencyNodeVisitor

        public SerializingDependencyNodeVisitor​(java.io.Writer writer)
        Creates a dependency node visitor that serializes visited nodes to the specified writer using whitespace tokens.
        Parameters:
        writer - the writer to serialize to
      • SerializingDependencyNodeVisitor

        public SerializingDependencyNodeVisitor​(java.io.Writer writer,
                                                SerializingDependencyNodeVisitor.TreeTokens tokens)
        Creates a dependency node visitor that serializes visited nodes to the specified writer using the specified tokens.
        Parameters:
        writer - the writer to serialize to
        tokens - the tokens to use when serializing the dependency tree
    • Method Detail

      • visit

        public boolean visit​(DependencyNode node)
        Starts the visit to the specified dependency node.
        Specified by:
        visit in interface DependencyNodeVisitor
        Parameters:
        node - the dependency node to visit
        Returns:
        true to visit the specified dependency node's children, false to skip the specified dependency node's children and proceed to its next sibling
      • endVisit

        public boolean endVisit​(DependencyNode node)
        Ends the visit to to the specified dependency node.
        Specified by:
        endVisit in interface DependencyNodeVisitor
        Parameters:
        node - the dependency node to visit
        Returns:
        true to visit the specified dependency node's next sibling, false to skip the specified dependency node's next siblings and proceed to its parent