olg.csv.bean.loader.filter
Class AbstractFiltreLoader

Package class diagram package AbstractFiltreLoader
java.lang.Object
  extended by olg.csv.bean.loader.filter.AbstractFiltreLoader
Direct Known Subclasses:
CustomFilterLoader, DecorateFilterLoader, LowerFilterLoader, ReplaceFilterLoader, SplitFilterLoader, TrimFilterLoader, UpperFilterLoader, UpperFirstFilterLoader

public abstract class AbstractFiltreLoader
extends Object

Class dedicated to load a filter AbstractStringFilter from an XML element conformed to XML schema FilterType specification. Each concret class shall have the responsibility to load a concrete AbstractStringFilter class.

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

See Also:
AbstractStringFilter

Field Summary
private static AbstractFiltreLoader instance
          Singleton responsible of filters loading.
protected  AbstractFiltreLoader successor
          FiltreLoader 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 AbstractFiltreLoader(String xPathExpression, AbstractFiltreLoader successor)
           
 
Method Summary
protected abstract  AbstractStringFilter getConcreteFilter(Element node)
          Returns a concret filter.
 AbstractStringFilter getFilter(Element element)
          Returns a concret filter identified from the given XML element.
static AbstractFiltreLoader getInstance()
          Returns singleton responsible of filters loading.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

instance

private static AbstractFiltreLoader instance
Singleton responsible of filters loading.


successor

protected AbstractFiltreLoader successor
FiltreLoader 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

AbstractFiltreLoader

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

getInstance

public static AbstractFiltreLoader getInstance()
Returns singleton responsible of filters loading. This is this instance you have to be used to load every type of filter from XML element conformed to XML Schema FitlerType specification.

Returns:
the abstract filter loader.

getFilter

public final AbstractStringFilter getFilter(Element element)
                                     throws XPathExpressionException,
                                            LoadException
Returns a concret filter identified from the given XML element.

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

getConcreteFilter

protected abstract AbstractStringFilter getConcreteFilter(Element node)
                                                   throws XPathExpressionException,
                                                          LoadException
Returns a concret filter.

Parameters:
node - XML Element corresponding to the XPath expression from which the concret filter will be loaded
Returns:
a concret filter 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.