|
Rule Execution Server API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object ilog.rules.bom.dynamic.IlrDynamicObjectModel ilog.rules.factory.IlrReflect
public class IlrReflect
This class is the concrete implementation of the Execution Object Model (XOM). When rules are parsed, the rule parser finds class definitions in an instance of this class. While class construction and query APIs are inherited from its superclass, this class provides additional methods for handling the dynamic data binding feature.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface ilog.rules.bom.IlrObjectModel |
---|
IlrObjectModel.Kind, IlrObjectModel.Platform, IlrObjectModel.Selector, IlrObjectModel.SelectorWrapper, IlrObjectModel.Visitor |
Field Summary | |
---|---|
IlrFactory |
factory
A factory builder. |
Fields inherited from class ilog.rules.bom.dynamic.IlrDynamicObjectModel |
---|
modelFactory, supportMissingReferences |
Constructor Summary | |
---|---|
IlrReflect()
Constructs a reflect object. |
|
IlrReflect(IlrResources resources)
Constructs a reflect object. |
Method Summary | |
---|---|
IlrDynamicPackage |
addPackagePath(String pathname)
Adds a package using a fully-qualified package name. |
Object |
get(Object object,
IlrAttribute attribute)
|
boolean |
getBoolean(Object obj,
IlrAttribute field)
|
byte |
getByte(Object obj,
IlrAttribute field)
|
char |
getChar(Object obj,
IlrAttribute field)
|
double |
getDouble(Object obj,
IlrAttribute field)
|
ArrayList |
getDynamicClasses()
Gets a list of dynamic classes defined in this reflect. |
float |
getFloat(Object obj,
IlrAttribute field)
|
int |
getInt(Object obj,
IlrAttribute field)
|
long |
getLong(Object obj,
IlrAttribute field)
|
IlrModelFactory |
getModelFactory()
Returns the model factory of this object model. |
short |
getShort(Object obj,
IlrAttribute field)
|
IlrClass |
getXOMClass(Object object)
Gets the XOM class of an object. |
Object |
invoke(Object object,
IlrMethod meth,
Object... arguments)
|
ilog.rules.factory.IlrReflectClass |
ioFacilityClass()
|
boolean |
isInstance(IlrClass clazz,
Object object)
|
static void |
linkClassLoader(ObjectInputStream str,
ClassLoader loader)
Associates an input stream with a class loader. |
Object |
newArrayInstance(IlrType componentType,
int length)
Creates an array of type componentType and of length
length . |
Object |
newArrayInstance(IlrType componentType,
int[] dimensions)
Creates a multi-dimensional array of type componentType . |
Object |
newInstance(IlrClass c)
|
Object |
newInstance(IlrConstructor cons,
Object... args)
|
void |
registerDriver(IlrClassDriver driver)
|
void |
set(Object object,
IlrAttribute attribute,
Object value)
|
void |
setBoolean(Object obj,
IlrAttribute field,
boolean value)
|
void |
setByte(Object obj,
IlrAttribute field,
byte value)
|
void |
setChar(Object obj,
IlrAttribute field,
char value)
|
void |
setDouble(Object obj,
IlrAttribute field,
double value)
|
void |
setFloat(Object obj,
IlrAttribute field,
float value)
|
void |
setInt(Object obj,
IlrAttribute field,
int value)
|
void |
setLong(Object obj,
IlrAttribute field,
long value)
|
void |
setShort(Object obj,
IlrAttribute field,
short value)
|
void |
writeModel(Writer writer)
Writes the dynamic classes defined in this reflect object to a writer, using the BOM syntax. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface ilog.rules.bom.IlrObjectModel |
---|
getClassReference, getClassReference, getClassReference, getTypeReference, getTypeReference, isDynamicallyLoadingClasses, setJavaClassLookupEnabled, visit |
Methods inherited from interface ilog.rules.bom.IlrProperties |
---|
isPropertyPersistent, setPersistentProperty, setPersistentProperty |
Methods inherited from interface ilog.rules.bom.IlrTransientProperties |
---|
getPropertyValue, getPropertyValue, propertyNames, removeProperty, setPropertyValue |
Field Detail |
---|
public transient IlrFactory factory
A factory builder. The role of this object is to build factory objects attached to a specific reflect object. When the reflect object is created, it automatically initializes this field.
Constructor Detail |
---|
public IlrReflect()
Constructs a reflect object. Initially, the reflect object does not
contain any classes. The resource bundle used to configure the
engine is created using new IlrResources()
.
public IlrReflect(IlrResources resources)
Constructs a reflect object. Initially, the reflect object does not contain any classes. The resource bundle used to configure the engine is passed as an argument.
resources
- The engine configuration resource bundle.Method Detail |
---|
public IlrModelFactory getModelFactory()
IlrDynamicObjectModel
getModelFactory
in interface IlrMutableObjectModel
getModelFactory
in class IlrDynamicObjectModel
public void writeModel(Writer writer) throws IOException
Writes the dynamic classes defined in this reflect object to a writer, using the BOM syntax.
IOException
- if any I/O exceptions have been caused by the
passed writer itself.writer
- The writer to which the model is written.public static void linkClassLoader(ObjectInputStream str, ClassLoader loader)
ObjectInputStream
(very unlikely, because ObjectInputStream
is a system
class and should have no loader), then it is ignored.
public ilog.rules.factory.IlrReflectClass ioFacilityClass()
public ArrayList getDynamicClasses()
Gets a list of dynamic classes defined in this reflect. A dynamic class is one which has been defined explicitly, and which is not mapped to a Java class.
public IlrDynamicPackage addPackagePath(String pathname)
Adds a package using a fully-qualified package name. This method breaks
the passed package name at the location of the .
(dot)
character. And for each name composing the package, checks whether the
package of that name exists in the enclosing package before proceeding
to the creation of the subpackage.
pathname
- The path name.
public void registerDriver(IlrClassDriver driver)
public boolean isInstance(IlrClass clazz, Object object)
isInstance
in interface ilog.rules.factory.IlrDataAccessStrategy
public IlrClass getXOMClass(Object object)
Gets the XOM class of an object. If the object is an instance of some class defined in this reflect object, this method will return the instantiation type.
getXOMClass
in interface ilog.rules.factory.IlrDataAccessStrategy
object
- An object.
public Object get(Object object, IlrAttribute attribute) throws IllegalArgumentException, IllegalAccessException
get
in interface ilog.rules.factory.IlrDataAccessStrategy
IllegalArgumentException
IllegalAccessException
public boolean getBoolean(Object obj, IlrAttribute field) throws IllegalArgumentException, IllegalAccessException
IllegalArgumentException
IllegalAccessException
public char getChar(Object obj, IlrAttribute field) throws IllegalArgumentException, IllegalAccessException
IllegalArgumentException
IllegalAccessException
public byte getByte(Object obj, IlrAttribute field) throws IllegalArgumentException, IllegalAccessException
IllegalArgumentException
IllegalAccessException
public short getShort(Object obj, IlrAttribute field) throws IllegalArgumentException, IllegalAccessException
IllegalArgumentException
IllegalAccessException
public int getInt(Object obj, IlrAttribute field) throws IllegalArgumentException, IllegalAccessException
IllegalArgumentException
IllegalAccessException
public long getLong(Object obj, IlrAttribute field) throws IllegalArgumentException, IllegalAccessException
IllegalArgumentException
IllegalAccessException
public float getFloat(Object obj, IlrAttribute field) throws IllegalArgumentException, IllegalAccessException
IllegalArgumentException
IllegalAccessException
public double getDouble(Object obj, IlrAttribute field) throws IllegalArgumentException, IllegalAccessException
IllegalArgumentException
IllegalAccessException
public void set(Object object, IlrAttribute attribute, Object value) throws IllegalArgumentException, IllegalAccessException
set
in interface ilog.rules.factory.IlrDataAccessStrategy
IllegalArgumentException
IllegalAccessException
public void setBoolean(Object obj, IlrAttribute field, boolean value) throws IllegalArgumentException, IllegalAccessException
IllegalArgumentException
IllegalAccessException
public void setChar(Object obj, IlrAttribute field, char value) throws IllegalArgumentException, IllegalAccessException
IllegalArgumentException
IllegalAccessException
public void setByte(Object obj, IlrAttribute field, byte value) throws IllegalArgumentException, IllegalAccessException
IllegalArgumentException
IllegalAccessException
public void setShort(Object obj, IlrAttribute field, short value) throws IllegalArgumentException, IllegalAccessException
IllegalArgumentException
IllegalAccessException
public void setInt(Object obj, IlrAttribute field, int value) throws IllegalArgumentException, IllegalAccessException
IllegalArgumentException
IllegalAccessException
public void setLong(Object obj, IlrAttribute field, long value) throws IllegalArgumentException, IllegalAccessException
IllegalArgumentException
IllegalAccessException
public void setFloat(Object obj, IlrAttribute field, float value) throws IllegalArgumentException, IllegalAccessException
IllegalArgumentException
IllegalAccessException
public void setDouble(Object obj, IlrAttribute field, double value) throws IllegalArgumentException, IllegalAccessException
IllegalArgumentException
IllegalAccessException
public Object invoke(Object object, IlrMethod meth, Object... arguments) throws IllegalArgumentException, IllegalAccessException, InvocationTargetException
invoke
in interface ilog.rules.factory.IlrDataAccessStrategy
IllegalArgumentException
IllegalAccessException
InvocationTargetException
public Object newInstance(IlrClass c) throws InstantiationException, IllegalAccessException
newInstance
in interface ilog.rules.factory.IlrDataAccessStrategy
InstantiationException
IllegalAccessException
public Object newInstance(IlrConstructor cons, Object... args) throws InstantiationException, IllegalAccessException, InvocationTargetException
newInstance
in interface ilog.rules.factory.IlrDataAccessStrategy
InstantiationException
IllegalAccessException
InvocationTargetException
public Object newArrayInstance(IlrType componentType, int length) throws NegativeArraySizeException
componentType
and of length
length
.
newArrayInstance
in interface ilog.rules.factory.IlrDataAccessStrategy
NegativeArraySizeException
- If the passed length is negative.componentType
- The component type.length
- The array length.
public Object newArrayInstance(IlrType componentType, int[] dimensions) throws IllegalArgumentException, NegativeArraySizeException
componentType
.
newArrayInstance
in interface ilog.rules.factory.IlrDataAccessStrategy
NegativeArraySizeException
- If the passed length is negative.
IllegalArgumentException
componentType
- The component type.dimensions
- The dimensions of the array.
|
Rule Execution Server API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |