public abstract class Filter extends Object
Modifier and Type | Class and Description |
---|---|
static class |
Filter.StreamFilterType
Filter type enumeration.
|
Modifier and Type | Field and Description |
---|---|
static String |
CLOSE_RESULT |
static String |
CLOSE_SOURCE |
static String |
DEFAULT_SERIALIZATION_ON |
static String |
ENTITIES_REWRITE |
static String |
MAINTAIN_ELEMENT_STACK |
static String |
READER_POOL_SIZE |
static String |
REVERSE_VISIT_ORDER_ON_VISIT_AFTER |
static String |
STREAM_FILTER_TYPE
Stream filter type config parameter.
|
static String |
TERMINATE_ON_VISITOR_EXCEPTION |
Constructor and Description |
---|
Filter() |
Modifier and Type | Method and Description |
---|---|
abstract void |
cleanup()
Cleanup the Filter.
|
protected void |
close(Result result) |
protected void |
close(Source source) |
abstract void |
doFilter()
|
static ExecutionContext |
getCurrentExecutionContext()
Get the
ExecutionContext instance bound to the current thread. |
static Filter |
getFilter()
Get the
Filter instance for the current thread. |
protected Reader |
getReader(Source source,
ExecutionContext executionContext) |
protected Writer |
getWriter(Result result,
ExecutionContext executionContext) |
static void |
removeCurrentExecutionContext()
Remove the
ExecutionContext bound to the current thread. |
static void |
removeCurrentFilter()
Remove the
Filter bound to the current thread. |
static void |
setCurrentExecutionContext(ExecutionContext executionContext)
Set the
ExecutionContext instance for the current thread. |
static void |
setFilter(Filter filter)
Set the
Filter instance for the current thread. |
static void |
setFilterType(Smooks smooks,
Filter.StreamFilterType filterType)
Deprecated.
|
static void |
setFilterType(Smooks smooks,
StreamFilterType filterType)
Set the default stream filter type on the supplied Smooks instance.
|
public static final String STREAM_FILTER_TYPE
public static final String CLOSE_SOURCE
public static final String CLOSE_RESULT
public static final String ENTITIES_REWRITE
public static final String DEFAULT_SERIALIZATION_ON
public static final String MAINTAIN_ELEMENT_STACK
public static final String REVERSE_VISIT_ORDER_ON_VISIT_AFTER
public static final String TERMINATE_ON_VISITOR_EXCEPTION
public static final String READER_POOL_SIZE
public abstract void doFilter() throws SmooksException
Source
instance, outputing the result
to the supplied Result
instance.
Implementations use static methods on the FilterSource
and FilterResult
classes
to access the Source
and Results
objects.SmooksException
- Failed to filter.public abstract void cleanup()
public static void setFilterType(Smooks smooks, StreamFilterType filterType)
smooks
- The Smooks instance.filterType
- The filter type.public static void setFilterType(Smooks smooks, Filter.StreamFilterType filterType)
setFilterType(org.milyn.Smooks, org.milyn.StreamFilterType)
.smooks
- The Smooks instance.filterType
- The filter type.public static Filter getFilter()
Filter
instance for the current thread.Filter
instance.public static void setFilter(Filter filter)
Filter
instance for the current thread.filter
- The thread-bound Filter
instance.public static void removeCurrentFilter()
Filter
bound to the current thread.public static ExecutionContext getCurrentExecutionContext()
ExecutionContext
instance bound to the current thread.ExecutionContext
instance.public static void setCurrentExecutionContext(ExecutionContext executionContext)
ExecutionContext
instance for the current thread.executionContext
- The thread-bound ExecutionContext
instance.public static void removeCurrentExecutionContext()
ExecutionContext
bound to the current thread.protected Reader getReader(Source source, ExecutionContext executionContext)
protected Writer getWriter(Result result, ExecutionContext executionContext)
protected void close(Source source)
protected void close(Result result)
Copyright © 2020. All rights reserved.