ilog.rules.bom.dynamic

Class IlrDynamicClass

    • Method Detail

      • addClass

        public IlrDynamicClass addClass(java.lang.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 java.lang.Class getNativeClass()
        Returns the native class represented by this IlrType or null.
        Specified by:
        getNativeClass in interface IlrType
      • 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:
        getName in interface IlrModelElement
        Overrides:
        getName in class IlrDynamicModelElement
        Returns:
        a character string or null.
      • getRawName

        public java.lang.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
      • 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.
      • 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 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 null or an empty list.

        Specified by:
        getNestedClasses in interface IlrClass
      • getClass

        public IlrClass getClass(java.lang.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
      • getClasses

        public java.util.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 java.util.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 java.util.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
      • 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 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 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 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
      • 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 null or an empty list.

        Specified by:
        getAttributes in interface IlrClass
        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 null or an empty list.

        Specified by:
        getComponentProperties in interface IlrClass
        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 null or an empty list.

        Specified by:
        getIndexedComponentProperties in interface IlrClass
        See Also:
        IlrIndexedComponentProperty
      • 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, 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 java.util.Iterator allSuperclasses()
        Returns an iterator over the transitive closure of superclasses and superinterfaces of this class.
        Specified by:
        allSuperclasses in interface IlrClass
      • 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:
        allMethods in interface IlrClass
      • 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:
        allAttributes in interface IlrClass
      • 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:
        allComponentProperties in interface IlrClass
      • 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:
        allIndexedComponentProperties in interface IlrClass
      • interfaces

        public java.util.Iterator interfaces()
        Returns an iterator over the direct superinterfaces of this class.
        Specified by:
        interfaces in interface IlrClass
      • allInterfaces

        public java.util.Iterator allInterfaces()
        Returns an iterator over the transitive closure of superinterfaces of this class.
        Specified by:
        allInterfaces in interface IlrClass
      • members

        public java.util.Iterator members()
        Returns an iterator over all declared members (attributes, constructors and methods) of this class.
        Specified by:
        members in interface IlrClass
      • allMembers

        public java.util.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(java.lang.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(java.lang.String name,
                          java.util.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(java.lang.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(java.lang.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(java.lang.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.
      • 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.

© Copyright IBM Corp. 1987, 2015