Class FragmentSerializer
- java.lang.Object
-
- org.smooks.cartridges.routing.basic.FragmentSerializer
-
- All Implemented Interfaces:
org.smooks.api.delivery.ContentHandler,org.smooks.api.delivery.ordering.Producer,org.smooks.api.lifecycle.PostFragmentLifecycle,org.smooks.api.resource.visitor.sax.ng.AfterVisitor,org.smooks.api.resource.visitor.sax.ng.BeforeVisitor,org.smooks.api.resource.visitor.sax.ng.SaxNgVisitor,org.smooks.api.resource.visitor.Visitor
public class FragmentSerializer extends Object implements org.smooks.api.resource.visitor.sax.ng.BeforeVisitor, org.smooks.api.resource.visitor.sax.ng.AfterVisitor, org.smooks.api.delivery.ordering.Producer, org.smooks.api.lifecycle.PostFragmentLifecycle
Basic message fragment serializer.- Author:
- tom.fennelly@jboss.com
-
-
Constructor Summary
Constructors Constructor Description FragmentSerializer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Set<? extends Object>getProducts()voidonPostFragment(org.smooks.api.delivery.fragment.Fragment fragment, org.smooks.api.ExecutionContext executionContext)FragmentSerializersetBindTo(String bindTo)Set the bind-to beanId for the serialized fragment.FragmentSerializersetChildContentOnly(Optional<Boolean> childContentOnly)Set whether or not the child content only should be serialized.FragmentSerializersetOmitXMLDeclaration(Optional<Boolean> omitXMLDeclaration)Omit the XML Declaration from the serialized fragments.FragmentSerializersetRetain(Optional<Boolean> retain)Retain the fragment bean in theBeanContextafter it's creating fragment has been processed.voidvisitAfter(Element element, org.smooks.api.ExecutionContext executionContext)voidvisitBefore(Element element, org.smooks.api.ExecutionContext executionContext)
-
-
-
Method Detail
-
setBindTo
@Inject public FragmentSerializer setBindTo(String bindTo)
Set the bind-to beanId for the serialized fragment.- Parameters:
bindTo- The bind-to beanId for the serialized fragment.- Returns:
- this instance.
-
setOmitXMLDeclaration
@Inject public FragmentSerializer setOmitXMLDeclaration(Optional<Boolean> omitXMLDeclaration)
Omit the XML Declaration from the serialized fragments.- Parameters:
omitXMLDeclaration- True if the XML declaration is to be omitted, otherwise false.- Returns:
- this instance.
-
setChildContentOnly
@Inject public FragmentSerializer setChildContentOnly(Optional<Boolean> childContentOnly)
Set whether or not the child content only should be serialized. This variable is, by default, false.- Parameters:
childContentOnly- True if the child content only (exclude the targeted element itself), otherwise false.- Returns:
- this instance.
-
setRetain
@Inject public FragmentSerializer setRetain(Optional<Boolean> retain)
Retain the fragment bean in theBeanContextafter it's creating fragment has been processed.- Parameters:
retain- True if the fragment bean is to be retained in theBeanContext, otherwise false.- Returns:
- this instance.
-
getProducts
public Set<? extends Object> getProducts()
- Specified by:
getProductsin interfaceorg.smooks.api.delivery.ordering.Producer
-
visitBefore
public void visitBefore(Element element, org.smooks.api.ExecutionContext executionContext) throws org.smooks.api.SmooksException
- Specified by:
visitBeforein interfaceorg.smooks.api.resource.visitor.sax.ng.BeforeVisitor- Throws:
org.smooks.api.SmooksException
-
visitAfter
public void visitAfter(Element element, org.smooks.api.ExecutionContext executionContext) throws org.smooks.api.SmooksException
- Specified by:
visitAfterin interfaceorg.smooks.api.resource.visitor.sax.ng.AfterVisitor- Throws:
org.smooks.api.SmooksException
-
onPostFragment
public void onPostFragment(org.smooks.api.delivery.fragment.Fragment fragment, org.smooks.api.ExecutionContext executionContext)- Specified by:
onPostFragmentin interfaceorg.smooks.api.lifecycle.PostFragmentLifecycle
-
-