org.milyn.routing.basic
Class FragmentSerializer

java.lang.Object
  extended by org.milyn.routing.basic.FragmentSerializer
All Implemented Interfaces:
ContentHandler, DOMVisitAfter, DOMVisitBefore, DOMVisitor, Producer, SAXVisitAfter, SAXVisitBefore, SAXVisitor, VisitLifecycleCleanable, Visitor

public class FragmentSerializer
extends Object
implements SAXVisitBefore, SAXVisitAfter, DOMVisitBefore, DOMVisitAfter, Producer, VisitLifecycleCleanable

Basic message fragment serializer.

Author:
tom.fennelly@jboss.com

Constructor Summary
FragmentSerializer()
           
 
Method Summary
 void executeVisitLifecycleCleanup(Fragment fragment, ExecutionContext executionContext)
           
 Set<? extends Object> getProducts()
           
 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)
           
 void visitAfter(SAXElement saxElement, ExecutionContext executionContext)
           
 void visitBefore(Element element, ExecutionContext executionContext)
           
 void visitBefore(SAXElement saxElement, ExecutionContext executionContext)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FragmentSerializer

public FragmentSerializer()
Method Detail

setBindTo

@ConfigParam
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

@ConfigParam(defaultVal="false")
public FragmentSerializer setOmitXMLDeclaration(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

@ConfigParam(defaultVal="false")
public FragmentSerializer setChildContentOnly(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

@ConfigParam(defaultVal="false")
public FragmentSerializer setRetain(boolean retain)
Retain the fragment bean in the BeanContext after it's creating fragment has been processed.

Parameters:
retain - True if the fragment bean is to be retained in the BeanContext, otherwise false.
Returns:
this instance.

getProducts

public Set<? extends Object> getProducts()
Specified by:
getProducts in interface Producer

visitBefore

public void visitBefore(SAXElement saxElement,
                        ExecutionContext executionContext)
                 throws SmooksException,
                        IOException
Specified by:
visitBefore in interface SAXVisitBefore
Throws:
SmooksException
IOException

visitAfter

public void visitAfter(SAXElement saxElement,
                       ExecutionContext executionContext)
                throws SmooksException,
                       IOException
Specified by:
visitAfter in interface SAXVisitAfter
Throws:
SmooksException
IOException

visitBefore

public void visitBefore(Element element,
                        ExecutionContext executionContext)
                 throws SmooksException
Specified by:
visitBefore in interface DOMVisitBefore
Throws:
SmooksException

visitAfter

public void visitAfter(Element element,
                       ExecutionContext executionContext)
                throws SmooksException
Specified by:
visitAfter in interface DOMVisitAfter
Throws:
SmooksException

executeVisitLifecycleCleanup

public void executeVisitLifecycleCleanup(Fragment fragment,
                                         ExecutionContext executionContext)
Specified by:
executeVisitLifecycleCleanup in interface VisitLifecycleCleanable


Copyright © 2014. All Rights Reserved.