public class FragmentSerializer extends Object implements SAXVisitBefore, SAXVisitAfter, DOMVisitBefore, DOMVisitAfter, Producer, VisitLifecycleCleanable
Constructor and Description |
---|
FragmentSerializer() |
Modifier and Type | Method and Description |
---|---|
void |
executeVisitLifecycleCleanup(Fragment fragment,
ExecutionContext executionContext)
Cleanup the resources allocated by this resource for the specified ExecutionContext.
|
Set<? extends Object> |
getProducts()
Get the set of products produced by this producer instance.
|
FragmentSerializer |
setBindTo(String bindTo)
Set the bind-to beanId for the serialized fragment.
|
FragmentSerializer |
setChildContentOnly(boolean childContentOnly)
Set whether or not the child content only should be serialized.
|
FragmentSerializer |
setOmitXMLDeclaration(boolean omitXMLDeclaration)
Omit the XML Declaration from the serialized fragments.
|
FragmentSerializer |
setRetain(boolean retain)
Retain the fragment bean in the
BeanContext after it's creating fragment
has been processed. |
void |
visitAfter(Element element,
ExecutionContext executionContext)
Visit the supplied element after visiting its child elements.
|
void |
visitAfter(SAXElement saxElement,
ExecutionContext executionContext)
Visit the supplied element after visiting its child elements.
|
void |
visitBefore(Element element,
ExecutionContext executionContext)
Visit the supplied element before visiting its child elements.
|
void |
visitBefore(SAXElement saxElement,
ExecutionContext executionContext)
Visit the supplied element before visiting its child elements.
|
@ConfigParam public FragmentSerializer setBindTo(String bindTo)
bindTo
- The bind-to beanId for the serialized fragment.@ConfigParam(defaultVal="false") public FragmentSerializer setOmitXMLDeclaration(boolean omitXMLDeclaration)
omitXMLDeclaration
- True if the XML declaration is to be omitted, otherwise false.@ConfigParam(defaultVal="false") public FragmentSerializer setChildContentOnly(boolean childContentOnly)
childContentOnly
- True if the child content only (exclude
the targeted element itself), otherwise false.@ConfigParam(defaultVal="false") public FragmentSerializer setRetain(boolean retain)
BeanContext
after it's creating fragment
has been processed.retain
- True if the fragment bean is to be retained in the BeanContext
,
otherwise false.public Set<? extends Object> getProducts()
Producer
getProducts
in interface Producer
public void visitBefore(SAXElement saxElement, ExecutionContext executionContext) throws SmooksException, IOException
SAXVisitBefore
visitBefore
in interface SAXVisitBefore
saxElement
- The SAX element being visited.executionContext
- Execution context.SmooksException
- Event processing failure.IOException
- Error writing event to output writer.public void visitAfter(SAXElement saxElement, ExecutionContext executionContext) throws SmooksException, IOException
SAXVisitAfter
visitAfter
in interface SAXVisitAfter
saxElement
- The SAX element being visited.executionContext
- Execution context.SmooksException
- Event processing failure.IOException
- Error writing event to output writer.public void visitBefore(Element element, ExecutionContext executionContext) throws SmooksException
DOMVisitBefore
visitBefore
in interface DOMVisitBefore
element
- The DOM element being visited.executionContext
- Request relative instance.SmooksException
- Element processing failure.public void visitAfter(Element element, ExecutionContext executionContext) throws SmooksException
DOMVisitAfter
visitAfter
in interface DOMVisitAfter
element
- The DOM element being visited.executionContext
- Request relative instance.SmooksException
- Element processing failure.public void executeVisitLifecycleCleanup(Fragment fragment, ExecutionContext executionContext)
VisitLifecycleCleanable
executeVisitLifecycleCleanup
in interface VisitLifecycleCleanable
fragment
- The fragment.executionContext
- The ExecutionContext.Copyright © 2020. All rights reserved.