textbender.a.u.branch
Class Brancher

java.lang.Object
  extended by Brancher

public final class Brancher
extends Object

A revision brancher.


Constructor Summary
Brancher(Element gg, List<Element> gList, DOMImplementationLS domLS, MutantAbstractor mutantAbstractor, LSParser parser, StringBuilder stringBuilder, TransformerFactory transformerFactory, UUIDStringifier uuidStringifier)
          Creates a Brancher for a document.
 
Method Summary
 void branch()
          Assigns the document to a new revision line.
(package private) static Document branched(InputStream in, TransformerFactory transformerFactory, DOMErrorHandler errorHandler)
          Returns a Recombinant XHTML document read from an input stream, and then branched.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Brancher

Brancher(Element gg,
         List<Element> gList,
         DOMImplementationLS domLS,
         MutantAbstractor mutantAbstractor,
         LSParser parser,
         StringBuilder stringBuilder,
         TransformerFactory transformerFactory,
         UUIDStringifier uuidStringifier)
   throws TransformerConfigurationException
Creates a Brancher for a document.

Parameters:
gg - the 'g' list ('gg') element of the document
gList - live list of gene meta-data ('g') elements in 'gg' (e.g. backed by a NodeList)
domLS - DOM implementation to use
mutantAbstractor - to use
parser - to use
stringBuilder - string builder to use, overwriting its existing content
transformerFactory - to use
uuidStringifier - UUID stringifier to use
Throws:
TransformerConfigurationException
Method Detail

branch

public void branch()
            throws TransformerException
Assigns the document to a new revision line.
  1. If the document already has a revision line, then branch processing is done, in order to update the ancestry records.
  2. The document receives a new, unique revision line ID.
  3. Its 'gR' gene reindex counter is effectively reset to zero.

Throws:
TransformerException

branched

static Document branched(InputStream in,
                         TransformerFactory transformerFactory,
                         DOMErrorHandler errorHandler)
                  throws LSException,
                         TextbenderException,
                         TransformerException
Returns a Recombinant XHTML document read from an input stream, and then branched. Convenience method.

Parameters:
in - stream to read document from
transformerFactory - to use
errorHandler - to use
Returns:
document, suitable for passing to RecombinantXHTML.write
Throws:
LSException - from parse, also reported to the provided errorHandler
TextbenderException - if document not in recombinant form
TransformerException - from branch, newTransformer