|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object olg.csv.bean.loader.parser.AbstractParserLoader
public abstract class AbstractParserLoader
Class dedicated to load a parser from an XML element conformed to XML schema ParserType specification. Each concret class shall have the responsibility to load a concrete AbstractLoader class.
Class based on Chain of responsability pattern used to chain concret Filter Loaders.
AbstractParser
Field Summary | |
---|---|
private static AbstractParserLoader |
instance
Singleton responsible of parsers loading. |
protected AbstractParserLoader |
successor
ParserLoader successor as describe in Chain of responsability pattern. |
protected String |
xPathExpression
This Xpath expression allows to identify xml node which describe the corresponding concret parser under parser Type node. |
Constructor Summary | |
---|---|
protected |
AbstractParserLoader(String xPathExpression,
AbstractParserLoader successor)
|
Method Summary | ||
---|---|---|
protected abstract
|
getConcreteParser(Class<T> clazz,
Element node)
Returns a concret parser this concret loader has the responsablity to create. |
|
static AbstractParserLoader |
getInstance()
Returns Singleton responsible of parsers loading. |
|
|
getParser(Class<T> clazz,
Element element)
Returns a concret parser identified from the given XML Element. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static AbstractParserLoader instance
protected String xPathExpression
protected AbstractParserLoader successor
Constructor Detail |
---|
protected AbstractParserLoader(String xPathExpression, AbstractParserLoader successor)
xPathExpression
- the XPath expression that allows to identify the concret
parser under the XML FilterType nodesuccessor
- following concret loader in the chain of responsabilityMethod Detail |
---|
public static AbstractParserLoader getInstance()
public final <T> AbstractParser<T> getParser(Class<T> clazz, Element element) throws XPathExpressionException, LoadException
T
- the type the parser treats.clazz
- the class that the parser should returnelement
- XML node corresponding to correspondant to XML ParserType as
described in our XML schema
null
if the given element
doesn't match concret parser this loader has responsability and
doesn't match any successor
XPathExpressionException
- on invalid XPathExpression
LoadException
- on Error occurs during loadingprotected abstract <T> AbstractParser<T> getConcreteParser(Class<T> clazz, Element node) throws XPathExpressionException, LoadException
T
- the type the parser treats.clazz
- the class that the parser should returnnode
- XML Element corresponding to the XPath expression from which
load corresponding parser
null
if the given node doesn't
match the type this loader should return
XPathExpressionException
- on invalid XPathExpression
LoadException
- if Error occurs during loadingxPathExpression
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |