Rule Execution Server API

ilog.rules.bom.dynamic
Class IlrDynamicModelFactory

java.lang.Object
  extended by ilog.rules.bom.dynamic.IlrDynamicModelFactory
All Implemented Interfaces:
IlrModelFactory

public class IlrDynamicModelFactory
extends Object
implements IlrModelFactory

Factory implementation for building an object model.

Since:
JRules 5.0

Constructor Summary
IlrDynamicModelFactory()
          Creates an object model factory.
 
Method Summary
 IlrMutableActualValue createActualValue()
          Creates an actual value.
 IlrMutableClass createArrayClass(IlrType componentType)
           
 IlrMutableAttribute createAttribute(IlrMutableClass aClass, Field field)
          Creates a attribute from a native field.
 IlrMutableAttribute createAttribute(IlrMutableClass aClass, String name)
          Creates an attribute.
 IlrMutableClass createBoundClass(IlrClass genericType, IlrType[] typeParameters)
           
 IlrMutableBoundedDomain createBoundedDomain()
          Creates a bounded domain.
 IlrMutableMethod createBoundMethod(IlrMethod genericMethod, IlrType[] typeParameters)
           
 IlrMutableClass createClass(Class aClass)
          Creates a class from a native class.
 IlrMutableClass createClass(IlrMutablePackage parentPackage, String className)
          Creates a class in a package.
 IlrMutableClass createClass(String className)
          Creates a class using an absolute name.
 IlrMutableComponentProperty createComponentProperty(IlrMutableClass aClass, PropertyDescriptor descriptor)
          Creates a component property from a native property.
 IlrMutableComponentProperty createComponentProperty(IlrMutableClass aClass, String name)
          Creates a component property.
 IlrMutableConstructor createConstructor(IlrMutableClass aClass)
          Creates a constructor.
 IlrMutableConstructor createConstructor(IlrMutableClass aClass, Constructor constructor)
          Creates a constructor from a native constructor.
 IlrMutableDomainIntersection createDomainIntersection()
          Creates a domain intersection.
 IlrMutableType createEnum(IlrMutablePackage parentPackage, String name)
          Creates an enum.
 IlrDomain createEnumeratedDomain(List values)
          Creates an enumerated domain.
 IlrMutableClass createGenericDefinition(Class clazz, IlrMutableTypeVariable[] typeParameters)
           
 IlrMutableClass createGenericDefinition(IlrMutablePackage pkg, String className, IlrMutableTypeVariable[] typeParameters)
           
 IlrMutableClass createGenericDefinition(String className, IlrMutableTypeVariable[] typeParameters)
           
 IlrMutableIndexedComponentProperty createIndexedComponentProperty(IlrMutableClass aClass, IndexedPropertyDescriptor descriptor)
          Creates an indexed component property from a native indexed property.
 IlrMutableIndexedComponentProperty createIndexedComponentProperty(IlrMutableClass aClass, String name)
          Creates an indexed component property.
 IlrMutableMethod createMethod(IlrMutableClass aClass, Method method)
          Creates a method from a native method.
 IlrMutableMethod createMethod(IlrMutableClass aClass, String methodName)
          Creates a method.
 IlrMutableClass createNestedClass(IlrMutableClass parentClass, String className)
          Creates a nested class, that is, a class in a class.
 IlrMutableClass createNestedGenericDefinition(IlrMutableClass parentClass, String className, IlrMutableTypeVariable[] typeParameters)
           
 IlrMutablePackage createPackage(IlrMutablePackage parentPackage, String relativeName)
          Creates or retrieves a package using a relative name.
 IlrMutablePackage createPackage(String name)
          Creates or retrieves a package using an absolute name.
 IlrMutableParameter createParameter(IlrMutableMemberWithParameter member, String parameterName, IlrType type)
          Creates a parameter.
 IlrMutableParameter createParameter(String parameterName, IlrType type)
          Creates a parameter.
 IlrMutablePatternDomain createPatternDomain()
          Creates a pattern domain.
 IlrProperties createProperties()
          Creates properties to be used as nested properties.
 IlrMutableClass createRawClass(Class clazz)
           
 IlrMutableMethod createRawMethod(IlrMethod genericMethod)
           
 IlrMutableAttribute createRestrictedAttribute(IlrMutableClass aClass, IlrAttribute originAttribute)
          Creates a restricted attribute.
 IlrMutableStaticReference createStaticReference(String name)
          Creates a static reference.
 IlrMutableTypeVariable createTypeVariable(String name)
          Creates a type variable.
 IlrWildcardType createWildcardType()
          Creates a wild card type.
 IlrMutableObjectModel getOrCreateModel()
          Returns a mutable object model, creates one if needed.
 
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.IlrModelFactory
createCollectionDomain
 

Constructor Detail

IlrDynamicModelFactory

public IlrDynamicModelFactory()
Creates an object model factory.

Method Detail

getOrCreateModel

public IlrMutableObjectModel getOrCreateModel()
Returns a mutable object model, creates one if needed.

Specified by:
getOrCreateModel in interface IlrModelFactory
Returns:
A mutable object model.

createNestedClass

public IlrMutableClass createNestedClass(IlrMutableClass parentClass,
                                         String className)
Creates a nested class, that is, a class in a class.

Specified by:
createNestedClass in interface IlrModelFactory
Parameters:
parentClass - The class that will contain a new class.
className - The class name. It cannot contain '.' separators.
Returns:
The newly created class.

createClass

public IlrMutableClass createClass(IlrMutablePackage parentPackage,
                                   String className)
Creates a class in a package.

Specified by:
createClass in interface IlrModelFactory
Parameters:
parentPackage - The package that will contain the new class.
className - The class name. It cannot contain '.' separators.
Returns:
The newly created class.

createClass

public IlrMutableClass createClass(String className)
Creates a class using an absolute name.

Specified by:
createClass in interface IlrModelFactory
Parameters:
className - The class name. It may contain '.' separators.
Returns:
The created class.

createArrayClass

public IlrMutableClass createArrayClass(IlrType componentType)
Specified by:
createArrayClass in interface IlrModelFactory

createGenericDefinition

public IlrMutableClass createGenericDefinition(String className,
                                               IlrMutableTypeVariable[] typeParameters)
Specified by:
createGenericDefinition in interface IlrModelFactory

createGenericDefinition

public IlrMutableClass createGenericDefinition(IlrMutablePackage pkg,
                                               String className,
                                               IlrMutableTypeVariable[] typeParameters)
Specified by:
createGenericDefinition in interface IlrModelFactory

createNestedGenericDefinition

public IlrMutableClass createNestedGenericDefinition(IlrMutableClass parentClass,
                                                     String className,
                                                     IlrMutableTypeVariable[] typeParameters)
Specified by:
createNestedGenericDefinition in interface IlrModelFactory

createGenericDefinition

public IlrMutableClass createGenericDefinition(Class clazz,
                                               IlrMutableTypeVariable[] typeParameters)
Specified by:
createGenericDefinition in interface IlrModelFactory

createBoundClass

public IlrMutableClass createBoundClass(IlrClass genericType,
                                        IlrType[] typeParameters)
Specified by:
createBoundClass in interface IlrModelFactory

createRawClass

public IlrMutableClass createRawClass(Class clazz)
Specified by:
createRawClass in interface IlrModelFactory

createClass

public IlrMutableClass createClass(Class aClass)
Creates a class from a native class.

Specified by:
createClass in interface IlrModelFactory
Parameters:
aClass - The native class.
Returns:
A newly created class referencing a native class.

createAttribute

public IlrMutableAttribute createAttribute(IlrMutableClass aClass,
                                           String name)
Creates an attribute.

Specified by:
createAttribute in interface IlrModelFactory
Parameters:
aClass - The declaring class of the attribute.
name - The name of the attribute.
Returns:
The newly created attribute.

createRestrictedAttribute

public IlrMutableAttribute createRestrictedAttribute(IlrMutableClass aClass,
                                                     IlrAttribute originAttribute)
Creates a restricted attribute.

Specified by:
createRestrictedAttribute in interface IlrModelFactory
Parameters:
aClass - The declaring class of the attribute.
originAttribute - The origin attribute.
Returns:
The newly created restricted attribute.
See Also:
ilog.rules.bom.IlrAttribute.isRestriction()

createConstructor

public IlrMutableConstructor createConstructor(IlrMutableClass aClass)
Creates a constructor.

Specified by:
createConstructor in interface IlrModelFactory
Parameters:
aClass - The declaring class of the constructor.
Returns:
The newly created constructor.

createBoundedDomain

public IlrMutableBoundedDomain createBoundedDomain()
Creates a bounded domain. To be completed by calling IlrMutableBoundedDomain methods.

Specified by:
createBoundedDomain in interface IlrModelFactory
Returns:
The newly created bounded domain.

createEnumeratedDomain

public IlrDomain createEnumeratedDomain(List values)
Creates an enumerated domain.

Specified by:
createEnumeratedDomain in interface IlrModelFactory
Parameters:
values - The values of the enumeration.
Returns:
The newly created enumerated domain.

createDomainIntersection

public IlrMutableDomainIntersection createDomainIntersection()
Creates a domain intersection. To be completed by calling IlrMutableDomainIntersection methods.

Specified by:
createDomainIntersection in interface IlrModelFactory
Returns:
The newly created domain intersection.

createMethod

public IlrMutableMethod createMethod(IlrMutableClass aClass,
                                     String methodName)
Creates a method.

Specified by:
createMethod in interface IlrModelFactory
Parameters:
aClass - The declaring class of the method.
Returns:
The newly created method.

createBoundMethod

public IlrMutableMethod createBoundMethod(IlrMethod genericMethod,
                                          IlrType[] typeParameters)
Specified by:
createBoundMethod in interface IlrModelFactory

createRawMethod

public IlrMutableMethod createRawMethod(IlrMethod genericMethod)
Specified by:
createRawMethod in interface IlrModelFactory

createPackage

public IlrMutablePackage createPackage(String name)
Creates or retrieves a package using an absolute name.

Specified by:
createPackage in interface IlrModelFactory
Parameters:
name - An absolute name with '.' separators. All the intermediary packages are created if needed.
Returns:
The created or retrieved package.

createPackage

public IlrMutablePackage createPackage(IlrMutablePackage parentPackage,
                                       String relativeName)
Creates or retrieves a package using a relative name.

Specified by:
createPackage in interface IlrModelFactory
Parameters:
parentPackage - The parent package in which the package will be created.
relativeName - The name of the package to create relative to the parent package. The name may contain '.' separators. In this case, the intermediate packages are created as needed. If the relativeName is null or " ", the parentPackage is returned.
Returns:
The created or retrieved package.

createParameter

public IlrMutableParameter createParameter(IlrMutableMemberWithParameter member,
                                           String parameterName,
                                           IlrType type)
Creates a parameter.

Specified by:
createParameter in interface IlrModelFactory
Parameters:
member - The member parametrized by the new parameter.
parameterName - The parameter name.
type - The type of the parameter.
Returns:
The newly created parameter.
See Also:
IlrMethod, IlrIndexedComponentProperty

createParameter

public IlrMutableParameter createParameter(String parameterName,
                                           IlrType type)
Creates a parameter. The created parameter is not related to a member. To register it in a member, you have to call both IlrMutableParameter.setDeclaringMember(ilog.rules.bom.IlrMemberWithParameter) and IlrMutableMemberWithParameter.addParameter(ilog.rules.bom.IlrParameter), or IlrMutableMemberWithParameter.setParameters(java.util.List).

Specified by:
createParameter in interface IlrModelFactory
Parameters:
parameterName - The parameter name.
type - The type of the parameter.
Returns:
The newly created parameter.
See Also:
IlrMutableMemberWithParameter

createProperties

public IlrProperties createProperties()
Creates properties to be used as nested properties.

Specified by:
createProperties in interface IlrModelFactory
Returns:
Newly created properties.

createStaticReference

public IlrMutableStaticReference createStaticReference(String name)
Creates a static reference.

Specified by:
createStaticReference in interface IlrModelFactory
Parameters:
name - The name of the static reference.
Returns:
A newly created static reference.

createActualValue

public IlrMutableActualValue createActualValue()
Creates an actual value.

Specified by:
createActualValue in interface IlrModelFactory
Returns:
A newly created actual value.

createPatternDomain

public IlrMutablePatternDomain createPatternDomain()
Creates a pattern domain. To be completed by calling IlrMutablePatternDomain methods.

Specified by:
createPatternDomain in interface IlrModelFactory
Returns:
The newly created pattern domain.

createEnum

public IlrMutableType createEnum(IlrMutablePackage parentPackage,
                                 String name)
Creates an enum.

Specified by:
createEnum in interface IlrModelFactory
Parameters:
parentPackage - The package that will contain the new enum.
name - The enum name. It cannot contain '.' separators.
Returns:
A newly created enum.

createAttribute

public IlrMutableAttribute createAttribute(IlrMutableClass aClass,
                                           Field field)
Creates a attribute from a native field.

Specified by:
createAttribute in interface IlrModelFactory
Parameters:
aClass - The declaring class. It has to be the class referencing the native class declaring the native field.
field - The native field.
Returns:
A newly created attribute referencing a native field.

createConstructor

public IlrMutableConstructor createConstructor(IlrMutableClass aClass,
                                               Constructor constructor)
Creates a constructor from a native constructor.

Specified by:
createConstructor in interface IlrModelFactory
Parameters:
aClass - The declaring class. It has to be the class referencing the native class declaring the native constructor.
constructor - The native constructor.
Returns:
A newly created constructor referencing a native constructor.

createMethod

public IlrMutableMethod createMethod(IlrMutableClass aClass,
                                     Method method)
Creates a method from a native method.

Specified by:
createMethod in interface IlrModelFactory
Parameters:
aClass - The declaring class. It has to be the class referencing the native class declaring the native method.
method - The native method.
Returns:
A newly created method referencing a native method.

createTypeVariable

public IlrMutableTypeVariable createTypeVariable(String name)
Creates a type variable.

Specified by:
createTypeVariable in interface IlrModelFactory
Since:
JRules 6.0
Parameters:
name - The name of the variable.

createWildcardType

public IlrWildcardType createWildcardType()
Creates a wild card type.

Specified by:
createWildcardType in interface IlrModelFactory
Since:
JRules 6.0

createComponentProperty

public IlrMutableComponentProperty createComponentProperty(IlrMutableClass aClass,
                                                           String name)
Creates a component property.

Specified by:
createComponentProperty in interface IlrModelFactory
Parameters:
aClass - The declaring class of the component property.
name - The name of the component property.
Returns:
The newly created component property.

createIndexedComponentProperty

public IlrMutableIndexedComponentProperty createIndexedComponentProperty(IlrMutableClass aClass,
                                                                         String name)
Creates an indexed component property.

Specified by:
createIndexedComponentProperty in interface IlrModelFactory
Parameters:
aClass - The declaring class of the indexed component property.
name - The name of the indexed component property.
Returns:
The newly created indexed component property.

createComponentProperty

public IlrMutableComponentProperty createComponentProperty(IlrMutableClass aClass,
                                                           PropertyDescriptor descriptor)
Creates a component property from a native property.

Specified by:
createComponentProperty in interface IlrModelFactory
Parameters:
aClass - The declaring class. It has to be the class referencing the native class declaring the native property.
descriptor - The native property descriptor.
Returns:
A newly created component property referencing a native property.

createIndexedComponentProperty

public IlrMutableIndexedComponentProperty createIndexedComponentProperty(IlrMutableClass aClass,
                                                                         IndexedPropertyDescriptor descriptor)
Creates an indexed component property from a native indexed property.

Specified by:
createIndexedComponentProperty in interface IlrModelFactory
Parameters:
aClass - The declaring class. It has to be the class referencing the native class declaring the native indexed property.
descriptor - The native indexed property descriptor.
Returns:
A newly created indexed component property referencing a native indexed property.

Rule Execution Server API

© Copyright IBM Corp. 1987, 2013