org.teleal.lemma.reader
Class AbstractReader

java.lang.Object
  extended by org.teleal.lemma.reader.AbstractReader
All Implemented Interfaces:
Reader
Direct Known Subclasses:
AbstractJavadocReader, PlaintextReader, XMLReader

public abstract class AbstractReader
extends Object
implements Reader

Provides shared operations for reading and wrapping citation content.

Author:
Christian Bauer

Constructor Summary
protected AbstractReader()
           
 
Method Summary
protected  void addFilePath(org.teleal.common.xhtml.XHTMLElement parent, CitationAnchor citation, File file)
          Appends a new child element containing the file path of the citation.
protected  void appendTitle(org.teleal.common.xhtml.XHTMLElement parent, String titleString)
          Appends a new child element to the given element, wrapping the title string.
 org.teleal.common.xhtml.XHTMLParser getParser()
           
 XPath getXPath()
           
protected  File resolveFile(String path, File[] sourceDirectories)
          Resolves a file with the given path.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.teleal.lemma.reader.Reader
read
 

Constructor Detail

AbstractReader

protected AbstractReader()
Method Detail

getParser

public org.teleal.common.xhtml.XHTMLParser getParser()

getXPath

public XPath getXPath()

resolveFile

protected File resolveFile(String path,
                           File[] sourceDirectories)
Resolves a file with the given path.

First, the given path is resolved against the given source directories. If no file can be found in any source directory matching the path, a classpath lookup is attempted.

Parameters:
path - The path of the file to be resolved.
sourceDirectories - The source directories of any file.
Returns:
The found file.

appendTitle

protected void appendTitle(org.teleal.common.xhtml.XHTMLElement parent,
                           String titleString)
Appends a new child element to the given element, wrapping the title string.

Parameters:
parent - The parent element to which the title child element is appended.
titleString - The title string, any XHTML elements within will be parsed.

addFilePath

protected void addFilePath(org.teleal.common.xhtml.XHTMLElement parent,
                           CitationAnchor citation,
                           File file)
Appends a new child element containing the file path of the citation.

Parameters:
parent - The parent element to which the file path child element is appended.
citation - The anchor is checked for the option if a file path should be added.
file - The actual file path.


Copyright © 2011 Teleal GmbH, Switzerland. All Rights Reserved.