|
ILOG JRules | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectilog.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.Selector, IlrObjectModel.SelectorWrapper, IlrObjectModel.Visitor |
| Field Summary | |
|---|---|
static IlrReflect |
adefault
Deprecated. As of JRules 6.6, please avoid using this static instance, as it will be removed in a future version |
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)
|
boolean |
isInstance(IlrClass clazz,
Object object)
|
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, isJavaClassLookupEnabled, 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 static final IlrReflect adefault
A default reflect object used by constructors and methods of the Factory API. Whenever the API does not provide a reflect object explicitly, this static field is used. It is not recommended to use this object as it does not allow clean separation of the namespaces.
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 IlrMutableObjectModelgetModelFactory 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 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.IlrDataAccessStrategypublic 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.IlrDataAccessStrategyobject - An object.
public Object get(Object object,
IlrAttribute attribute)
throws IllegalArgumentException,
IllegalAccessException
get in interface ilog.rules.factory.IlrDataAccessStrategyIllegalArgumentException
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.IlrDataAccessStrategyIllegalArgumentException
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.IlrDataAccessStrategyIllegalArgumentException
IllegalAccessException
InvocationTargetException
public Object newInstance(IlrClass c)
throws InstantiationException,
IllegalAccessException
newInstance in interface ilog.rules.factory.IlrDataAccessStrategyInstantiationException
IllegalAccessException
public Object newInstance(IlrConstructor cons,
Object[] args)
throws InstantiationException,
IllegalAccessException,
InvocationTargetException
newInstance in interface ilog.rules.factory.IlrDataAccessStrategyInstantiationException
IllegalAccessException
InvocationTargetException
public Object newArrayInstance(IlrType componentType,
int length)
throws NegativeArraySizeException
componentType and of length
length.
newArrayInstance in interface ilog.rules.factory.IlrDataAccessStrategyNegativeArraySizeException - 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.IlrDataAccessStrategyNegativeArraySizeException - If the passed length is negative.
IllegalArgumentExceptioncomponentType - The component type.dimensions - The dimensions of the array.
|
ILOG JRules | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||