org.base.apps.xml
Class AbstractParser<R>

java.lang.Object
  extended by org.base.apps.xml.AbstractParser<R>
All Implemented Interfaces:
Parser<R>
Direct Known Subclasses:
AbstractStAXParser

public abstract class AbstractParser<R>
extends Object
implements Parser<R>

Base implementation of Parser, intended to be extensible.

Author:
Kevan Simpson

Constructor Summary
protected AbstractParser()
           
 
Method Summary
protected  RuntimeException error(Exception ex, String msg, Object... tkns)
          Logs and wraps the given RuntimeException.
protected  R getOutput()
           
protected  OutputStack getOutputStack()
           
 Result getResult()
           
protected  org.apache.commons.logging.Log log()
          Fetches the Log for this parser.
abstract  R parse(Source src)
           
protected  void setOutput(R output)
           
protected  void setOutputStack(OutputStack outputStack)
           
protected  void setResult(Result result)
           
protected  void trace(Object... snips)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractParser

protected AbstractParser()
Method Detail

parse

public abstract R parse(Source src)
                 throws Exception
Specified by:
parse in interface Parser<R>
Throws:
Exception
See Also:
Parser.parse(javax.xml.transform.Source)

getResult

public Result getResult()
Specified by:
getResult in interface Parser<R>
See Also:
Parser.getResult()

getOutput

protected R getOutput()
Returns:
the mOutput

setOutput

protected void setOutput(R output)
Parameters:
output - the output to set

getOutputStack

protected OutputStack getOutputStack()
Returns:
the mOutputStack

setOutputStack

protected void setOutputStack(OutputStack outputStack)
Parameters:
outputStack - the outputStack to set

setResult

protected void setResult(Result result)
Parameters:
result - the result to set

error

protected RuntimeException error(Exception ex,
                                 String msg,
                                 Object... tkns)
Logs and wraps the given RuntimeException.

Parameters:
ex - The cause, which may be null
msg - A formattable message
tkns - Optional message tokens
Returns:
A new RuntimeException with the formatted message

log

protected org.apache.commons.logging.Log log()
Fetches the Log for this parser.


trace

protected void trace(Object... snips)

Please visit Base Apps, hosted on Sourceforge.net.

Copyright 2011, Blue Agate Software Entity (BASE)