Class IlrDynamicClass
- java.lang.Object
-
- ilog.rules.bom.dynamic.IlrDynamicModelElement
-
- ilog.rules.bom.dynamic.IlrDynamicType
-
- ilog.rules.bom.dynamic.IlrDynamicClass
-
- All Implemented Interfaces:
- IlrClass, IlrModelElement, IlrNamespace, IlrPrimitiveType, IlrProperties, IlrTransientProperties, IlrType, IlrMutableClass, IlrMutableModelElement, IlrMutableType, IlrVisitable, java.io.Serializable
public class IlrDynamicClass extends IlrDynamicType implements IlrMutableClass, IlrVisitable, IlrPrimitiveType
An implementation of theIlrClassinterface.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
Methods Modifier and Type Method and Description voidaccept(IlrVisitor visitor)Defines a default visit path: here visit the nested classes.IlrDynamicAttributeaddAttribute(java.lang.String name, IlrType type)Deprecated.As of JRules 6.0, useIlrModelFactory.createAttribute(ilog.rules.bom.mutable.IlrMutableClass, String)IlrDynamicClassaddClass(java.lang.String name)Adds anIlrDynamicClassin this class.IlrDynamicConstructoraddConstructor()Deprecated.As of JRules 6.0, useIlrModelFactory.createConstructor(ilog.rules.bom.mutable.IlrMutableClass).IlrDynamicMethodaddMethod(java.lang.String name, IlrType returnType)Deprecated.As of JRules 6.0, useIlrModelFactory.createMethod(ilog.rules.bom.mutable.IlrMutableClass, String)voidaddSuperclass(IlrClass aClass)Adds a superclass to this class.java.util.IteratorallAttributes()Returns an iterator over the the attributes declared in this class along with all attributes inherited from superclasses.java.util.IteratorallComponentProperties()Returns an iterator over the the component properties declared in this class along with all component properties inherited from superclasses.java.util.IteratorallIndexedComponentProperties()Returns an iterator over the the indexed component properties declared in this class along with all indexed component properties inherited from superclasses.java.util.IteratorallInterfaces()Returns an iterator over the transitive closure of superinterfaces of this class.java.util.IteratorallMembers()Returns an iterator over all declared and inherited members (attributes, constructors and methods) of this class.java.util.IteratorallMethods()Returns an iterator over the the methods declared in this class along with all methods inherited from superclasses.java.util.IteratorallSuperclasses()Returns an iterator over the transitive closure of superclasses and superinterfaces of this class.IlrAttributegetAttribute(java.lang.String name)Searches for an attribute having a given name.java.util.ListgetAttributes()Returns the list of attributes in this class.IlrClassgetClass(java.lang.String name)Searches the namespace for a class having the given name.java.util.ListgetClasses()Returns the list of the classes contained in this namespace.java.util.ListgetComponentProperties()Returns the list of component properties in this class.IlrComponentPropertygetComponentProperty(java.lang.String name)Searches for a component property having a given name.IlrTypegetComponentType()Returns the component type if this type is an array type,nullotherwise.IlrConstructorgetConstructor(IlrType... arguments)Searches for a constructor having given parameter types.java.util.ListgetConstructors()Returns the list of constructors in this class.IlrDomaingetDomain()Returns the domain of the type.IlrNamespacegetEnclosingNamespace()Returns the enclosing namespace of this class.IlrClassgetFirstSuperclass()Returns the first class in the list of superclasses of this class that is not an interface and isnullif there is no such class.java.lang.StringgetFullyQualifiedRawName()Returns the fully qualified raw name of this type.IlrClassgetGenericClass(java.lang.String rawClassName, int numberOfTypeParameters)IlrClass.IlrGenericClassInfogetGenericInfo()Returns the generic information about this class, ornullif the class is neither a generic nor an instantiation of a generic class.java.util.ListgetIndexedComponentProperties()Returns the list of indexed component properties in this class.IlrIndexedComponentPropertygetIndexedComponentProperty(java.lang.String name, IlrType... arguments)Searches for an indexed component property having a given name and given parameter types.IlrMethodgetMethod(java.lang.String name, IlrType... arguments)Searches for a method having a given name and given parameter types.IlrMethodgetMethod(java.lang.String name, java.util.List arguments)Searches for a method having a given name and given parameter types.java.util.ListgetMethods()Returns the list of methods in this class.java.util.ListgetMethods(java.lang.String name)Returns the list of methods of a certain name.java.lang.StringgetName()Returns the name of this model element.IlrNamespacegetNamespace(java.lang.String name)Returns the contained name space having the given name.java.lang.ClassgetNativeClass()Returns the native class represented by thisIlrTypeornull.java.util.ListgetNestedClasses()Returns the list of classes nested in this class.java.lang.StringgetRawName()Returns the raw name of this type.java.util.ListgetSuperclasses()Returns the list of superclasses of this class.intgetTypeTag()IlrClassgetWrapperClass()Returns the wrapper class for this primitive type.java.util.Iteratorinterfaces()Returns an iterator over the direct superinterfaces of this class.booleanisAbstract()Returnstrueif the class is abstract.booleanisArray()Returnstrueif this type is an array class.booleanisBooleanType()Returnstrueif this is thebooleantypebooleanisByteType()Returnstrueif this is thebytetypebooleanisCharType()Returnstrueif this is thechartypebooleanisDoubleType()Returnstrueif this is thedoubletypebooleanisFloatType()Returnstrueif this is thefloattypebooleanisInterface()Returnstrueif the class is an interface.booleanisIntType()Returnstrueif this is theinttypebooleanisLongType()Returnstrueif this is thelongtypebooleanisNumericType()Returnstrueif this type is a numeric type.booleanisOtherType()booleanisPrivate()Returnstrueif the class is private.booleanisProtected()Returnstrueif the class is protected.booleanisPublic()Returnstrueif the class is public.booleanisShortType()Returnstrueif this is theshorttypebooleanisStatic()Returnstrueif the class is static.booleanisSubclassOf(IlrClass otherClass)Tests whether a class is a direct or indirect subclass of another class.booleanisVoidType()Returnstrueif this is thevoidtypejava.util.Iteratormembers()Returns an iterator over all declared members (attributes, constructors and methods) of this class.voidsetAbstract(boolean flag)Sets the 'abstract' property of this class.voidsetDomain(IlrDomain domain)Sets the domain of this class.voidsetInterface(boolean interfaceFlag)Sets theinterfaceproperty of this class.voidsetPackageVisibility()Sets the visibility of this class topackage.voidsetPrivate()Sets the visibility of this class toprivate.voidsetProtected()Sets the visibility of this class toprotected.voidsetPublic()Sets the visibility of this class topublic.voidsetStatic(boolean flag)Sets the 'static' property of this class.booleanwidens(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(java.lang.String name)
Adds anIlrDynamicClassin this class.Note: There is no verification that the class does not already contain an
IlrDynamicMethodwith the given name.- Parameters:
name- The name of the new class.- Returns:
- The added class.
-
getNativeClass
public java.lang.Class getNativeClass()
Returns the native class represented by thisIlrTypeornull.- Specified by:
getNativeClassin interfaceIlrType
-
getName
public java.lang.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:
getNamein interfaceIlrModelElement- Overrides:
getNamein classIlrDynamicModelElement- Returns:
- a character string or null.
-
getRawName
public java.lang.String getRawName()
Description copied from interface:IlrTypeReturns 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 byIlrModelElement.getName().- Specified by:
getRawNamein interfaceIlrType- Overrides:
getRawNamein classIlrDynamicType
-
getFullyQualifiedRawName
public java.lang.String getFullyQualifiedRawName()
Description copied from interface:IlrTypeReturns 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 byIlrModelElement.getFullyQualifiedName().- Specified by:
getFullyQualifiedRawNamein interfaceIlrType- Overrides:
getFullyQualifiedRawNamein classIlrDynamicType
-
isInterface
public boolean isInterface()
Returnstrueif the class is an interface.- Specified by:
isInterfacein interfaceIlrClass
-
setInterface
public void setInterface(boolean interfaceFlag)
Sets theinterfaceproperty of this class. Initially, this property isfalse.- Specified by:
setInterfacein interfaceIlrMutableClass- Parameters:
interfaceFlag- The new value of the interface flag.
-
setPackageVisibility
public void setPackageVisibility()
Sets the visibility of this class topackage.Note: This is the default setting for the visibility.
- Specified by:
setPackageVisibilityin interfaceIlrMutableClass
-
isPublic
public boolean isPublic()
Returnstrueif the class is public.
-
setPublic
public void setPublic()
Sets the visibility of this class topublic.- Specified by:
setPublicin interfaceIlrMutableClass
-
isProtected
public boolean isProtected()
Returnstrueif the class is protected.- Specified by:
isProtectedin interfaceIlrClass
-
setProtected
public void setProtected()
Sets the visibility of this class toprotected.- Specified by:
setProtectedin interfaceIlrMutableClass
-
isPrivate
public boolean isPrivate()
Returnstrueif the class is private.
-
setPrivate
public void setPrivate()
Sets the visibility of this class toprivate.- Specified by:
setPrivatein interfaceIlrMutableClass
-
isStatic
public boolean isStatic()
Returnstrueif the class is static.
-
setStatic
public void setStatic(boolean flag)
Sets the 'static' property of this class. Initially, this property isfalse.- Specified by:
setStaticin interfaceIlrMutableClass- Parameters:
flag- the new value of the 'static' property.
-
isAbstract
public boolean isAbstract()
Returnstrueif the class is abstract.- Specified by:
isAbstractin interfaceIlrClass
-
setAbstract
public void setAbstract(boolean flag)
Sets the 'abstract' property of this class. Initially, this property isfalse.- Specified by:
setAbstractin interfaceIlrMutableClass- Parameters:
flag- The new value of the 'abstract' property.
-
isArray
public boolean isArray()
Returnstrueif this type is an array class.- Specified by:
isArrayin interfaceIlrType- Overrides:
isArrayin classIlrDynamicType
-
getComponentType
public IlrType getComponentType()
Returns the component type if this type is an array type,nullotherwise.- Specified by:
getComponentTypein interfaceIlrType- Overrides:
getComponentTypein classIlrDynamicType
-
getDomain
public IlrDomain getDomain()
Returns the domain of the type.
-
setDomain
public void setDomain(IlrDomain domain)
Sets the domain of this class.- Specified by:
setDomainin interfaceIlrMutableType- Parameters:
domain- The new domain of the class. Initially this property isnull.
-
getEnclosingNamespace
public IlrNamespace getEnclosingNamespace()
Returns the enclosing namespace of this class. It is either anIlrPackageor anotherIlrClass.- Specified by:
getEnclosingNamespacein interfaceIlrModelElement- Returns:
- a namespace or
null
-
getNestedClasses
public java.util.List getNestedClasses()
Returns the list of classes nested in this class.Note:If there are no nested classes, this method may either return
nullor an empty list.- Specified by:
getNestedClassesin interfaceIlrClass
-
getClass
public IlrClass getClass(java.lang.String name)
Description copied from interface:IlrNamespaceSearches the namespace for a class having the given name. If such a class exists it is returned, otherwisenullis returned.- Specified by:
getClassin interfaceIlrNamespace
-
getGenericClass
public IlrClass getGenericClass(java.lang.String rawClassName, int numberOfTypeParameters)
- Specified by:
getGenericClassin interfaceIlrNamespace
-
getClasses
public java.util.List getClasses()
Description copied from interface:IlrNamespaceReturns the list of the classes contained in this namespace. Note that if there are no classes, this method may either returnnullor an empty list.- Specified by:
getClassesin interfaceIlrNamespace
-
getSuperclasses
public java.util.List getSuperclasses()
Returns the list of superclasses of this class.Note: If there are no superclasses, this method may either return
nullor an empty list.- Specified by:
getSuperclassesin interfaceIlrClass
-
addSuperclass
public void addSuperclass(IlrClass aClass)
Adds a superclass to this class.- Specified by:
addSuperclassin interfaceIlrMutableClass- Parameters:
aClass- the class which will be added to the superclass list.
-
getConstructors
public java.util.List getConstructors()
Returns the list of constructors in this class.Note: If there are no constructors, this method may either return
nullor an empty list.- Specified by:
getConstructorsin interfaceIlrClass
-
addConstructor
public IlrDynamicConstructor addConstructor()
Deprecated. As of JRules 6.0, useIlrModelFactory.createConstructor(ilog.rules.bom.mutable.IlrMutableClass).Adds aIlrDynamicConstructorin this class.- Returns:
- The constructor.
-
getMethods
public java.util.List getMethods()
Returns the list of methods in this class.Note: If there are no methods, this method may either return
nullor 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:
getMethodsin interfaceIlrClass- See Also:
IlrMethod
-
getMethods
public java.util.List getMethods(java.lang.String name)
Returns the list of methods of a certain name. Note that if there are no methods, this method may either returnnullor an empty list.- Specified by:
getMethodsin interfaceIlrClass- Since:
- JRules 6.0
- Parameters:
name- The name of the method.- See Also:
IlrMethod
-
addMethod
public IlrDynamicMethod addMethod(java.lang.String name, IlrType returnType)
Deprecated. As of JRules 6.0, useIlrModelFactory.createMethod(ilog.rules.bom.mutable.IlrMutableClass, String)Adds anIlrDynamicMethodin this class.Note: There is no verification that the class does not already contain an
IlrDynamicMethodwith the given name.- Parameters:
name- The name of the class.returnType- The return type of the method.- Returns:
- The method.
-
getAttributes
public java.util.List getAttributes()
Returns the list of attributes in this class.Note: If there are no attributes, this method may either return
nullor an empty list.- Specified by:
getAttributesin interfaceIlrClass- See Also:
IlrAttribute
-
getComponentProperties
public java.util.List getComponentProperties()
Returns the list of component properties in this class.Note: If there are no component properties, this method may either return
nullor an empty list.- Specified by:
getComponentPropertiesin interfaceIlrClass- See Also:
IlrComponentProperty
-
getIndexedComponentProperties
public java.util.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
nullor an empty list.- Specified by:
getIndexedComponentPropertiesin interfaceIlrClass- See Also:
IlrIndexedComponentProperty
-
addAttribute
public IlrDynamicAttribute addAttribute(java.lang.String name, IlrType type)
Deprecated. As of JRules 6.0, useIlrModelFactory.createAttribute(ilog.rules.bom.mutable.IlrMutableClass, String)Adds anIlrDynamicAttributein this class.Note: There is no verification that the class does not already contain an
IlrDynamicMethodwith the given name.- Parameters:
name- The name of the attribute.type- The type of the attribute.- Returns:
- the attribute.
-
getNamespace
public IlrNamespace getNamespace(java.lang.String name)
Returns the contained name space having the given name. If such a namespace exists, it is returned, otherwisenullis returned.- Specified by:
getNamespacein interfaceIlrNamespace- Since:
- JRules 7.0
-
accept
public void accept(IlrVisitor visitor)
Defines a default visit path: here visit the nested classes.- Specified by:
acceptin interfaceIlrVisitable- 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:
isSubclassOfin interfaceIlrClass- Parameters:
otherClass- AnIlrClass.- Returns:
trueif this class is either directly or transitively a subclass ofotherClass.
-
getFirstSuperclass
public IlrClass getFirstSuperclass()
Returns the first class in the list of superclasses of this class that is not an interface and isnullif there is no such class.- Specified by:
getFirstSuperclassin interfaceIlrClass
-
allSuperclasses
public java.util.Iterator allSuperclasses()
Returns an iterator over the transitive closure of superclasses and superinterfaces of this class.- Specified by:
allSuperclassesin interfaceIlrClass
-
allMethods
public java.util.Iterator allMethods()
Returns an iterator over the the methods declared in this class along with all methods inherited from superclasses.- Specified by:
allMethodsin interfaceIlrClass
-
allAttributes
public java.util.Iterator allAttributes()
Returns an iterator over the the attributes declared in this class along with all attributes inherited from superclasses.- Specified by:
allAttributesin interfaceIlrClass
-
allComponentProperties
public java.util.Iterator allComponentProperties()
Returns an iterator over the the component properties declared in this class along with all component properties inherited from superclasses.- Specified by:
allComponentPropertiesin interfaceIlrClass
-
allIndexedComponentProperties
public java.util.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:
allIndexedComponentPropertiesin interfaceIlrClass
-
interfaces
public java.util.Iterator interfaces()
Returns an iterator over the direct superinterfaces of this class.- Specified by:
interfacesin interfaceIlrClass
-
allInterfaces
public java.util.Iterator allInterfaces()
Returns an iterator over the transitive closure of superinterfaces of this class.- Specified by:
allInterfacesin interfaceIlrClass
-
members
public java.util.Iterator members()
Returns an iterator over all declared members (attributes, constructors and methods) of this class.
-
allMembers
public java.util.Iterator allMembers()
Returns an iterator over all declared and inherited members (attributes, constructors and methods) of this class.- Specified by:
allMembersin interfaceIlrClass
-
getConstructor
public IlrConstructor getConstructor(IlrType... arguments)
Searches for a constructor having given parameter types.- Specified by:
getConstructorin interfaceIlrClass- Parameters:
arguments- an array of types- Returns:
- the constructor if any which matches the given argument types.
-
getMethod
public IlrMethod getMethod(java.lang.String name, IlrType... arguments)
Searches for a method having a given name and given parameter types.
-
getMethod
public IlrMethod getMethod(java.lang.String name, java.util.List arguments)
Searches for a method having a given name and given parameter types.- Specified by:
getMethodin interfaceIlrClass- Since:
- JRules 6.0
- Parameters:
name- A character string.arguments- A list ofIlrTypes orIlrParameters.- Returns:
- The method, if any, which has the given name and matches the given argument types.
-
getAttribute
public IlrAttribute getAttribute(java.lang.String name)
Searches for an attribute having a given name.- Specified by:
getAttributein interfaceIlrClass- Parameters:
name- A character string.- Returns:
- The attribute, if any, having the given name.
-
getComponentProperty
public IlrComponentProperty getComponentProperty(java.lang.String name)
Searches for a component property having a given name.- Specified by:
getComponentPropertyin interfaceIlrClass- Parameters:
name- A character string.- Returns:
- The component property, if any, having the given name.
-
getIndexedComponentProperty
public IlrIndexedComponentProperty getIndexedComponentProperty(java.lang.String name, IlrType... arguments)
Searches for an indexed component property having a given name and given parameter types.- Specified by:
getIndexedComponentPropertyin interfaceIlrClass- 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:IlrPrimitiveTypeReturnstrueif this is thevoidtype- Specified by:
isVoidTypein interfaceIlrPrimitiveType
-
isBooleanType
public boolean isBooleanType()
Description copied from interface:IlrPrimitiveTypeReturnstrueif this is thebooleantype- Specified by:
isBooleanTypein interfaceIlrPrimitiveType
-
isByteType
public boolean isByteType()
Description copied from interface:IlrPrimitiveTypeReturnstrueif this is thebytetype- Specified by:
isByteTypein interfaceIlrPrimitiveType
-
isCharType
public boolean isCharType()
Description copied from interface:IlrPrimitiveTypeReturnstrueif this is thechartype- Specified by:
isCharTypein interfaceIlrPrimitiveType
-
isFloatType
public boolean isFloatType()
Description copied from interface:IlrPrimitiveTypeReturnstrueif this is thefloattype- Specified by:
isFloatTypein interfaceIlrPrimitiveType
-
isDoubleType
public boolean isDoubleType()
Description copied from interface:IlrPrimitiveTypeReturnstrueif this is thedoubletype- Specified by:
isDoubleTypein interfaceIlrPrimitiveType
-
isShortType
public boolean isShortType()
Description copied from interface:IlrPrimitiveTypeReturnstrueif this is theshorttype- Specified by:
isShortTypein interfaceIlrPrimitiveType
-
isIntType
public boolean isIntType()
Description copied from interface:IlrPrimitiveTypeReturnstrueif this is theinttype- Specified by:
isIntTypein interfaceIlrPrimitiveType
-
isLongType
public boolean isLongType()
Description copied from interface:IlrPrimitiveTypeReturnstrueif this is thelongtype- Specified by:
isLongTypein interfaceIlrPrimitiveType
-
getWrapperClass
public IlrClass getWrapperClass()
Description copied from interface:IlrPrimitiveTypeReturns the wrapper class for this primitive type.- Specified by:
getWrapperClassin interfaceIlrPrimitiveType
-
isNumericType
public boolean isNumericType()
Description copied from interface:IlrPrimitiveTypeReturnstrueif this type is a numeric type.- Specified by:
isNumericTypein interfaceIlrPrimitiveType
-
isOtherType
public boolean isOtherType()
-
getTypeTag
public int getTypeTag()
-
getGenericInfo
public IlrClass.IlrGenericClassInfo getGenericInfo()
Description copied from interface:IlrClassReturns the generic information about this class, ornullif the class is neither a generic nor an instantiation of a generic class.- Specified by:
getGenericInfoin interfaceIlrClass- Returns:
- Generic information, or
null.
-
-