Rule Execution Server API

ilog.rules.factory.translation
Class IlrClassTranslation

java.lang.Object
  extended by ilog.rules.factory.translation.IlrClassTranslation
All Implemented Interfaces:
Serializable

public class IlrClassTranslation
extends Object
implements Serializable

Class translation. It refers to a business class getBusinessName(). It may refer to a execution class getExecutionName(). It may refer to an extension class getExtenderName(). It may provide a tester getTester(). It may provide translations for its members.

Since:
JRules 6.0
See Also:
Serialized Form

Constructor Summary
IlrClassTranslation()
           
 
Method Summary
 void addAttribute(IlrAttributeTranslation attribute)
          Adds a translation for an attribute.
 void addConstructor(IlrConstructorTranslation constructor)
          Adds a constructor translation.
 void addImport(String importStatement)
          Adds an import statement.
 void addMethod(IlrMethodTranslation method)
          Adds a method translation.
 IlrAttributeTranslation getAttribute(String name)
          Gets an attribute translation.
 Iterator getAttributes()
          Returns an iterator over all attribute translations.
 String getBusinessName()
          Returns the business class name.
 IlrTranslationConstants.CaseSensitivity getCaseSensitivity()
          Gets the global case sensitivity for this class member's lookup.
 IlrConstructorTranslation getConstructor(String signature)
          Returns a constructor translation.
 List getConstructors()
          Returns the list of constructor translations.
 String getExecutionName()
          Gets the execution class name.
 String getExtenderName()
          Gets the extender class name.
 List getImports()
          Returns the list of import statements.
 IlrMethodTranslation getMethod(String name, String signature)
          Returns a method translation.
 List getMethods(String name)
          Returns the list of method translations for a given method name.
 IlrBody getTester()
          Returns the tester for the business class.
 boolean isTranslated()
          Returns true if the class is to be translated.
 boolean removeAttribute(IlrAttributeTranslation attribute)
          Removes an attribute translation.
 boolean removeAttribute(String name)
          Removes an attribute translation.
 boolean removeConstructor(IlrConstructorTranslation constructor)
          Removes a constructor translation.
 boolean removeConstructor(String signature)
          Removes a constructor translation.
 void removeMethod(IlrMethodTranslation method)
          Removes a method translation.
 boolean removeMethod(String name, String signature)
          Removes a method translation.
 void setBusinessName(String businessName)
          Sets the business class name.
 void setCaseSensitivity(IlrTranslationConstants.CaseSensitivity caseSensitivity)
          Sets the case sensitivity for this class member's lookup.
 void setExecutionName(String executionName)
          Sets the execution class name.
 void setExtenderName(String extenderName)
          Sets the extender class name.
 void setImports(List imports)
          Sets the list of import statements.
 void setTester(IlrBody tester)
          Sets the tester for the business class.
 void setTranslated(boolean translated)
          Sets whether this class should be translated or not.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IlrClassTranslation

public IlrClassTranslation()
Method Detail

getBusinessName

public String getBusinessName()
Returns the business class name.

Returns:
The business class name. It cannot be null.

setBusinessName

public void setBusinessName(String businessName)
Sets the business class name.

Parameters:
businessName - The business class name. It cannot be null.

getExecutionName

public String getExecutionName()
Gets the execution class name.

Returns:
The execution class name. It may be null. In this case, the translator will use the business class name as the execution name.

setExecutionName

public void setExecutionName(String executionName)
Sets the execution class name.

Parameters:
executionName - The execution class name. It may be null. In this case, the translator will use the business class name as the execution name.

getExtenderName

public String getExtenderName()
Gets the extender class name.

Returns:
The extender class name. It may be null. In this case, it means there is no extender class.

setExtenderName

public void setExtenderName(String extenderName)
Sets the extender class name.

Parameters:
extenderName - The extender class name. It may be null. In this case, it means there is no extender class.

isTranslated

public boolean isTranslated()
Returns true if the class is to be translated. A class that is not translated will not produce errors when translations are checked, but will produce an error if it is used in a ruleset being translated.

Since:
JRules 6.1

setTranslated

public void setTranslated(boolean translated)
Sets whether this class should be translated or not.

Since:
JRules 6.1

setCaseSensitivity

public void setCaseSensitivity(IlrTranslationConstants.CaseSensitivity caseSensitivity)
Sets the case sensitivity for this class member's lookup.

Since:
JRules 6.1

getCaseSensitivity

public IlrTranslationConstants.CaseSensitivity getCaseSensitivity()
Gets the global case sensitivity for this class member's lookup. It may be null. In this case, the case sensitivity of the whole translation configuration applies.

Since:
JRules 6.1

addImport

public void addImport(String importStatement)
Adds an import statement. An import statement can refer to a class, such as java.util.Map, or to a whole package, such as java.util.*.

Parameters:
importStatement - An import statement.

getImports

public List getImports()
Returns the list of import statements.

Returns:
The list of import statements.
See Also:
for a description of the import statement.

setImports

public void setImports(List imports)
Sets the list of import statements.

Parameters:
imports - The list of import statements.
See Also:
for a description of the import statement.

getTester

public IlrBody getTester()
Returns the tester for the business class. The tester is the body of a function used to test if an object is an instance of the business class. Inside the tester, this can be used to refer to the object being tested.

Returns:
The tester for the business class. In can be null. In this case, it means that instances of the execution class will be considered as instances of the business class.

setTester

public void setTester(IlrBody tester)
Sets the tester for the business class.

Parameters:
tester - The tester.
See Also:
for an explanation of testers.

addAttribute

public void addAttribute(IlrAttributeTranslation attribute)
Adds a translation for an attribute.

Parameters:
attribute - The attribute translation.

removeAttribute

public boolean removeAttribute(String name)
Removes an attribute translation.

Parameters:
name - The name of the attribute.
Returns:
true if the attribute translation was removed.

removeAttribute

public boolean removeAttribute(IlrAttributeTranslation attribute)
Removes an attribute translation.

Parameters:
attribute - The attribute translation.
Returns:
true if the attribute translation was removed.

getAttribute

public IlrAttributeTranslation getAttribute(String name)
Gets an attribute translation.

Parameters:
name - The name of the attribute.
Returns:
The attribute translation. It may be null.

getAttributes

public Iterator getAttributes()
Returns an iterator over all attribute translations.

Returns:
An iterator over all attribute translations.

addMethod

public void addMethod(IlrMethodTranslation method)
Adds a method translation.

Parameters:
method - The method translation.

removeMethod

public boolean removeMethod(String name,
                            String signature)
Removes a method translation.

Parameters:
name - The method name.
signature - The method signature.
Returns:
true if the method was removed.

removeMethod

public void removeMethod(IlrMethodTranslation method)
Removes a method translation.

Parameters:
method - The method translation.

getMethods

public List getMethods(String name)
Returns the list of method translations for a given method name.

Parameters:
name - The name of the methods.
Returns:
The list of method translations.

getMethod

public IlrMethodTranslation getMethod(String name,
                                      String signature)
Returns a method translation.

Parameters:
name - The method name.
signature - The method signature. The signature of the method follows the syntax described in IlrMemberWithParametersTranslation.getSignature().
Returns:
The method translation. If name does not contain any methods, null is returned.

addConstructor

public void addConstructor(IlrConstructorTranslation constructor)
Adds a constructor translation.

Parameters:
constructor - The constructor translation.

removeConstructor

public boolean removeConstructor(String signature)
Removes a constructor translation.

Parameters:
signature - The signature of the constructor.
Returns:
true if the constructor translation was removed.

removeConstructor

public boolean removeConstructor(IlrConstructorTranslation constructor)
Removes a constructor translation.

Parameters:
constructor - The constructor translation to be removed.
Returns:
true if the constructor translation was removed.

getConstructors

public List getConstructors()
Returns the list of constructor translations.

Returns:
The list of constructor translations.

getConstructor

public IlrConstructorTranslation getConstructor(String signature)
Returns a constructor translation.

Parameters:
signature - The signature of the constructor. This parameter must follow the syntax described in IlrMemberWithParametersTranslation.getSignature().
Returns:
The constructor translation. This method may return null.

Rule Execution Server API

© Copyright IBM Corp. 1987, 2013