Rule Execution Server API

ilog.rules.factory
Interface IlrClassDriver


public interface IlrClassDriver

An interface responsible for providing the execution policy for a dynamic class. A class driver is attached to a root Java class and handles the instances of Java objects starting at the root class. An execution policy for a class is a set of Java methods called for creating instances of the class, get and set the fields and to invoke the methods. See the Rule Engine User's Manual for more details.

Since:
4.0

Nested Class Summary
static interface IlrClassDriver.ClassTester
          Interface for testing if an object is an instance of some class.
static interface IlrClassDriver.Constructor
          Interface for invoking some constructor with some given argument values.
static interface IlrClassDriver.Invoker
          Interface for invoking some method with an object and the current argument values.
static interface IlrClassDriver.Reader
          Interface for getting some field of a given object.
static interface IlrClassDriver.UnknownChecker
          Interface for testing whether a field has been assigned a value.
static interface IlrClassDriver.Writer
          Interface for setting a value to some field of a given object.
 
Method Summary
 IlrClassDriver.Constructor getConstructor(IlrConstructor constructor)
          Gets a constructor for the constructor passed as argument.
 IlrClassDriver.Invoker getInvoker(IlrMethod method)
          Gets an invoker for the method passed as argument.
 IlrClassDriver.Reader getReader(IlrAttribute attribute)
          Gets a reader for the passed attribute.
 Class getRootClass()
          Gets the root class of this class driver.
 IlrClassDriver.ClassTester getTester(IlrClass aclass)
          Gets the tester for the class passed as argument.
 IlrClassDriver.UnknownChecker getUnknownChecker(IlrAttribute attribute)
          Gets a checker for the passed attribute.
 IlrClassDriver.Writer getWriter(IlrAttribute attribute)
          Gets a writer for the passed attribute.
 IlrClass getXOMClass(Object object)
          Gets the virtual class, that is an instance of IlrClass for a given object.
 

Method Detail

getRootClass

Class getRootClass()
Gets the root class of this class driver. The class driver only handles the instances of this root class.

Returns:
a Java class.

getXOMClass

IlrClass getXOMClass(Object object)
Gets the virtual class, that is an instance of IlrClass for a given object. If the class driver recognizes the object, it will return its virtual class. If it does not recognize the passed object, it should return null.

Parameters:
object - An object. This parameter is never null.
Returns:
an IlrClass or null.

getTester

IlrClassDriver.ClassTester getTester(IlrClass aclass)
Gets the tester for the class passed as argument. The passed class is a dynamic class having the right property indicating this class driver as its class driver. This method must return a tester which tests whether some object is an instance of the passed class. If this method returns null, the rule parsing will fail.

Parameters:
aclass - The dynamic class for which a tester is requested.
Returns:
a ClassTester.

getReader

IlrClassDriver.Reader getReader(IlrAttribute attribute)
Gets a reader for the passed attribute. The attribute is a dynamic attribute. This method must return a field getter to read the passed attribute. If null is returned, the rule parsing will fail.

Parameters:
attribute - The dynamic attribute.
Returns:
a field reader.

getWriter

IlrClassDriver.Writer getWriter(IlrAttribute attribute)
Gets a writer for the passed attribute. The attribute is a dynamic attribute. This method must return a field setter to write a value to the passed attribute. If null is returned, the rule parsing will fail.

Parameters:
attribute - The dynamic attribute.
Returns:
a field writer.

getUnknownChecker

IlrClassDriver.UnknownChecker getUnknownChecker(IlrAttribute attribute)
Gets a checker for the passed attribute. The attribute is a dynamic attribute. This method must return a checker for testing whether the passed attribute is assigned a value. If null is returned, the rule parsing will fail.

Parameters:
attribute - The dynamic attribute.
Returns:
a field checker.

getInvoker

IlrClassDriver.Invoker getInvoker(IlrMethod method)
Gets an invoker for the method passed as argument. This method must return an invoker for executing the method passed as argument, according to its signature. If null is returned, the rule parsing will fail.

Parameters:
method - The dynamic method.
Returns:
an invoker.

getConstructor

IlrClassDriver.Constructor getConstructor(IlrConstructor constructor)
Gets a constructor for the constructor passed as argument. This method must return a constructor for executing the constructor passed as argument, according to its signature. If null is returned, the rule parsing will fail.

Parameters:
constructor - The dynamic constructor.
Returns:
a constructor.

Rule Execution Server API

© Copyright IBM Corp. 1987, 2013