Class StaticProxyInterceptor
- java.lang.Object
-
- org.smooks.engine.delivery.interceptor.AbstractInterceptorVisitor
-
- org.smooks.engine.delivery.interceptor.StaticProxyInterceptor
-
- All Implemented Interfaces:
ContentHandler
,FilterBypass
,Consumer
,Producer
,PostExecutionLifecycle
,PostFragmentLifecycle
,PreExecutionLifecycle
,DOMElementVisitor
,DOMVisitAfter
,DOMVisitBefore
,DOMVisitor
,InterceptorVisitor
,AfterVisitor
,BeforeVisitor
,ChildrenVisitor
,ElementVisitor
,ParameterizedVisitor
,SaxNgVisitor
,Visitor
public class StaticProxyInterceptor extends AbstractInterceptorVisitor implements ElementVisitor, DOMElementVisitor, PostFragmentLifecycle, Producer, Consumer, ParameterizedVisitor, PreExecutionLifecycle, PostExecutionLifecycle, FilterBypass
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.smooks.engine.delivery.interceptor.AbstractInterceptorVisitor
AbstractInterceptorVisitor.Invocation<T extends Visitor>, AbstractInterceptorVisitor.VisitAfterInvocation, AbstractInterceptorVisitor.VisitBeforeInvocation, AbstractInterceptorVisitor.VisitChildElementInvocation, AbstractInterceptorVisitor.VisitChildTextInvocation
-
-
Field Summary
Fields Modifier and Type Field Description protected AbstractInterceptorVisitor.Invocation<ParameterizedVisitor>
getMaxNodeInvocation
protected AbstractInterceptorVisitor.Invocation<Visitor>
postExecutionLifecycleInvocation
protected AbstractInterceptorVisitor.Invocation<PostFragmentLifecycle>
postFragmentLifecycleInvocation
protected AbstractInterceptorVisitor.Invocation<Visitor>
preExecutionLifecyleInvocation
-
Fields inherited from class org.smooks.engine.delivery.interceptor.AbstractInterceptorVisitor
applicationContext, invocationTargetCache, target, visitAfterInvocation, visitBeforeInvocation, visitChildElementInvocation, visitChildTextInvocation, visitorBinding
-
-
Constructor Summary
Constructors Constructor Description StaticProxyInterceptor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
bypass(ExecutionContext executionContext, Source source, Result result)
Bypass the Smooks Filter process.boolean
consumes(Object object)
Does this consumer consume the specified named object.int
getMaxNodeDepth()
Gets the maximum node depth thisParameterizedVisitor
can accept when visiting an
Element
inAfterVisitor.visitAfter(Element, ExecutionContext)
.Set<?>
getProducts()
Get the set of products produced by this producer instance.void
onPostExecution(ExecutionContext executionContext)
Cleanup the resources allocated by this resource for the specified ExecutionContext.void
onPostFragment(Fragment<?> fragment, ExecutionContext executionContext)
Cleanup the resources allocated by this resource for the specified ExecutionContext.void
onPreExecution(ExecutionContext executionContext)
Initialize the resources allocated by this resource for the specified ExecutionContext.void
visitAfter(Element element, ExecutionContext executionContext)
Visits the end of anElement
.void
visitBefore(Element element, ExecutionContext executionContext)
Visits the beginning of anElement
.void
visitChildElement(Element childElement, ExecutionContext executionContext)
Visits a childElement
.void
visitChildText(CharacterData characterData, ExecutionContext executionContext)
Visits the character data of anElement
.-
Methods inherited from class org.smooks.engine.delivery.interceptor.AbstractInterceptorVisitor
getTarget, getVisitorBinding, intercept, setVisitorBinding
-
-
-
-
Field Detail
-
postFragmentLifecycleInvocation
protected AbstractInterceptorVisitor.Invocation<PostFragmentLifecycle> postFragmentLifecycleInvocation
-
preExecutionLifecyleInvocation
protected AbstractInterceptorVisitor.Invocation<Visitor> preExecutionLifecyleInvocation
-
postExecutionLifecycleInvocation
protected AbstractInterceptorVisitor.Invocation<Visitor> postExecutionLifecycleInvocation
-
getMaxNodeInvocation
protected AbstractInterceptorVisitor.Invocation<ParameterizedVisitor> getMaxNodeInvocation
-
-
Method Detail
-
visitBefore
public void visitBefore(Element element, ExecutionContext executionContext)
Description copied from interface:BeforeVisitor
Visits the beginning of anElement
.- Specified by:
visitBefore
in interfaceBeforeVisitor
- Specified by:
visitBefore
in interfaceDOMVisitBefore
- Parameters:
element
- theElement
representing the beginning of the fragment. TheElement
's ancestors are traversable unless the global configuration parametermaintain.element.stack
is set to false. TheElement
's child nodes are not traversable.executionContext
- the currentExecutionContext
-
visitAfter
public void visitAfter(Element element, ExecutionContext executionContext)
Description copied from interface:AfterVisitor
Visits the end of anElement
.- Specified by:
visitAfter
in interfaceAfterVisitor
- Specified by:
visitAfter
in interfaceDOMVisitAfter
- Parameters:
element
- theElement
representing the end of the fragment. TheElement
's ancestors are traversable unless the global configuration parametermaintain.element.stack
is set to false. TheElement
's child nodes are traversable if one of the following conditions are met:max.node.depth
global config parameter is set to 0 or greater than 1, or- this
AfterVisitor
implementsParameterizedVisitor.getMaxNodeDepth()
which returns an integer greater than 1
executionContext
- the currentExecutionContext
-
visitChildText
public void visitChildText(CharacterData characterData, ExecutionContext executionContext)
Description copied from interface:ChildrenVisitor
Visits the character data of anElement
. This method is invoked once for each chunk of character data. A shortcut for collecting character data is to annotate theSaxNgVisitor
implementation withorg.smooks.engine.delivery.sax.annotation.StreamResultWriter
, or stash the character data in aTextAccumulatorMemento
and restore theTextAccumulatorMemento
inAfterVisitor.visitAfter(Element, ExecutionContext)
.- Specified by:
visitChildText
in interfaceChildrenVisitor
- Parameters:
characterData
- thenode
which includes character data but not any childElement
s. TheElement
's ancestors are traversable unless the global configuration parametermaintain.element.stack
is set to false.executionContext
- the currentExecutionContext
-
visitChildElement
public void visitChildElement(Element childElement, ExecutionContext executionContext)
Description copied from interface:ChildrenVisitor
Visits a childElement
. This method is invoked once for each childElement
.- Specified by:
visitChildElement
in interfaceChildrenVisitor
- Parameters:
childElement
- the childElementElement
's ancestors are traversable unless the global configuration parametermaintain.element.stack
is set to false. TheElement
's child nodes are not traversable.executionContext
- the currentExecutionContext
-
onPostFragment
public void onPostFragment(Fragment<?> fragment, ExecutionContext executionContext)
Description copied from interface:PostFragmentLifecycle
Cleanup the resources allocated by this resource for the specified ExecutionContext. Executes the cleanup at the end of the fragment visit.- Specified by:
onPostFragment
in interfacePostFragmentLifecycle
- Parameters:
fragment
- The fragment.executionContext
- The ExecutionContext.
-
consumes
public boolean consumes(Object object)
Description copied from interface:Consumer
Does this consumer consume the specified named object. The named object would be a product of aProducer
that is executing on the same element. The consumer should only returnfalse
if it knows for certain that it doesn't consumer the specified named object. If uncertain, it should error on the side of saying that it does consume the object.
-
getProducts
public Set<?> getProducts()
Description copied from interface:Producer
Get the set of products produced by this producer instance.- Specified by:
getProducts
in interfaceProducer
- Returns:
- The set of products produced by this producer instance.
-
getMaxNodeDepth
public int getMaxNodeDepth()
Description copied from interface:ParameterizedVisitor
Gets the maximum node depth thisParameterizedVisitor
can accept when visiting an
Element
inAfterVisitor.visitAfter(Element, ExecutionContext)
.This method allows the targeted
Element
to emulate a DOM tree at the cost of performance. AParameterizedVisitor
with a maximum node depth ofInteger.MAX_VALUE
essentially means that the visitedElement
is a complete DOM tree.- Specified by:
getMaxNodeDepth
in interfaceParameterizedVisitor
- Returns:
- the maximum node depth this
ParameterizedVisitor
can traverse. Any value greater than 0 is valid.
-
onPreExecution
public void onPreExecution(ExecutionContext executionContext)
Description copied from interface:PreExecutionLifecycle
Initialize the resources allocated by this resource for the specified ExecutionContext. Executes the initialization at the start of the filter execution.- Specified by:
onPreExecution
in interfacePreExecutionLifecycle
- Parameters:
executionContext
- The ExecutionContext.
-
onPostExecution
public void onPostExecution(ExecutionContext executionContext)
Description copied from interface:PostExecutionLifecycle
Cleanup the resources allocated by this resource for the specified ExecutionContext. Executes the cleanup at the end of the filter execution.- Specified by:
onPostExecution
in interfacePostExecutionLifecycle
- Parameters:
executionContext
- The ExecutionContext.
-
bypass
public boolean bypass(ExecutionContext executionContext, Source source, Result result) throws SmooksException
Description copied from interface:FilterBypass
Bypass the Smooks Filter process. If the Filter bypass was not applied, the normal Smooks Fragment Filtering process will be proceed.- Specified by:
bypass
in interfaceFilterBypass
- Parameters:
executionContext
- Smooks execution context.source
- Filter Source.result
- Filter Result.- Returns:
- True of the bypass was applied, otherwise false.
- Throws:
SmooksException
- An error occurred while apply the bypass transform.
-
-