public class XmlFilterFactory extends Object implements FilterFactory<Filter<Element,ByteBuffer>,Element,ByteBuffer,ConnectionHandler<?>>, Filter<Element,ByteBuffer>
FilterFactory
for reading and writing XML DOM Element
s.Modifier and Type | Field and Description |
---|---|
protected static ThreadLocal<DocumentBuilder> |
builderLocal
A
DocumentBuilder local to the current thread. |
protected static XmlFilterFactory |
instance
The global instance.
|
protected static ThreadLocal<Transformer> |
transformerLocal
A
Transformer local to the current thread. |
Constructor and Description |
---|
XmlFilterFactory()
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
applyInbound(Queue<ByteBuffer> inputs,
Queue<Element> outputs)
Filters traffic in the inbound direction.
|
void |
applyOutbound(Queue<Element> inputs,
Queue<ByteBuffer> outputs)
Filters traffic in the outbound direction.
|
static XmlFilterFactory |
getInstance()
Gets the global instance.
|
static Document |
newDocument()
Creates a new
Document . |
static Filter<Element,ByteBuffer> |
newFilter()
Creates a new XML
Filter . |
Filter<Element,ByteBuffer> |
newFilter(ConnectionHandler<?> handler)
Creates a new
Filter . |
protected static final XmlFilterFactory instance
protected static final ThreadLocal<DocumentBuilder> builderLocal
DocumentBuilder
local to the current thread.protected static final ThreadLocal<Transformer> transformerLocal
Transformer
local to the current thread.public static final XmlFilterFactory getInstance()
public static final Filter<Element,ByteBuffer> newFilter()
Filter
.public void applyInbound(Queue<ByteBuffer> inputs, Queue<Element> outputs)
Filter
applyInbound
in interface Filter<Element,ByteBuffer>
inputs
- the input Queue
.outputs
- the output Queue
.public void applyOutbound(Queue<Element> inputs, Queue<ByteBuffer> outputs)
Filter
applyOutbound
in interface Filter<Element,ByteBuffer>
inputs
- the input Queue
.outputs
- the output Queue
.public Filter<Element,ByteBuffer> newFilter(ConnectionHandler<?> handler)
FilterFactory
Filter
.newFilter
in interface FilterFactory<Filter<Element,ByteBuffer>,Element,ByteBuffer,ConnectionHandler<?>>