Skip navigation links

Oracle Business Rules Java API Reference
10g (10.1.3.1.0)

B28966-01


oracle.rules.sdk.editor.datamodel
Class Function

java.lang.Object
  extended byjava.util.AbstractMap
      extended byjava.util.HashMap
          extended byoracle.rules.sdk.editor.datamodel.ModelComponent
              extended byoracle.rules.sdk.editor.datamodel.Function

All Implemented Interfaces:
java.lang.Cloneable, java.util.Map, java.io.Serializable

public class Function
extends ModelComponent

Represent a RL function

See Also:
Serialized Form

Field Summary
static java.lang.String PROP_ALLOW_CHAINING
           
static java.lang.String PROP_BODY
           
static java.lang.String PROP_BUILT_IN
           
static java.lang.String PROP_EXCEPTIONS
           
static java.lang.String PROP_FORMAL_PARAMETER_TABLE
           
static java.lang.String PROP_RETURN_TYPE
           

 

Fields inherited from class oracle.rules.sdk.editor.datamodel.ModelComponent
PROP_ALIAS, PROP_ID, PROP_NAME, PROP_PROPERTIES, PROP_VISIBLE

 

Method Summary
 java.lang.Object get(java.lang.Object key)
          Overwrite hashtable get method.
 boolean getAllowChaining()
          Allow expression chaining, e.g. foo().bar().
 java.lang.String getBody()
          Get function body: only support RL Text body
 java.lang.String[] getExceptions()
          Get all the exceptions of the function
 FormalParameter[] getFormalParameters()
          Get all the formal parameters of the function
 FormalParameterTable getFormalParameterTable()
          Get all the parameters of the function
 boolean getIsBuiltIn()
          Whether the funtion is a RL built-in function or user-defined function
 java.lang.String getReturnType()
          Get alias of the return type of the function.
 java.lang.String[] getReturnTypeOptions()
          Get RL function return type options.
 int getReturnTypeSelected()
          Get the index of the selected value for the return type options.
 boolean isReturnTypePrimitive()
          Whether the return type of the function is primitive (i.e. int, char, double etc.)?
 java.lang.Object put(java.lang.Object key, java.lang.Object value)
          Overwrite hashtable put method.
 void setAllowChaining(boolean allowChaining)
          Set to allow the return value of the function to be chained to make up new expressions
 void setBody(java.lang.String body)
          Set function body
 void setExceptions(java.lang.String[] exps)
          Set all the exceptions of the function
 void setReturnType(java.lang.String returnTypeAlias)
          Set the return type of the function.
 void validate()
          validate consistency of the function definition

 

Methods inherited from class oracle.rules.sdk.editor.datamodel.ModelComponent
getAlias, getDataModel, getID, getName, getParent, getProperties, getVisible, setAlias, setName, setVisible

 

Methods inherited from class java.util.HashMap
clear, clone, containsKey, containsValue, entrySet, isEmpty, keySet, putAll, remove, size, values

 

Methods inherited from class java.util.AbstractMap
equals, hashCode, toString

 

Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait

 

Methods inherited from interface java.util.Map
equals, hashCode

 

Field Detail

PROP_BUILT_IN

public static final java.lang.String PROP_BUILT_IN
See Also:
Constant Field Values

PROP_RETURN_TYPE

public static final java.lang.String PROP_RETURN_TYPE
See Also:
Constant Field Values

PROP_FORMAL_PARAMETER_TABLE

public static final java.lang.String PROP_FORMAL_PARAMETER_TABLE
See Also:
Constant Field Values

PROP_EXCEPTIONS

public static final java.lang.String PROP_EXCEPTIONS
See Also:
Constant Field Values

PROP_BODY

public static final java.lang.String PROP_BODY
See Also:
Constant Field Values

PROP_ALLOW_CHAINING

public static final java.lang.String PROP_ALLOW_CHAINING
See Also:
Constant Field Values

Method Detail

getIsBuiltIn

public boolean getIsBuiltIn()
Whether the funtion is a RL built-in function or user-defined function
Returns:
true if the funtion is a RL built-in function

getReturnType

public java.lang.String getReturnType()
Get alias of the return type of the function. Note void is a special FactType.
Returns:
alias of the return type of the function.

setReturnType

public void setReturnType(java.lang.String returnTypeAlias)
Set the return type of the function.
Parameters:
returnTypeAlias - alias of the return type of the function.

getReturnTypeOptions

public java.lang.String[] getReturnTypeOptions()
Get RL function return type options.
Returns:
the list of fact type alias includeing primitive, RL and Java Fact types

getReturnTypeSelected

public int getReturnTypeSelected()
Get the index of the selected value for the return type options.
Returns:
the index of the selected value for the return type choice list

getFormalParameterTable

public FormalParameterTable getFormalParameterTable()
Get all the parameters of the function
Returns:
The list of parameters of the funciton.

getFormalParameters

public FormalParameter[] getFormalParameters()
Get all the formal parameters of the function
Returns:
all the formal parameters of the function

getExceptions

public java.lang.String[] getExceptions()
Get all the exceptions of the function
Returns:
The list of exceptions of the function.

setExceptions

public void setExceptions(java.lang.String[] exps)
Set all the exceptions of the function
Parameters:
exps - The list of exceptions of the function.

getBody

public java.lang.String getBody()
Get function body: only support RL Text body
Returns:
Body of the function

setBody

public void setBody(java.lang.String body)
Set function body
Parameters:
body - A string represeting body of the function

isReturnTypePrimitive

public boolean isReturnTypePrimitive()
Whether the return type of the function is primitive (i.e. int, char, double etc.)?
Returns:
true if return type is primitive; false if return type is java or RL class

getAllowChaining

public boolean getAllowChaining()
Allow expression chaining, e.g. foo().bar(). It only applies to the functions having complex return type. In another word, if the return type of the function is primitive, this method always return false.
Returns:
true to indicate the return value of the method can be chained to make up new expressions

setAllowChaining

public void setAllowChaining(boolean allowChaining)
Set to allow the return value of the function to be chained to make up new expressions
Parameters:
allowChaining - true indicates that the return value of the function can be chained to make up new expressions

validate

public void validate()
              throws RulesSDKDMValidationException
validate consistency of the function definition
Overrides:
validate in class ModelComponent
Throws:
thrown - if any of the following happens (1)no return type defined (2)return type is not defined in datamodel (3)no function body (4) two parameters have the same name (5) Alias is conflicted with other functions
RulesSDKDMValidationException

get

public java.lang.Object get(java.lang.Object key)
Overwrite hashtable get method. For property "ReturnType", "ReturnType_Selected", ReturnType_Options we don't return the hashtable entry directly. Instead, we compute them dynamically.
Specified by:
get in interface java.util.Map
Overrides:
get in class ModelComponent
Parameters:
key - a String containing the property name to be fetched.
Returns:
the value corresponding to the key

put

public java.lang.Object put(java.lang.Object key,
                            java.lang.Object value)
Overwrite hashtable put method. For property "ReturnType" we don't put the value (alias) directly. We get id of the type from alias, then put it into the table.
Parameters:
key - a String containing the property name to be saved.
value - a String corresponding to the key to be saved

Skip navigation links

Oracle Business Rules Java API Reference
10g (10.1.3.1.0)

B28966-01


Copyright © 2006, Oracle. All rights reserved.