Interface OutputBuilder<X,​Y>

  • All Superinterfaces:
    Queryable
    All Known Implementing Classes:
    BeanBuilder, JDOMBuilder

    public interface OutputBuilder<X,​Y>
    extends Queryable
    Interface representing a type that builds the "output" data read in from a Reader. Implementations of this interface are assumed to be dealing with some sort of hierarchical data and will write to the location they are currently set at. The location is set with the goRoot(), goUp(), and createAndGoInto(String) methods.

    Initialize must be called before using an OutputBuilder.

    Author:
    Jerry Vos
    See Also:
    Reader
    • Method Detail

      • initialize

        void initialize()
        Initializes the writer for writing.
      • createAndGoInto

        X createAndGoInto​(String name)
        Enters into the sub-tree with the specified name, creating the tree (or any values in it) if needed.
        Parameters:
        name - the name of the tree
        Returns:
        a detachable object
        See Also:
        detach(Iterable)
      • goUp

        void goUp()
        Goes up a level in the hierarchy.
      • goRoot

        void goRoot()
        Goes to the root in the hierarchy.
      • writeValue

        X writeValue​(String name,
                     Object value)
        Writes the specifed value using the specified name. What this means is implementation dependent.
        Parameters:
        name - the name to write the value under
        value - the value to write
        Returns:
        a detachable object
      • getWrittenObject

        Y getWrittenObject()
        Retrieves the object (or tree) that has been built with this outputter. This corresponds to the root of the tree, not the current branch.
        Returns:
        the object that is a result of the previous writes
      • detach

        void detach()
        Detaches the current tree and goes up a level.