org.milyn.javabean.binding
Class AbstractBinding

java.lang.Object
  extended by org.milyn.javabean.binding.AbstractBinding
Direct Known Subclasses:
XMLBinding

public class AbstractBinding
extends Object

Abstract Binding class.

Author:
tom.fennelly@gmail.com

Constructor Summary
protected AbstractBinding()
          Constructor.
protected AbstractBinding(org.milyn.Smooks smooks)
          Constructor.
 
Method Summary
 AbstractBinding add(InputStream smooksConfigStream)
          Add Smooks binding configurations to the binding instance.
 AbstractBinding add(String smooksConfigURI)
          Add Smooks binding configurations to the binding instance.
protected  void assertInitialized()
           
protected  void assertNotAllConfigsAdded()
           
protected  void assertNotInitialized()
           
protected
<T> T
bind(Source inputSource, Class<T> toType)
          Bind the input source to the specified type.
protected  GetterGraph constructContextualGetter(Bean bean)
           
protected  GetterGraph constructContextualGetter(DataBinding binding)
           
 org.milyn.Smooks getSmooks()
          Get the underlying Smooks instance.
protected  org.milyn.cdr.SmooksResourceConfigurationList getUserDefinedResourceList()
           
 AbstractBinding intiailize()
          Initialize the binding instance.
 AbstractBinding setReportPath(String reportPath)
          Set the execution report output path.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractBinding

protected AbstractBinding()
Constructor.


AbstractBinding

protected AbstractBinding(org.milyn.Smooks smooks)
Constructor.

Parameters:
smooks - Smooks instance.
Method Detail

add

public AbstractBinding add(String smooksConfigURI)
                    throws IOException,
                           SAXException
Add Smooks binding configurations to the binding instance.

Parameters:
smooksConfigURI - Smooks configuration.
Throws:
IOException - Error reading resource stream.
SAXException - Error parsing the resource stream.

add

public AbstractBinding add(InputStream smooksConfigStream)
                    throws IOException,
                           SAXException
Add Smooks binding configurations to the binding instance.

Parameters:
smooksConfigStream - Smooks configuration.
Throws:
IOException - Error reading resource stream.
SAXException - Error parsing the resource stream.

intiailize

public AbstractBinding intiailize()
Initialize the binding instance.


getSmooks

public org.milyn.Smooks getSmooks()
Get the underlying Smooks instance.

Returns:
The underlying Smooks instance.

setReportPath

public AbstractBinding setReportPath(String reportPath)
Set the execution report output path.

Parameters:
reportPath - The execution report output path.

bind

protected <T> T bind(Source inputSource,
                     Class<T> toType)
          throws IOException
Bind the input source to the specified type.

In order to make a cleaner API, implementing classes should create a more appropriately named method based on the target binding format, that just delegates to this method e.g. XMLBinding.fromXML(javax.xml.transform.Source, Class) and XMLBinding.toXML(Object, java.io.Writer).

Parameters:
inputSource - The input source.
toType - The target type.
Returns:
The target binding type instance.
Throws:
IOException - Error binding source to target type.

getUserDefinedResourceList

protected org.milyn.cdr.SmooksResourceConfigurationList getUserDefinedResourceList()

constructContextualGetter

protected GetterGraph constructContextualGetter(DataBinding binding)

constructContextualGetter

protected GetterGraph constructContextualGetter(Bean bean)

assertInitialized

protected void assertInitialized()

assertNotAllConfigsAdded

protected void assertNotAllConfigsAdded()

assertNotInitialized

protected void assertNotInitialized()


Copyright © 2018. All rights reserved.