org.milyn.routing.basic
Class FragmentSerializer

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

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

Basic message fragment serializer.

Author:
tom.fennelly@jboss.com

Constructor Summary
FragmentSerializer()
           
 
Method Summary
 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.
 void visitAfter(Element element, ExecutionContext executionContext)
           
 void visitAfter(SAXElement saxElement, 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.

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

visitAfter

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


Copyright © 2010. All Rights Reserved.