Public Types | |
enum | ParserTypes { DOM, VTD } |
Static Public Member Functions | |
ACSLogParser | getParser () throws Exception |
ACSLogParser | getParser (ParserTypes parserType) throws Exception |
ParserTypes | getParserType (ACSLogParser parserToCheck) throws Exception |
ParserTypes | getParserType () throws Exception |
Package Types | |
Static Private Attributes | |
ACSLogParser | parser = null |
boolean | usingVTD = true |
The purpose of this object is to hide the type of parser really used at run time.
The object could instantiate a new parser or use only one instance, a singleton.
There are 2 parsers available: DOM and VTD. VTD is ACS/LGPL/Tools and installed by ACS. It is licensed under GPL and available at http://vtd-xml.sourceforge.net/ VTD claims to be very fast (and effectively it performs better then DOM) so the factory tries to instantiate a VTD parser if it is present.
Having this factory allows to transparently use a different implementation at run-time depending on the real availability of the parsers.
|
The supported parsers. This has been introduced to allow the usage of a specific parser especially useful for testing where we need to test parsing against each possible parser.
|
|
Get a parser of the given type. This method allows to get a parser of a specific type and is thought for testing purposes. If the type of the requested parser is not the type of the parser in use then a new parser is instantiated and returned but the parser in use remains untouched.
|
|
Get a parser.
The
|
|
Return the type of the parser in use.
|
|
Return the type of the passed parser.
|
|
The parser is a singleton built at the first invocation of
Calls to |
|
This property is used to check if VTD is installed to avoid trying to instantiate if the library is missing
It is initially set to |