Rule Execution Server API

ilog.rules.bom.dynamic
Class IlrDynamicClass

java.lang.Object
  extended by ilog.rules.bom.dynamic.IlrDynamicModelElement
      extended by ilog.rules.bom.dynamic.IlrDynamicType
          extended by ilog.rules.bom.dynamic.IlrDynamicClass
All Implemented Interfaces:
IlrClass, IlrModelElement, IlrNamespace, IlrPrimitiveType, IlrProperties, IlrTransientProperties, IlrType, IlrMutableClass, IlrMutableModelElement, IlrMutableType, IlrVisitable, Serializable

public class IlrDynamicClass
extends IlrDynamicType
implements IlrMutableClass, IlrVisitable, IlrPrimitiveType

An implementation of the IlrClass interface.

Warning: Serialized objects of this class will not be compatible with future releases. The current serialization support is appropriate for short term storage or RMI between applications that run the same version of IBM Decision Server.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface ilog.rules.bom.IlrClass
IlrClass.IlrGenericClassInfo
 
Field Summary
 
Fields inherited from interface ilog.rules.bom.IlrClass
CLASS_KIND_PROPERTY, RAW_CLASS_KIND
 
Method Summary
 void accept(IlrVisitor visitor)
          Defines a default visit path: here visit the nested classes.
 IlrDynamicAttribute addAttribute(String name, IlrType type)
          Deprecated. As of JRules 6.0, use IlrModelFactory.createAttribute(ilog.rules.bom.mutable.IlrMutableClass, String)
 IlrDynamicClass addClass(String name)
          Adds an IlrDynamicClass in this class.
 IlrDynamicConstructor addConstructor()
          Deprecated. As of JRules 6.0, use IlrModelFactory.createConstructor(ilog.rules.bom.mutable.IlrMutableClass).
 IlrDynamicMethod addMethod(String name, IlrType returnType)
          Deprecated. As of JRules 6.0, use IlrModelFactory.createMethod(ilog.rules.bom.mutable.IlrMutableClass, String)
 void addSuperclass(IlrClass aClass)
          Adds a superclass to this class.
 Iterator allAttributes()
          Returns an iterator over the the attributes declared in this class along with all attributes inherited from superclasses.
 Iterator allComponentProperties()
          Returns an iterator over the the component properties declared in this class along with all component properties inherited from superclasses.
 Iterator allIndexedComponentProperties()
          Returns an iterator over the the indexed component properties declared in this class along with all indexed component properties inherited from superclasses.
 Iterator allInterfaces()
          Returns an iterator over the transitive closure of superinterfaces of this class.
 Iterator allMembers()
          Returns an iterator over all declared and inherited members (attributes, constructors and methods) of this class.
 Iterator allMethods()
          Returns an iterator over the the methods declared in this class along with all methods inherited from superclasses.
 Iterator allSuperclasses()
          Returns an iterator over the transitive closure of superclasses and superinterfaces of this class.
 IlrAttribute getAttribute(String name)
          Searches for an attribute having a given name.
 List getAttributes()
          Returns the list of attributes in this class.
 IlrClass getClass(String name)
          Searches the namespace for a class having the given name.
 List getClasses()
          Returns the list of the classes contained in this namespace.
 List getComponentProperties()
          Returns the list of component properties in this class.
 IlrComponentProperty getComponentProperty(String name)
          Searches for a component property having a given name.
 IlrType getComponentType()
          Returns the component type if this type is an array type, null otherwise.
 IlrConstructor getConstructor(IlrType... arguments)
          Searches for a constructor having given parameter types.
 List getConstructors()
          Returns the list of constructors in this class.
 IlrDomain getDomain()
          Returns the domain of the type.
 IlrNamespace getEnclosingNamespace()
          Returns the enclosing namespace of this class.
 IlrClass getFirstSuperclass()
          Returns the first class in the list of superclasses of this class that is not an interface and is null if there is no such class.
 String getFullyQualifiedRawName()
          Returns the fully qualified raw name of this type.
 IlrClass getGenericClass(String rawClassName, int numberOfTypeParameters)
           
 IlrClass.IlrGenericClassInfo getGenericInfo()
          Returns the generic information about this class, or null if the class is neither a generic nor an instantiation of a generic class.
 List getIndexedComponentProperties()
          Returns the list of indexed component properties in this class.
 IlrIndexedComponentProperty getIndexedComponentProperty(String name, IlrType... arguments)
          Searches for an indexed component property having a given name and given parameter types.
 IlrMethod getMethod(String name, IlrType... arguments)
          Searches for a method having a given name and given parameter types.
 IlrMethod getMethod(String name, List arguments)
          Searches for a method having a given name and given parameter types.
 List getMethods()
          Returns the list of methods in this class.
 List getMethods(String name)
          Returns the list of methods of a certain name.
 String getName()
          Returns the name of this model element.
 IlrNamespace getNamespace(String name)
          Returns the contained name space having the given name.
 Class getNativeClass()
          Returns the native class represented by this IlrType or null.
 List getNestedClasses()
          Returns the list of classes nested in this class.
 String getRawName()
          Returns the raw name of this type.
 List getSuperclasses()
          Returns the list of superclasses of this class.
 int getTypeTag()
           
 IlrClass getWrapperClass()
          Returns the wrapper class for this primitive type.
 Iterator interfaces()
          Returns an iterator over the direct superinterfaces of this class.
 boolean isAbstract()
          Returns true if the class is abstract.
 boolean isArray()
          Returns true if this type is an array class.
 boolean isBooleanType()
          Returns true if this is the boolean type
 boolean isByteType()
          Returns true if this is the byte type
 boolean isCharType()
          Returns true if this is the char type
 boolean isDoubleType()
          Returns true if this is the double type
 boolean isFloatType()
          Returns true if this is the float type
 boolean isInterface()
          Returns true if the class is an interface.
 boolean isIntType()
          Returns true if this is the int type
 boolean isLongType()
          Returns true if this is the long type
 boolean isNumericType()
          Returns true if this type is a numeric type.
 boolean isOtherType()
           
 boolean isPrivate()
          Returns true if the class is private.
 boolean isProtected()
          Returns true if the class is protected.
 boolean isPublic()
          Returns true if the class is public.
 boolean isShortType()
          Returns true if this is the short type
 boolean isStatic()
          Returns true if the class is static.
 boolean isSubclassOf(IlrClass otherClass)
          Tests whether a class is a direct or indirect subclass of another class.
 boolean isVoidType()
          Returns true if this is the void type
 Iterator members()
          Returns an iterator over all declared members (attributes, constructors and methods) of this class.
 void setAbstract(boolean flag)
          Sets the 'abstract' property of this class.
 void setDomain(IlrDomain domain)
          Sets the domain of this class.
 void setInterface(boolean interfaceFlag)
          Sets the interface property of this class.
 void setPackageVisibility()
          Sets the visibility of this class to package.
 void setPrivate()
          Sets the visibility of this class to private.
 void setProtected()
          Sets the visibility of this class to protected.
 void setPublic()
          Sets the visibility of this class to public.
 void setStatic(boolean flag)
          Sets the 'static' property of this class.
 boolean widens(IlrPrimitiveType otherType)
           
 
Methods inherited from class ilog.rules.bom.dynamic.IlrDynamicType
getArrayClass, getArrayType, isClass, isEnum, isPrimitiveType, isTypeVariable, isWildcardType
 
Methods inherited from class ilog.rules.bom.dynamic.IlrDynamicModelElement
fireUpdate, fireUpdate, fixType, getFullyQualifiedName, getMutableObjectModel, getObjectModel, getPropertyValue, getPropertyValue, hasListeners, isPropertyPersistent, propertyNames, removeProperty, setPersistentProperty, setPersistentProperty, setPropertyValue
 
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.mutable.IlrMutableClass
setFinal
 
Methods inherited from interface ilog.rules.bom.IlrClass
allInheritedAttributes, allInheritedMembers, allInheritedMethods, isFinal, visit
 
Methods inherited from interface ilog.rules.bom.IlrNamespace
modelElementIterator
 
Methods inherited from interface ilog.rules.bom.IlrType
detach, getArrayClass, getArrayType, getJavaClass, isClass, isEnum, isMissingReference, isPrimitiveType, isTypeVariable, isWildcardType
 
Methods inherited from interface ilog.rules.bom.mutable.IlrMutableModelElement
getMutableObjectModel
 
Methods inherited from interface ilog.rules.bom.IlrModelElement
getFullyQualifiedName, getObjectModel
 
Methods inherited from interface ilog.rules.bom.IlrProperties
isPropertyPersistent, setPersistentProperty, setPersistentProperty
 
Methods inherited from interface ilog.rules.bom.IlrTransientProperties
getPropertyValue, getPropertyValue, propertyNames, removeProperty, setPropertyValue
 

Method Detail

addClass

public IlrDynamicClass addClass(String name)
Adds an IlrDynamicClass in this class.

Note: There is no verification that the class does not already contain an IlrDynamicMethod with the given name.

Parameters:
name - The name of the new class.
Returns:
The added class.

getNativeClass

public Class getNativeClass()
Returns the native class represented by this IlrType or null.

Specified by:
getNativeClass in interface IlrType

getName

public String getName()
Returns the name of this model element. The name of an element is always its name relative to its enclosing namespace (by opposition to its fully qualified name which is relative to the object model).

Specified by:
getName in interface IlrModelElement
Overrides:
getName in class IlrDynamicModelElement
Returns:
a character string or null.

getRawName

public String getRawName()
Description copied from interface: IlrType
Returns the raw name of this type. For a generic type, the raw name is the name without the generic parameters. For a non-generic type, it returns the name of the type, as returned by IlrModelElement.getName().

Specified by:
getRawName in interface IlrType
Overrides:
getRawName in class IlrDynamicType

getFullyQualifiedRawName

public String getFullyQualifiedRawName()
Description copied from interface: IlrType
Returns the fully qualified raw name of this type. For a generic type, the fully qualified raw name is the fully qualified name without the generic parameters. For a non-generic type, it returns the name of the type, as returned by IlrModelElement.getFullyQualifiedName().

Specified by:
getFullyQualifiedRawName in interface IlrType
Overrides:
getFullyQualifiedRawName in class IlrDynamicType

isInterface

public boolean isInterface()
Returns true if the class is an interface.

Specified by:
isInterface in interface IlrClass

setInterface

public void setInterface(boolean interfaceFlag)
Sets the interface property of this class. Initially, this property is false.

Specified by:
setInterface in interface IlrMutableClass
Parameters:
interfaceFlag - The new value of the interface flag.

setPackageVisibility

public void setPackageVisibility()
Sets the visibility of this class to package.

Note: This is the default setting for the visibility.

Specified by:
setPackageVisibility in interface IlrMutableClass

isPublic

public boolean isPublic()
Returns true if the class is public.

Specified by:
isPublic in interface IlrClass

setPublic

public void setPublic()
Sets the visibility of this class to public.

Specified by:
setPublic in interface IlrMutableClass

isProtected

public boolean isProtected()
Returns true if the class is protected.

Specified by:
isProtected in interface IlrClass

setProtected

public void setProtected()
Sets the visibility of this class to protected.

Specified by:
setProtected in interface IlrMutableClass

isPrivate

public boolean isPrivate()
Returns true if the class is private.

Specified by:
isPrivate in interface IlrClass

setPrivate

public void setPrivate()
Sets the visibility of this class to private.

Specified by:
setPrivate in interface IlrMutableClass

isStatic

public boolean isStatic()
Returns true if the class is static.

Specified by:
isStatic in interface IlrClass

setStatic

public void setStatic(boolean flag)
Sets the 'static' property of this class. Initially, this property is false.

Specified by:
setStatic in interface IlrMutableClass
Parameters:
flag - the new value of the 'static' property.

isAbstract

public boolean isAbstract()
Returns true if the class is abstract.

Specified by:
isAbstract in interface IlrClass

setAbstract

public void setAbstract(boolean flag)
Sets the 'abstract' property of this class. Initially, this property is false.

Specified by:
setAbstract in interface IlrMutableClass
Parameters:
flag - The new value of the 'abstract' property.

isArray

public boolean isArray()
Returns true if this type is an array class.

Specified by:
isArray in interface IlrType
Overrides:
isArray in class IlrDynamicType

getComponentType

public IlrType getComponentType()
Returns the component type if this type is an array type, null otherwise.

Specified by:
getComponentType in interface IlrType
Overrides:
getComponentType in class IlrDynamicType

getDomain

public IlrDomain getDomain()
Returns the domain of the type.

Specified by:
getDomain in interface IlrType
Returns:
The domain of the type or null if the type does not have a domain.

Note: The returned domain may be the super type domain if applicable, thus be careful if you want to change it.


setDomain

public void setDomain(IlrDomain domain)
Sets the domain of this class.

Specified by:
setDomain in interface IlrMutableType
Parameters:
domain - The new domain of the class. Initially this property is null.

getEnclosingNamespace

public IlrNamespace getEnclosingNamespace()
Returns the enclosing namespace of this class. It is either an IlrPackage or another IlrClass.

Specified by:
getEnclosingNamespace in interface IlrModelElement
Returns:
a namespace or null

getNestedClasses

public List getNestedClasses()
Returns the list of classes nested in this class.

Note:If there are no nested classes, this method may either return null or an empty list.

Specified by:
getNestedClasses in interface IlrClass

getClass

public IlrClass getClass(String name)
Description copied from interface: IlrNamespace
Searches the namespace for a class having the given name. If such a class exists it is returned, otherwise null is returned.

Specified by:
getClass in interface IlrNamespace

getGenericClass

public IlrClass getGenericClass(String rawClassName,
                                int numberOfTypeParameters)
Specified by:
getGenericClass in interface IlrNamespace

getClasses

public List getClasses()
Description copied from interface: IlrNamespace
Returns the list of the classes contained in this namespace. Note that if there are no classes, this method may either return null or an empty list.

Specified by:
getClasses in interface IlrNamespace

getSuperclasses

public List getSuperclasses()
Returns the list of superclasses of this class.

Note: If there are no superclasses, this method may either return null or an empty list.

Specified by:
getSuperclasses in interface IlrClass

addSuperclass

public void addSuperclass(IlrClass aClass)
Adds a superclass to this class.

Specified by:
addSuperclass in interface IlrMutableClass
Parameters:
aClass - the class which will be added to the superclass list.

getConstructors

public List getConstructors()
Returns the list of constructors in this class.

Note: If there are no constructors, this method may either return null or an empty list.

Specified by:
getConstructors in interface IlrClass

addConstructor

public IlrDynamicConstructor addConstructor()
Deprecated. As of JRules 6.0, use IlrModelFactory.createConstructor(ilog.rules.bom.mutable.IlrMutableClass).

Adds a IlrDynamicConstructor in this class.

Returns:
The constructor.

getMethods

public List getMethods()
Returns the list of methods in this class.

Note: If there are no methods, this method may either return null or an empty list.
The new {link #getMethods(String)} is more performant than this one if you already have the name of the methods you are looking for.

Specified by:
getMethods in interface IlrClass
See Also:
IlrMethod

getMethods

public List getMethods(String name)
Returns the list of methods of a certain name. Note that if there are no methods, this method may either return null or an empty list.

Specified by:
getMethods in interface IlrClass
Since:
JRules 6.0
Parameters:
name - The name of the method.
See Also:
IlrMethod

addMethod

public IlrDynamicMethod addMethod(String name,
                                  IlrType returnType)
Deprecated. As of JRules 6.0, use IlrModelFactory.createMethod(ilog.rules.bom.mutable.IlrMutableClass, String)

Adds an IlrDynamicMethod in this class.

Note: There is no verification that the class does not already contain an IlrDynamicMethod with the given name.

Parameters:
name - The name of the class.
returnType - The return type of the method.
Returns:
The method.

getAttributes

public List getAttributes()
Returns the list of attributes in this class.

Note: If there are no attributes, this method may either return null or an empty list.

Specified by:
getAttributes in interface IlrClass
See Also:
IlrAttribute

getComponentProperties

public List getComponentProperties()
Returns the list of component properties in this class.

Note: If there are no component properties, this method may either return null or an empty list.

Specified by:
getComponentProperties in interface IlrClass
See Also:
IlrComponentProperty

getIndexedComponentProperties

public List getIndexedComponentProperties()
Returns the list of indexed component properties in this class.

Note: If there are no indexed component properties, this method may either return null or an empty list.

Specified by:
getIndexedComponentProperties in interface IlrClass
See Also:
IlrIndexedComponentProperty

addAttribute

public IlrDynamicAttribute addAttribute(String name,
                                        IlrType type)
Deprecated. As of JRules 6.0, use IlrModelFactory.createAttribute(ilog.rules.bom.mutable.IlrMutableClass, String)

Adds an IlrDynamicAttribute in this class.

Note: There is no verification that the class does not already contain an IlrDynamicMethod with the given name.

Parameters:
name - The name of the attribute.
type - The type of the attribute.
Returns:
the attribute.

getNamespace

public IlrNamespace getNamespace(String name)
Returns the contained name space having the given name. If such a namespace exists, it is returned, otherwise null is returned.

Specified by:
getNamespace in interface IlrNamespace
Since:
JRules 7.0

accept

public void accept(IlrVisitor visitor)
Defines a default visit path: here visit the nested classes.

Specified by:
accept in interface IlrVisitable
Parameters:
visitor - The visitor.

isSubclassOf

public boolean isSubclassOf(IlrClass otherClass)
Tests whether a class is a direct or indirect subclass of another class.

Specified by:
isSubclassOf in interface IlrClass
Parameters:
otherClass - An IlrClass.
Returns:
true if this class is either directly or transitively a subclass of otherClass.

getFirstSuperclass

public IlrClass getFirstSuperclass()
Returns the first class in the list of superclasses of this class that is not an interface and is null if there is no such class.

Specified by:
getFirstSuperclass in interface IlrClass

allSuperclasses

public Iterator allSuperclasses()
Returns an iterator over the transitive closure of superclasses and superinterfaces of this class.

Specified by:
allSuperclasses in interface IlrClass

allMethods

public Iterator allMethods()
Returns an iterator over the the methods declared in this class along with all methods inherited from superclasses.

Specified by:
allMethods in interface IlrClass

allAttributes

public Iterator allAttributes()
Returns an iterator over the the attributes declared in this class along with all attributes inherited from superclasses.

Specified by:
allAttributes in interface IlrClass

allComponentProperties

public Iterator allComponentProperties()
Returns an iterator over the the component properties declared in this class along with all component properties inherited from superclasses.

Specified by:
allComponentProperties in interface IlrClass

allIndexedComponentProperties

public Iterator allIndexedComponentProperties()
Returns an iterator over the the indexed component properties declared in this class along with all indexed component properties inherited from superclasses.

Specified by:
allIndexedComponentProperties in interface IlrClass

interfaces

public Iterator interfaces()
Returns an iterator over the direct superinterfaces of this class.

Specified by:
interfaces in interface IlrClass

allInterfaces

public Iterator allInterfaces()
Returns an iterator over the transitive closure of superinterfaces of this class.

Specified by:
allInterfaces in interface IlrClass

members

public Iterator members()
Returns an iterator over all declared members (attributes, constructors and methods) of this class.

Specified by:
members in interface IlrClass

allMembers

public Iterator allMembers()
Returns an iterator over all declared and inherited members (attributes, constructors and methods) of this class.

Specified by:
allMembers in interface IlrClass

getConstructor

public IlrConstructor getConstructor(IlrType... arguments)
Searches for a constructor having given parameter types.

Specified by:
getConstructor in interface IlrClass
Parameters:
arguments - an array of types
Returns:
the constructor if any which matches the given argument types.

getMethod

public IlrMethod getMethod(String name,
                           IlrType... arguments)
Searches for a method having a given name and given parameter types.

Specified by:
getMethod in interface IlrClass
Parameters:
name - a character string.
arguments - an array of types
Returns:
the method if any which has the given name and matches the given argument types.

getMethod

public IlrMethod getMethod(String name,
                           List arguments)
Searches for a method having a given name and given parameter types.

Specified by:
getMethod in interface IlrClass
Since:
JRules 6.0
Parameters:
name - A character string.
arguments - A list of IlrTypes or IlrParameters.
Returns:
The method, if any, which has the given name and matches the given argument types.

getAttribute

public IlrAttribute getAttribute(String name)
Searches for an attribute having a given name.

Specified by:
getAttribute in interface IlrClass
Parameters:
name - A character string.
Returns:
The attribute, if any, having the given name.

getComponentProperty

public IlrComponentProperty getComponentProperty(String name)
Searches for a component property having a given name.

Specified by:
getComponentProperty in interface IlrClass
Parameters:
name - A character string.
Returns:
The component property, if any, having the given name.

getIndexedComponentProperty

public IlrIndexedComponentProperty getIndexedComponentProperty(String name,
                                                               IlrType... arguments)
Searches for an indexed component property having a given name and given parameter types.

Specified by:
getIndexedComponentProperty in interface IlrClass
Parameters:
name - A character string.
arguments - An array of types.
Returns:
The indexed component property, if any, which has the given name and matches the given argument types.

widens

public boolean widens(IlrPrimitiveType otherType)

isVoidType

public boolean isVoidType()
Description copied from interface: IlrPrimitiveType
Returns true if this is the void type

Specified by:
isVoidType in interface IlrPrimitiveType

isBooleanType

public boolean isBooleanType()
Description copied from interface: IlrPrimitiveType
Returns true if this is the boolean type

Specified by:
isBooleanType in interface IlrPrimitiveType

isByteType

public boolean isByteType()
Description copied from interface: IlrPrimitiveType
Returns true if this is the byte type

Specified by:
isByteType in interface IlrPrimitiveType

isCharType

public boolean isCharType()
Description copied from interface: IlrPrimitiveType
Returns true if this is the char type

Specified by:
isCharType in interface IlrPrimitiveType

isFloatType

public boolean isFloatType()
Description copied from interface: IlrPrimitiveType
Returns true if this is the float type

Specified by:
isFloatType in interface IlrPrimitiveType

isDoubleType

public boolean isDoubleType()
Description copied from interface: IlrPrimitiveType
Returns true if this is the double type

Specified by:
isDoubleType in interface IlrPrimitiveType

isShortType

public boolean isShortType()
Description copied from interface: IlrPrimitiveType
Returns true if this is the short type

Specified by:
isShortType in interface IlrPrimitiveType

isIntType

public boolean isIntType()
Description copied from interface: IlrPrimitiveType
Returns true if this is the int type

Specified by:
isIntType in interface IlrPrimitiveType

isLongType

public boolean isLongType()
Description copied from interface: IlrPrimitiveType
Returns true if this is the long type

Specified by:
isLongType in interface IlrPrimitiveType

getWrapperClass

public IlrClass getWrapperClass()
Description copied from interface: IlrPrimitiveType
Returns the wrapper class for this primitive type.

Specified by:
getWrapperClass in interface IlrPrimitiveType

isNumericType

public boolean isNumericType()
Description copied from interface: IlrPrimitiveType
Returns true if this type is a numeric type.

Specified by:
isNumericType in interface IlrPrimitiveType

isOtherType

public boolean isOtherType()

getTypeTag

public int getTypeTag()

getGenericInfo

public IlrClass.IlrGenericClassInfo getGenericInfo()
Description copied from interface: IlrClass
Returns the generic information about this class, or null if the class is neither a generic nor an instantiation of a generic class.

Specified by:
getGenericInfo in interface IlrClass
Returns:
Generic information, or null.

Rule Execution Server API

© Copyright IBM Corp. 1987, 2012