org.finra.jtaf.core.parsing
Class BaseParser

java.lang.Object
  extended by org.finra.jtaf.core.parsing.BaseParser
Direct Known Subclasses:
TestStrategyParser

public abstract class BaseParser
extends Object

I plan to scrap these parsers within a few releases to allow for a more flexible model. In particular, I want the plugins to be able to extend the behavior of the parser. For example, if we create a StarTeam plugin, then we will want to pull CR information from the tests and commands.


Constructor Summary
BaseParser()
           
 
Method Summary
protected  List<Element> getChildElements(Element elem)
          TODO: There is probably a more effective way to do this, but this does the trick for now
protected  Document getCurrentDocument()
           
 MessageCollector getErrorCollector()
          It is the caller's responsibility to print the log, if desired
protected abstract  void handleRoot(Element root)
          Do whatever to the document root
 void parse(File f)
           
protected  void reportUnexpectedElement(Element elem)
          Generic method for printing unexpected element errors
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BaseParser

public BaseParser()
           throws ParserConfigurationException
Throws:
ParserConfigurationException
Method Detail

parse

public final void parse(File f)
                 throws ParsingException,
                        SAXException,
                        IOException
Throws:
ParsingException
SAXException
IOException

handleRoot

protected abstract void handleRoot(Element root)
                            throws ParsingException
Do whatever to the document root

Parameters:
root -
Throws:
ParsingException

getCurrentDocument

protected final Document getCurrentDocument()

getErrorCollector

public final MessageCollector getErrorCollector()
It is the caller's responsibility to print the log, if desired

Returns:
The ErrorCollector used by this parser

getChildElements

protected final List<Element> getChildElements(Element elem)
TODO: There is probably a more effective way to do this, but this does the trick for now

Parameters:
elem -
Returns:

reportUnexpectedElement

protected final void reportUnexpectedElement(Element elem)
Generic method for printing unexpected element errors

Parameters:
elem -


Copyright © 2014. All rights reserved.