ILOG JRules

ilog.rules.ras.tools
Class IlrBindingTool

java.lang.Object
  extended by ilog.rules.ras.tools.IlrBindingTool

public class IlrBindingTool
extends Object

The IlrBindingTool class can be used to perform quick to and from databinding operations without having to pass by the IlrDataBinding class. Simply create an instance of the binding class and then use the to or from binding API methods to perform your binding operations.

For example:

Creating an Excel file from an IlrScenarioReport instance:

IlrExcelDataReportImpl excel = new IlrExcelDataReportImpl();
byte[] data = IlrBindingTool.fromBinding(excel, report);

Creating an IlrScenarioReport instance from an Excel file:

IlrXMLDataReportImpl binding = new IlrXMLDataReportImpl();
IlrScenarioTestResult tr = (IlrScenarioTestResult)toBinding(binding, bytes);


Constructor Summary
IlrBindingTool()
           
 
Method Summary
static Object fromBinding(IlrDataBindingBaseImpl binding, byte[] data)
          Converts data from a databinding format to an object.
static byte[] fromBinding(IlrDataBindingBaseImpl binding, Object o)
          Deprecated. Use toBinding.
protected static IlrResourceResolver resolver()
           
static Object toBinding(IlrDataBindingBaseImpl binding, byte[] data)
          Deprecated. Use fromBinding.
static byte[] toBinding(IlrDataBindingBaseImpl binding, Object o)
          Converts an object that supports databinding to the data format of that binding.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IlrBindingTool

public IlrBindingTool()
Method Detail

fromBinding

public static byte[] fromBinding(IlrDataBindingBaseImpl binding,
                                 Object o)
Deprecated. Use toBinding.

Converts an object that supports databinding to the data format of that binding.

Parameters:
binding - The databinding to use.
o - The object to pass to the databinding for conversion.
Returns:
A byte array which is the result of calling the method.

toBinding

public static byte[] toBinding(IlrDataBindingBaseImpl binding,
                               Object o)
                        throws Exception
Converts an object that supports databinding to the data format of that binding.

Throws:
Exception
Parameters:
binding - The databinding to use.
o - The object to pass to the databinding for conversion.
Returns:
A byte array which is the result of calling the method.

toBinding

public static Object toBinding(IlrDataBindingBaseImpl binding,
                               byte[] data)
                        throws Exception
Deprecated. Use fromBinding.

Converts data from a databinding format to an object.

Throws:
Exception
Parameters:
binding - The databinding to use.
data - A byte array to convert.
Returns:
An object which is the result of calling the conversion.

fromBinding

public static Object fromBinding(IlrDataBindingBaseImpl binding,
                                 byte[] data)
                          throws Exception
Converts data from a databinding format to an object.

Throws:
Exception
Parameters:
binding - The databinding to use.
data - A byte array to convert.
Returns:
An object which is the result of calling the conversion.

resolver

protected static IlrResourceResolver resolver()

ILOG JRules