olg.csv.bean.loader.getter
Class AbstractGetterLoader

Package class diagram package AbstractGetterLoader
java.lang.Object
  extended by olg.csv.bean.loader.getter.AbstractGetterLoader
Direct Known Subclasses:
ConcateGetterLoader, ConstantGetterLoader, CustomGetterLoader, DefaultGetterLoader

public abstract class AbstractGetterLoader
extends Object

Class dedicated to load a getter AbstractGetter from an XML element conformed to XML schema GetterType specification. Each concret class shall have the responsibility to load a concrete AbstractGetter class.

Class based on Chain of responsability pattern and used to chain concret Getter Loaders.

See Also:
AbstractGetter

Field Summary
private static AbstractGetterLoader instance
          Singleton responsible of getters loading.
protected  AbstractGetterLoader successor
          GetterLoader successor as describe in Chain of responsability pattern.
protected  String xPathExpression
          This Xpath expression allows to identify xml node which describe the corresponding concret filter under Fitler Type node.
 
Constructor Summary
protected AbstractGetterLoader(String xPathExpression, AbstractGetterLoader successor)
           
 
Method Summary
protected abstract  AbstractGetter getConcreteGetter(Element node, String defaultValue)
          Returns a concret getter.
 AbstractGetter getGetter(Element element)
          Returns a concret getter identified from the given XML element.
static AbstractGetterLoader getInstance()
          Returns singleton responsible of getters loading This is this instance you have to be used to load every type of getter from XML element conformed to XML Schema GetterType specification.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

instance

private static AbstractGetterLoader instance
Singleton responsible of getters loading.


successor

protected AbstractGetterLoader successor
GetterLoader successor as describe in Chain of responsability pattern.


xPathExpression

protected String xPathExpression
This Xpath expression allows to identify xml node which describe the corresponding concret filter under Fitler Type node.

Constructor Detail

AbstractGetterLoader

protected AbstractGetterLoader(String xPathExpression,
                               AbstractGetterLoader successor)
Parameters:
xPathExpression - XPath expression that allows to identify the concret getter under the XML GetterType node
successor - following concret loader in the chain of responsability
Method Detail

getInstance

public static AbstractGetterLoader getInstance()
Returns singleton responsible of getters loading This is this instance you have to be used to load every type of getter from XML element conformed to XML Schema GetterType specification.

Returns:
the getters loader.

getGetter

public final AbstractGetter getGetter(Element element)
                               throws XPathExpressionException,
                                      LoadException
Returns a concret getter identified from the given XML element.

Parameters:
element - XML node corresponding to correspondant to XML GetterType as described in our XML schema.
Returns:
a concret getter or null if the given element doesn't match concret getter type this loader has responsability and doesn't match any successor
Throws:
XPathExpressionException - on invalid XPathExpression
LoadException - on Error occurs during loading

getConcreteGetter

protected abstract AbstractGetter getConcreteGetter(Element node,
                                                    String defaultValue)
                                             throws XPathExpressionException,
                                                    LoadException
Returns a concret getter.

Parameters:
node - XML Element corresponding to the XPath expression from which the corresponding getter is loaded.
defaultValue - value the loaded getter must used as default value.
Returns:
a concret getter this loader has responsability or null if the given node doesn't match the type this loader should return.
Throws:
XPathExpressionException - on invalid XPathExpression
LoadException - on Error occurs during loading
See Also:
xPathExpression


Copyright © 2014. All Rights Reserved.