|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Interface defines a processor engine. The engine is activated and its life cycle controlled by the processor. The engine indicates which nodes it wishes to process and provides a single method to process each of these nodes.
An engine is created from a ProcessorEngineCreator
with the
controlling process context. The engine is then queried to determine
what nodes should be passed to it, returning a bit mask of node types.
The process(org.openxml.x3p.ProcessContext, org.w3c.dom.Node)
method is called for each of the nodes in a
depth-first traversal order. Once the engine is no longer required,
it's destroy(org.openxml.x3p.ProcessContext)
method is called.
The process(org.openxml.x3p.ProcessContext, org.w3c.dom.Node)
method may return one of four valid values:
Note that process(org.openxml.x3p.ProcessContext, org.w3c.dom.Node)
may be called for nodes that the engine is not
interested in, and then engine should behave accordingly by returning each
node as is.
The engine need not be thread-safe. An instance of the engine will only be called to process on behalf of a single processor / process context, and in sequential order.
Processor
,
ProcessorEngineCreator
Field Summary | |
static int |
PROCESS_ALL
Process all nodes. |
static int |
PROCESS_COMMENT
Process comments. |
static int |
PROCESS_DEFAULT
Process default nodes. |
static int |
PROCESS_ELEMENT
Process elements. |
static int |
PROCESS_ENTITYREF
Process entity references. |
static int |
PROCESS_PI
Process PIs. |
static int |
PROCESS_TEXT
Process text. |
static int |
PROCESS_TOP
Process only the top node in the tree. |
Method Summary | |
void |
destroy(ProcessContext ctx)
Called once to tell the engine it is no longer needed. |
Node |
process(ProcessContext ctx,
Node source)
Process the node. |
int |
whatToProcess()
The engine tells the processor which nodes it is interested in processing by returning a bit mask of node types. |
Field Detail |
public static final int PROCESS_DEFAULT
public static final int PROCESS_TOP
public static final int PROCESS_ALL
public static final int PROCESS_ELEMENT
public static final int PROCESS_TEXT
public static final int PROCESS_ENTITYREF
public static final int PROCESS_PI
public static final int PROCESS_COMMENT
Method Detail |
public Node process(ProcessContext ctx, Node source) throws ProcessorException
ctx
- The process contextsource
- The node to processpublic void destroy(ProcessContext ctx)
ctx
- The process contextpublic int whatToProcess()
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |