Home / Development / Documentation / 2.0.44 / AbstractDocumentReader
TreeGraph 2
 


info.bioinfweb.treegraph.document.io
Class AbstractDocumentReader

java.lang.Object
  extended by info.bioinfweb.treegraph.document.io.AbstractDocumentReader
All Implemented Interfaces:
DocumentReader
Direct Known Subclasses:
PhyloXMLReader, TextStreamReader, TGFReader, XTGReader

public abstract class AbstractDocumentReader
extends Object
implements DocumentReader

Implements basic functionality (especially method delegation) for document readers.

Author:
Ben Stöver

Field Summary
protected  Document document
           
protected  LoadLogger loadLogger
           
 
Constructor Summary
AbstractDocumentReader()
           
 
Method Summary
protected  void reachElementEnd(XMLEventReader reader, StartElement element)
          Delegates to reachElementEnd(XMLEventReader, String) where the name of the specified element is passed as elementDescription.
protected  void reachElementEnd(XMLEventReader reader, String elementDescription)
          Delegates to XMLUtils.reachElementEnd(XMLEventReader) and adds a warning to the LoadLogger.
 Document read(File file, LoadLogger loadLogger)
           
 Document read(File file, LoadLogger loadLogger, NodeBranchDataAdapter internalAdapter, NodeBranchDataAdapter branchLengthsAdapter)
           
 Document read(File file, LoadLogger loadLogger, NodeBranchDataAdapter internalAdapter, NodeBranchDataAdapter branchLengthsAdapter, TreeSelector selector, boolean translateInternalNodes)
          If you want to implement file specific functionalities you should override this method.
 Document read(InputStream stream, LoadLogger loadLogger)
           
 Document read(InputStream stream, LoadLogger loadLogger, NodeBranchDataAdapter internalAdapter, NodeBranchDataAdapter branchLengthsAdapter)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface info.bioinfweb.treegraph.document.io.DocumentReader
read
 

Field Detail

loadLogger

protected LoadLogger loadLogger

document

protected Document document
Constructor Detail

AbstractDocumentReader

public AbstractDocumentReader()
Method Detail

reachElementEnd

protected void reachElementEnd(XMLEventReader reader,
                               StartElement element)
                        throws XMLStreamException
Delegates to reachElementEnd(XMLEventReader, String) where the name of the specified element is passed as elementDescription.

Parameters:
reader -
element -
Throws:
XMLStreamException
Since:
2.0.42

reachElementEnd

protected void reachElementEnd(XMLEventReader reader,
                               String elementDescription)
                        throws XMLStreamException
Delegates to XMLUtils.reachElementEnd(XMLEventReader) and adds a warning to the LoadLogger.

Parameters:
reader -
elementDescription - a description of the possibly skipped elements (e.g. "Elements under <ScaleBar>)
Throws:
XMLStreamException
Since:
2.0.42

read

public Document read(File file,
                     LoadLogger loadLogger)
              throws Exception
Specified by:
read in interface DocumentReader
Throws:
Exception

read

public Document read(File file,
                     LoadLogger loadLogger,
                     NodeBranchDataAdapter internalAdapter,
                     NodeBranchDataAdapter branchLengthsAdapter)
              throws Exception
Specified by:
read in interface DocumentReader
Throws:
Exception

read

public Document read(File file,
                     LoadLogger loadLogger,
                     NodeBranchDataAdapter internalAdapter,
                     NodeBranchDataAdapter branchLengthsAdapter,
                     TreeSelector selector,
                     boolean translateInternalNodes)
              throws Exception
If you want to implement file specific functionalities you should override this method. It is called by all other read-methods with a file as parameter.

Specified by:
read in interface DocumentReader
Throws:
Exception
See Also:
info.bioinfweb.treegraph.document.io.DocumentReader#read(java.io.File, NodeBranchDataAdapter, int)

read

public Document read(InputStream stream,
                     LoadLogger loadLogger,
                     NodeBranchDataAdapter internalAdapter,
                     NodeBranchDataAdapter branchLengthsAdapter)
              throws Exception
Specified by:
read in interface DocumentReader
Throws:
Exception

read

public Document read(InputStream stream,
                     LoadLogger loadLogger)
              throws Exception
Specified by:
read in interface DocumentReader
Throws:
Exception