info.bioinfweb.jphyloio.formats.xtg

## Class XTGFactory

- java.lang.Object
- - info.bioinfweb.jphyloio.factory.AbstractSingleReaderWriterFactory
  - - info.bioinfweb.jphyloio.formats.xml.AbstractXMLFactory
    - - info.bioinfweb.jphyloio.formats.xtg.XTGFactory

- All Implemented Interfaces:
    SingleReaderWriterFactory, JPhyloIOFormatIDs, XTGConstants

      public class XTGFactory
      extends AbstractXMLFactory
      implements XTGConstants, JPhyloIOFormatIDs

  Reader and writer factory for the XTG format.
  Since:
    0.0.0
  Author:
    Ben Stöver, Sarah Wiechers

- - ### Field Summary

    - ### Fields inherited from interface info.bioinfweb.jphyloio.formats.xtg.XTGConstants

      `ALIGN_LEFT, ALIGN_RIGHT, ALIGN_TREE_WIDTH, ATTR_ADAPTER_ID, ATTR_ADAPTER_NAME, ATTR_ADAPTER_PURPOSE, ATTR_ALIGN_TO_SUBTREE, ATTR_ANCHOR_0, ATTR_ANCHOR_1, ATTR_BG_COLOR, ATTR_BOTTOM, ATTR_BRANCH_LENGTH, ATTR_BRANCH_LENGTH_SCALE, ATTR_CAPTION_LINK_TYPE, ATTR_CAPTION_TYPE, ATTR_CONSTANT_WIDTH, ATTR_DECIMAL_FORMAT, ATTR_EDGE_RADIUS, ATTR_FONT_FAMILY, ATTR_HEIGHT, ATTR_ICON, ATTR_ICON_FILLED, ATTR_ICON_HEIGHT, ATTR_ICON_WIDTH, ATTR_ID, ATTR_LABEL_ABOVE, ATTR_LABEL_HEIGHT, ATTR_LABEL_SPACING, ATTR_LABEL_WIDTH, ATTR_LEFT, ATTR_LEGEND_POS, ATTR_LEGEND_SPACING, ATTR_LEGEND_STYLE, ATTR_LINE_COLOR, ATTR_LINE_NO, ATTR_LINE_POS, ATTR_LINE_WIDTH, ATTR_LOCALE_COUNTRY, ATTR_LOCALE_LANG, ATTR_LOCALE_VARIANT, ATTR_MIN_BRANCH_LENGTH, ATTR_MIN_SPACE_ABOVE, ATTR_MIN_SPACE_BELOW, ATTR_MIN_TREE_DISTANCE, ATTR_PIE_CAPTION, ATTR_PIE_COLOR, ATTR_POSITION_LABELS_TO_LEFT, ATTR_RIGHT, ATTR_SCALE_BAR_ALIGN, ATTR_SCALE_BAR_DISTANCE, ATTR_SCALE_BAR_HEIGHT, ATTR_SCALE_BAR_INCREASE, ATTR_SCALE_BAR_LONG_INTERVAL, ATTR_SCALE_BAR_SMALL_INTERVAL, ATTR_SCALE_BAR_START, ATTR_SCALE_BAR_WIDTH, ATTR_SHOW_INTERNAL_LINES, ATTR_SHOW_NULL_LINES, ATTR_SHOW_ROOTED, ATTR_SHOW_SCALE_BAR, ATTR_SHOW_TITLE, ATTR_TEXT, ATTR_TEXT_COLOR, ATTR_TEXT_HEIGHT, ATTR_TEXT_IS_DECIMAL, ATTR_TEXT_ORIENTATION, ATTR_TEXT_STYLE, ATTR_TOP, ATTR_UNIQUE_NAME, ATTR_WIDTH, BRANCH_LENGTH_UNITS, DATA_TYPE_COLOR, DATA_TYPE_LEGEND_STYLE, DATA_TYPE_PIE_CHART_LABEL_CAPTION_LINK_TYPE, DATA_TYPE_PIE_CHART_LABEL_CAPTION_TYPE, DATA_TYPE_SCALE_BAR_ALIGNMENT, DATA_TYPE_SCALE_VALUE, DATA_TYPE_TEXT_ORIENTATION, DEPRECATED_VALUE_LEAVES_ADAPTER, FULL_SCHEMA_LOCATION, MILLIMETERS, NAMESPACE_URI, ORIENT_DOWN, ORIENT_HORIZONTAL, ORIENT_UP, PRE_LEGEND_ANCHOR, PREDICATE_BRANCH_CONSTANT_WIDTH, PREDICATE_BRANCH_MIN_LENGTH, PREDICATE_BRANCH_MIN_SPACE_ABOVE, PREDICATE_BRANCH_MIN_SPACE_BELOW, PREDICATE_COLUMN_ID, PREDICATE_DATA_ID, PREDICATE_DATA_ID_VALUE, PREDICATE_DATA_IDS, PREDICATE_DECIMAL_FORMAT, PREDICATE_DOCUMENT_MARGIN, PREDICATE_EDGE_RADIUS, PREDICATE_FONT_FAMILY, PREDICATE_GLOBAL_FORMATS, PREDICATE_GLOBAL_FORMATS_ALIGN_TO_SUBTREE, PREDICATE_GLOBAL_FORMATS_BG_COLOR, PREDICATE_GLOBAL_FORMATS_BRANCH_LENGTH_SCALE, PREDICATE_GLOBAL_FORMATS_POSITION_LABELS_TO_LEFT, PREDICATE_GLOBAL_FORMATS_SHOW_ROOTED, PREDICATE_GLOBAL_FORMATS_SHOW_SCALE_BAR, PREDICATE_HEIGHT, PREDICATE_ICON_LABEL, PREDICATE_ICON_LABEL_ICON, PREDICATE_ICON_LABEL_ICON_FILLED, PREDICATE_INVISIBLE_DATA, PREDICATE_IS_DECIMAL, PREDICATE_LABEL_ABOVE, PREDICATE_LABEL_LINE_NO, PREDICATE_LABEL_LINE_POS, PREDICATE_LABEL_MARGIN, PREDICATE_LEAF_MARGIN, PREDICATE_LEGEND, PREDICATE_LEGEND_ANCHOR_0, PREDICATE_LEGEND_ANCHOR_1, PREDICATE_LEGEND_MARGIN, PREDICATE_LEGEND_MIN_TREE_DISTANCE, PREDICATE_LEGEND_ORIENTATION, PREDICATE_LEGEND_POSITION, PREDICATE_LEGEND_SPACING, PREDICATE_LEGEND_STYLE, PREDICATE_LINE_COLOR, PREDICATE_LINE_WIDTH, PREDICATE_LOCALE_COUNTRY, PREDICATE_LOCALE_LANG, PREDICATE_LOCALE_VARIANT, PREDICATE_MARGIN_BOTTOM, PREDICATE_MARGIN_LEFT, PREDICATE_MARGIN_RIGHT, PREDICATE_MARGIN_TOP, PREDICATE_NODE_BRANCH_DATA_ADAPTERS, PREDICATE_NODE_BRANCH_DATA_ADAPTERS_ADAPTER, PREDICATE_NODE_BRANCH_DATA_ADAPTERS_ADAPTER_ID, PREDICATE_NODE_BRANCH_DATA_ADAPTERS_ADAPTER_NAME, PREDICATE_NODE_BRANCH_DATA_ADAPTERS_ADAPTER_PURPOSE, PREDICATE_NODE_UNIQUE_NAME, PREDICATE_PIE_CAPTION, PREDICATE_PIE_CHART_LABEL, PREDICATE_PIE_CHART_LABEL_CAPTION_LINK_TYPE, PREDICATE_PIE_CHART_LABEL_CAPTION_TYPE, PREDICATE_PIE_CHART_LABEL_INTERNAL_LINES, PREDICATE_PIE_CHART_LABEL_NULL_LINES, PREDICATE_PIE_CHART_LABEL_SHOW_TITLE, PREDICATE_PIE_COLOR, PREDICATE_SCALE_BAR, PREDICATE_SCALE_BAR_ALIGN, PREDICATE_SCALE_BAR_INCREASING, PREDICATE_SCALE_BAR_LONG_INTERVAL, PREDICATE_SCALE_BAR_SMALL_INTERVAL, PREDICATE_SCALE_BAR_START_LEFT, PREDICATE_SCALE_BAR_TREE_DISTANCE, PREDICATE_TEXT, PREDICATE_TEXT_COLOR, PREDICATE_TEXT_HEIGHT, PREDICATE_TEXT_LABEL, PREDICATE_TEXT_STYLE, PREDICATE_WIDTH, STYLE_BOLD, STYLE_BRACE, STYLE_BRACKET, STYLE_ITALIC, STYLE_UNDERLINE, TAG_ADAPTER, TAG_BRANCH, TAG_DOCUMENT_MARGIN, TAG_GLOBAL_FORMATS, TAG_HIDDEN_DATA, TAG_ICON_LABEL, TAG_LABEL_MARGIN, TAG_LEAF_MARGIN, TAG_LEGEND, TAG_LEGEND_MARGIN, TAG_NODE, TAG_NODE_BRANCH_DATA_ADAPTERS, TAG_PIE_CHART_ID, TAG_PIE_CHART_IDS, TAG_PIE_CHART_LABEL, TAG_ROOT, TAG_SCALE_BAR, TAG_TEXT_LABEL, TAG_TREE, VALUE_ADAPTER_PURPOSE_PREFIX, VALUE_LEAVES_ADAPTER, VALUE_SUPPORT_VALUES_ADAPTER, VERSION, XTG, XTG_DATA_TYPE_NAMESPACE, XTG_FORMAT_NAME, XTG_NAMESPACE_PREFIX, XTG_PREDICATE_NAMESPACE`

    - ### Fields inherited from interface info.bioinfweb.jphyloio.formats.JPhyloIOFormatIDs

      `FASTA_FORMAT_ID, FORMAT_ID_PREFIX, MEGA_FORMAT_ID, NEWICK_FORMAT_ID, NEXML_FORMAT_ID, NEXUS_FORMAT_ID, PDE_FORMAT_ID, PHYLIP_FORMAT_ID, PHYLOXML_FORMAT_ID, SEQUENTIAL_PHYLIP_FORMAT_ID, XTG_FORMAT_ID`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `XTGFactory()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected JPhyloIOFormatInfo` | `createFormatInfo()`
    `JPhyloIOEventReader` | `getReader(java.io.InputStream stream, ReadWriteParameterMap parameters)` Creates a new reader instance for the target format of this factory.
    `JPhyloIOEventReader` | `getReader(java.io.Reader reader, ReadWriteParameterMap parameters)` Creates a new reader instance for the target format of this factory.
    `JPhyloIOEventWriter` | `getWriter()` Creates a new writer instance for the target format of this factory.
    `boolean` | `hasReader()` Determines whether this factory is able to create reader instances for its target format.
    `boolean` | `hasWriter()` Determines whether this factory is able to create writer instances for its target format.

    - ### Methods inherited from class info.bioinfweb.jphyloio.formats.xml.AbstractXMLFactory

      `checkFormat, checkRootTag, getRootTag`

    - ### Methods inherited from class info.bioinfweb.jphyloio.factory.AbstractSingleReaderWriterFactory

      `checkFormat, getFormatInfo`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### XTGFactory

          public XTGFactory()

  - ### Method Detail

    - #### getReader

          public JPhyloIOEventReader getReader(java.io.InputStream stream,
                                               ReadWriteParameterMap parameters)
                                        throws java.io.IOException,
                                               javax.xml.stream.XMLStreamException

      Description copied from interface: `SingleReaderWriterFactory`
      Creates a new reader instance for the target format of this factory.
      Specified by:
        `getReader` in interface `SingleReaderWriterFactory`
      Parameters:
        `stream` - the stream to provide the content for the reader
        `parameters` - the parameter map for the new reader instance
      Returns:
        the new reader instance
      Throws:
        `java.io.IOException`
        `javax.xml.stream.XMLStreamException`

    - #### getReader

          public JPhyloIOEventReader getReader(java.io.Reader reader,
                                               ReadWriteParameterMap parameters)
                                        throws java.io.IOException,
                                               javax.xml.stream.XMLStreamException

      Description copied from interface: `SingleReaderWriterFactory`
      Creates a new reader instance for the target format of this factory.
      Specified by:
        `getReader` in interface `SingleReaderWriterFactory`
        `parameters` - the parameter map for the new reader instance
      Returns:
        the new reader instance or `null` if this factory is not able to create readers
      Throws:
        `java.io.IOException`
        `javax.xml.stream.XMLStreamException`
      See Also:
        `SingleReaderWriterFactory.hasReader()`

    - #### getWriter

          public JPhyloIOEventWriter getWriter()

      Description copied from interface: `SingleReaderWriterFactory`
      Creates a new writer instance for the target format of this factory.
      Specified by:
        `getWriter` in interface `SingleReaderWriterFactory`
      Returns:
        the new writer instance or `null` if this factory is not able to create writers
      See Also:
        `SingleReaderWriterFactory.hasWriter()`

    - #### hasReader

          public boolean hasReader()

      Description copied from interface: `SingleReaderWriterFactory`
      Determines whether this factory is able to create reader instances for its target format.
      Specified by:
        `hasReader` in interface `SingleReaderWriterFactory`
      Returns:
        `true` if creating readers is supported or `false` otherwise

    - #### hasWriter

          public boolean hasWriter()

      Description copied from interface: `SingleReaderWriterFactory`
      Determines whether this factory is able to create writer instances for its target format.
      Specified by:
        `hasWriter` in interface `SingleReaderWriterFactory`
      Returns:
        `true` if creating writers is supported or `false` otherwise

    - #### createFormatInfo

          protected JPhyloIOFormatInfo createFormatInfo()

      Specified by:
        `createFormatInfo` in class `AbstractSingleReaderWriterFactory`