textbender.d.gene.xhtml
Class RecombinantXHTML

java.lang.Object
  extended by RecombinantXHTML
All Implemented Interfaces:
MutantAbstractor

public class RecombinantXHTML
extends Object
implements MutantAbstractor

Recombinant XHTML definitions and utilities.


Nested Class Summary
static class RecombinantXHTML.DOMResourceResolver
          A resolver for Recombinant XHTML resources.
static class RecombinantXHTML.DOMResourceResolverMin
          A minimal resolver for Recombinant XHTML resources.
 
Field Summary
static String RECOMBINANT_XHTML_PUBLIC_ID
          Public identifier of Recombinant XHTML documents.
 
Method Summary
 Object abstract_transferMutant(Element embeddableAbstractSequence, StringBuilder b)
          Returns an abstract form of a gene's sequence, suitable for detecting mutations to record in ancestry.
static Element ensureMetaData(Document document, StringBuilder b)
          Returns a Recombinant XHTML document's meta-data (tail) element; if necessary creating it (complete with a 'gg' element).
static RecombinantXHTML i()
          The single instance of RecombinantXHTML.
static void write(Document document, TransformerFactory transformerFactory, Result result)
          Writes a Recombinant XHTML document.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RECOMBINANT_XHTML_PUBLIC_ID

public static final String RECOMBINANT_XHTML_PUBLIC_ID
Public identifier of Recombinant XHTML documents.

See Also:
Constant Field Values
Method Detail

i

public static RecombinantXHTML i()
The single instance of RecombinantXHTML.


ensureMetaData

public static Element ensureMetaData(Document document,
                                     StringBuilder b)
Returns a Recombinant XHTML document's meta-data (tail) element; if necessary creating it (complete with a 'gg' element).

Parameters:
b - string builder to use, overwriting its existing content
See Also:
DocumentRT.findMetaData(Node)

write

@ThreadSafe
public static void write(Document document,
                                    TransformerFactory transformerFactory,
                                    Result result)
                  throws TransformerException
Writes a Recombinant XHTML document. Convenience method that serializes the document, in standard fashion.

Parameters:
document - Recombinant XHTML document to write
transformerFactory - to use
result - output format; typically a 'new StreamResult(file|stream)'
Throws:
TransformerException - from newTransformer, transform

abstract_transferMutant

@ThreadSafe
public Object abstract_transferMutant(Element embeddableAbstractSequence,
                                                 StringBuilder b)
Returns an abstract form of a gene's sequence, suitable for detecting mutations to record in ancestry. Suitable for documents in which the significant, creative content of leaf sequences is human-readable text, as opposed to data-like elements and attributes. The latter are stripped away under the assumption of being style modifiers, of no creative significance.

This abstract form is subject to change. Output sequences are not guaranteed to be accurately comparable unless generated in the same release of textbender.

Specified by:
abstract_transferMutant in interface MutantAbstractor
Parameters:
embeddableAbstractSequence - embeddable-abstract form of the gene's sequence
b - string builder to use, overwriting its existing content
Returns:
abstract form of the sequence as a character sequence (String), if the gene is a leaf; or as a locus sequence (List<String&rt;), if the gene is a structural parent