|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.xfp.AttributeContainer org.xfp.Filter
Base class for all filters. Subclasses must provide a public method named 'execute' accepting 0 or 1 arguments of any type (but primitives) and returning any type (but primitives) or void. Example:
public List execute(String input)
Filters are parameterized by using JavaBeans setter methods.
Any Exception occurred during filter execution should not be trapped, the container takes care of handling exceptions.
Subclasses do not need to call super() constructor, since it is empty.
Filter
instances are reused by the container, so make sure to
correctly reset the Filter status in the reset method. Filters are never
used concurrently by multiple threads, a Filter implementation does not have
to be thread-safe.
TODO manage primitives in execute method. TODO discuss superclasses in signatures
Nested Class Summary | |
static class |
Filter.OnErrorEnum
OnError typesafe enumeration. |
static class |
Filter.OnLoopErrorEnum
OnLoopError typesafe enumeration. |
Field Summary |
Fields inherited from class org.xfp.AttributeContainer |
name, parentContainer |
Constructor Summary | |
Filter()
|
Method Summary | |
protected Filter.OnErrorEnum |
getOnError()
Gets the onError attribute of the Filter object. |
void |
initialize()
Initializes the filter. |
protected void |
log(java.lang.String message)
Subclasses can use this method to log for debugging purposes. |
protected static Filter |
newInstance(org.w3c.dom.Node filternode,
org.w3c.dom.xpath.XPathEvaluator evaluator,
java.lang.Class inputtype,
AttributeContainer parent,
org.apache.log4j.spi.LoggerRepository loggerRepository)
Instantiates and initializes a Filter. |
void |
perform(org.xfp.FilterContext context,
java.lang.Object parentoutput)
Performing a filter consists of: provide filter attributes set filter properties invoke the 'execute' method call the 'release' method perform children filters release filter attributes Filter developers never call this method! |
abstract void |
reset()
Resets filter status after execution. |
java.lang.String |
toString()
|
Methods inherited from class org.xfp.AttributeContainer |
configureAttributes, disposeAttributes, getAttributes, getFullName, getName, initializeAttributes |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public Filter()
Method Detail |
public void initialize() throws java.lang.Exception
java.lang.Exception
- Description of the ExceptionInitializable.initialize()
public abstract void reset()
public final java.lang.String toString()
Object.toString()
public final void perform(org.xfp.FilterContext context, java.lang.Object parentoutput) throws java.lang.Exception
parentoutput
- output of the parent filtercontext
- Description of the Parameter
java.lang.Exception
- Description of the Exceptionprotected final Filter.OnErrorEnum getOnError()
protected final void log(java.lang.String message)
message
- Description of the Parameterprotected static final Filter newInstance(org.w3c.dom.Node filternode, org.w3c.dom.xpath.XPathEvaluator evaluator, java.lang.Class inputtype, AttributeContainer parent, org.apache.log4j.spi.LoggerRepository loggerRepository) throws java.lang.Exception
filternode
- Node representing a filter in XML configurationevaluator
- XPath Evaluatorinputtype
- the input data type this filter will process (i.e. the parent
filter output data type)
java.lang.Exception
- Description of the Exception
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |