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>getMaxNodeInvocationprotected AbstractInterceptorVisitor.Invocation<Visitor>postExecutionLifecycleInvocationprotected AbstractInterceptorVisitor.Invocation<PostFragmentLifecycle>postFragmentLifecycleInvocationprotected 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 booleanbypass(ExecutionContext executionContext, Source source, Sink sink)Bypass the Smooks Filter process.booleanconsumes(Object object)Does this consumer consume the specified named object.intgetMaxNodeDepth()Gets the maximum node depth thisParameterizedVisitorcan accept when visiting anElementinAfterVisitor.visitAfter(Element, ExecutionContext).Set<?>getProducts()Get the set of products produced by this producer instance.voidonPostExecution(ExecutionContext executionContext)Cleanup the resources allocated by this resource for the specified ExecutionContext.voidonPostFragment(Fragment<?> fragment, ExecutionContext executionContext)Cleanup the resources allocated by this resource for the specified ExecutionContext.voidonPreExecution(ExecutionContext executionContext)Initialize the resources allocated by this resource for the specified ExecutionContext.voidvisitAfter(Element element, ExecutionContext executionContext)Visits the end of anElement.voidvisitBefore(Element element, ExecutionContext executionContext)Visits the beginning of anElement.voidvisitChildElement(Element childElement, ExecutionContext executionContext)Visits a childElement.voidvisitChildText(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:BeforeVisitorVisits the beginning of anElement.- Specified by:
visitBeforein interfaceBeforeVisitor- Specified by:
visitBeforein interfaceDOMVisitBefore- Parameters:
element- theElementrepresenting the beginning of the fragment. TheElement's ancestors are traversable unless the global configuration parametermaintain.element.stackis 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:AfterVisitorVisits the end of anElement.- Specified by:
visitAfterin interfaceAfterVisitor- Specified by:
visitAfterin interfaceDOMVisitAfter- Parameters:
element- theElementrepresenting the end of the fragment. TheElement's ancestors are traversable unless the global configuration parametermaintain.element.stackis set to false. TheElement's child nodes are traversable if one of the following conditions are met:max.node.depthglobal config parameter is set to 0 or greater than 1, or- this
AfterVisitorimplementsParameterizedVisitor.getMaxNodeDepth()which returns an integer greater than 1
executionContext- the currentExecutionContext
-
visitChildText
public void visitChildText(CharacterData characterData, ExecutionContext executionContext)
Description copied from interface:ChildrenVisitorVisits 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 theSaxNgVisitorimplementation withorg.smooks.engine.delivery.sax.annotation.StreamResultWriter, or stash the character data in aTextAccumulatorMementoand restore theTextAccumulatorMementoinAfterVisitor.visitAfter(Element, ExecutionContext).- Specified by:
visitChildTextin interfaceChildrenVisitor- Parameters:
characterData- thenodewhich includes character data but not any childElements. TheElement's ancestors are traversable unless the global configuration parametermaintain.element.stackis set to false.executionContext- the currentExecutionContext
-
visitChildElement
public void visitChildElement(Element childElement, ExecutionContext executionContext)
Description copied from interface:ChildrenVisitorVisits a childElement. This method is invoked once for each childElement.- Specified by:
visitChildElementin interfaceChildrenVisitor- Parameters:
childElement- the childElementElement's ancestors are traversable unless the global configuration parametermaintain.element.stackis 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:PostFragmentLifecycleCleanup the resources allocated by this resource for the specified ExecutionContext. Executes the cleanup at the end of the fragment visit.- Specified by:
onPostFragmentin interfacePostFragmentLifecycle- Parameters:
fragment- The fragment.executionContext- The ExecutionContext.
-
consumes
public boolean consumes(Object object)
Description copied from interface:ConsumerDoes this consumer consume the specified named object. The named object would be a product of aProducerthat is executing on the same element. The consumer should only returnfalseif 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:ProducerGet the set of products produced by this producer instance.- Specified by:
getProductsin interfaceProducer- Returns:
- The set of products produced by this producer instance.
-
getMaxNodeDepth
public int getMaxNodeDepth()
Description copied from interface:ParameterizedVisitorGets the maximum node depth thisParameterizedVisitorcan accept when visiting anElementinAfterVisitor.visitAfter(Element, ExecutionContext).This method allows the targeted
Elementto emulate a DOM tree at the cost of performance. AParameterizedVisitorwith a maximum node depth ofInteger.MAX_VALUEessentially means that the visitedElementis a complete DOM tree.- Specified by:
getMaxNodeDepthin interfaceParameterizedVisitor- Returns:
- the maximum node depth this
ParameterizedVisitorcan traverse. Any value greater than 0 is valid.
-
onPreExecution
public void onPreExecution(ExecutionContext executionContext)
Description copied from interface:PreExecutionLifecycleInitialize the resources allocated by this resource for the specified ExecutionContext. Executes the initialization at the start of the filter execution.- Specified by:
onPreExecutionin interfacePreExecutionLifecycle- Parameters:
executionContext- The ExecutionContext.
-
onPostExecution
public void onPostExecution(ExecutionContext executionContext)
Description copied from interface:PostExecutionLifecycleCleanup the resources allocated by this resource for the specified ExecutionContext. Executes the cleanup at the end of the filter execution.- Specified by:
onPostExecutionin interfacePostExecutionLifecycle- Parameters:
executionContext- The ExecutionContext.
-
bypass
public boolean bypass(ExecutionContext executionContext, Source source, Sink sink) throws SmooksException
Description copied from interface:FilterBypassBypass the Smooks Filter process. If the Filter bypass was not applied, the normal Smooks Fragment Filtering process will be proceed.- Specified by:
bypassin interfaceFilterBypass- Parameters:
executionContext- Smooks execution context.source- Filter Source.sink- Filter Sink.- Returns:
- True of the bypass was applied, otherwise false.
- Throws:
SmooksException- An error occurred while apply the bypass transform.
-
-