|
Rule Designer API | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectilog.rules.dt.expression.ExpressionHelper
public class ExpressionHelper
ExpressionHelper provides helper methods used to manipulate
expressions in a DT Model.
| Constructor Summary | |
|---|---|
ExpressionHelper()
|
|
| Method Summary | |
|---|---|
static boolean |
equals(IlrDTExpressionDefinition e1,
IlrDTExpressionDefinition e2,
boolean includeProperties)
Tests if the two given expression definitions are equal. |
static boolean |
equals(IlrDTExpressionInstance e1,
IlrDTExpressionInstance e2,
boolean includeProperties)
Tests if two given expression instances are equal. |
static IlrDecorableElement |
getExpressionElement(IlrDTExpression expr,
int index)
Returns the placeholder or parameter located at a specific index in the given expression. |
static int |
getExpressionElementCount(IlrDTExpression expr)
Returns the number of placeholders in an expression definition or the number of parameters in an expression instance. |
static IlrConcept |
getHolderConcept(IlrDTExpressionText expression)
Returns the concept object of the holder role for a given expression. |
static String |
getHolderText(IlrDTExpressionText expression)
Returns the text of the holder role for the given expression. |
static List<String> |
getParameterDisplayTexts(IlrDTExpressionParameter param)
Returns a list of strings if the given parameter is a collection literal. |
static String |
getParameterTextOrDefaultValue(IlrDTExpressionParameter parameter)
This method returns the parameter text of the given ExpressionParameter. |
static List<String> |
getParameterValues(IlrDTExpressionParameter param)
Returns a list of strings if the given parameter is a collection literal. |
static IlrDTExpressionPlaceHolder |
getPlaceHolderForParameter(IlrDTExpressionParameter param)
Returns the placeholder that corresponds to the given expression parameter. |
static String |
getPlaceHolderLabel(IlrDTExpressionDefinition expr,
int index)
Returns the placeholder label without the < and the
> in the string. |
static boolean |
isAction(IlrDTExpressionDefinition expr)
Tests if the given expression definition represents an action. |
static boolean |
isCollection(IlrDTExpressionParameter param)
Tests if the given parameter stores a collection literal or if it is supposed to store a collection literal. |
static boolean |
isCollection(IlrDTExpressionPlaceHolder placeHolder)
Tests if the given placeholder has a multiple cardinality. |
static boolean |
isExpressionComplete(IlrDTExpressionInstance instance)
Tests if all parameters are nonempty or reference a placeholder that has a nonempty default value. |
static boolean |
isExpressionSentenceMeaningfull(IlrDTExpressionInstance expression)
|
static boolean |
isOtherwise(IlrDTExpression expr)
Tests if the given expression is an Otherwise expression. |
static IlrDTExpressionInstance |
newExpressionInstance(IlrDTExpressionDefinition defExpr,
boolean useDefaultValues)
Creates a new expression instance derived from a given definition. |
static IlrDTExpressionInstance |
newIsExpressionInstance(IlrDTContext dtContext,
String holderRoleText,
String paramText)
Creates a new expression instance using the Object.is()
predicate. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ExpressionHelper()
| Method Detail |
|---|
public static String getPlaceHolderLabel(IlrDTExpressionDefinition expr,
int index)
< and the
> in the string.
expr - The expression definition.index - The index of the placeholder in the given expression
definition.
public static int getExpressionElementCount(IlrDTExpression expr)
expr - The expression to check.
expr, -1 is returned.public static IlrDecorableElement getExpressionElement(IlrDTExpression expr,
int index)
expr - An expression definition or an expression instance.index - The index to find the placeholder or parameter.
index, null is returned.public static boolean isExpressionComplete(IlrDTExpressionInstance instance)
instance - The instance to test.
true is returned.public static boolean isExpressionSentenceMeaningfull(IlrDTExpressionInstance expression)
public static IlrDTExpressionPlaceHolder getPlaceHolderForParameter(IlrDTExpressionParameter param)
param - A non-null expression parameter.
null.public static IlrDTExpressionInstance newExpressionInstance(IlrDTExpressionDefinition defExpr,
boolean useDefaultValues)
useDefaultValues parameter to control if the parameters
in defExpr are replaced with default values in the returned
object.
defExpr - The expression to copy.useDefaultValues - Set to true so that default values are
set as the parameters of the returned expression instance.
public static IlrDTExpressionInstance newIsExpressionInstance(IlrDTContext dtContext,
String holderRoleText,
String paramText)
Object.is()
predicate.
dtContext - The context.holderRoleText - The holder role.paramText - The parameter.
public static boolean isAction(IlrDTExpressionDefinition expr)
expr - The expression definition to test.
expr represents an action, true is
returned.public static boolean isCollection(IlrDTExpressionParameter param)
param - The object to test.
null, or if the corresponding placeholder has a multiple
cardinality, true is returned.public static boolean isCollection(IlrDTExpressionPlaceHolder placeHolder)
placeHolder - The object to test.
placeHolder has a multiple cardinality,
true is returned.public static List<String> getParameterDisplayTexts(IlrDTExpressionParameter param)
param - The parameter to check.
String objects. If the expression is not a
collection literal, null is returned.public static List<String> getParameterValues(IlrDTExpressionParameter param)
param - The parameter to check.
String objects. If the expression is not a
collection literal, null is returned.public static String getParameterTextOrDefaultValue(IlrDTExpressionParameter parameter)
parameter -
public static boolean isOtherwise(IlrDTExpression expr)
expr - The expression to test.
expr is an Otherwise expression,
true is returned.public static String getHolderText(IlrDTExpressionText expression)
expression - The expression.
null is returned.public static IlrConcept getHolderConcept(IlrDTExpressionText expression)
expression - The expression.
public static boolean equals(IlrDTExpressionDefinition e1,
IlrDTExpressionDefinition e2,
boolean includeProperties)
e1 - The first expression definition to test.e2 - The second expression definition to test.includeProperties - Set to true to include the
properties of e1 and e2 in the equality tests.
e1 and e2 are equal,
true is returned.public static boolean equals(IlrDTExpressionInstance e1,
IlrDTExpressionInstance e2,
boolean includeProperties)
e1 - The first expression instance to test.e2 - The second expression instance to test.includeProperties - Set to true to include the
properties of e1 and e2 in the equality tests.
e1 and e2 are equal,
true is returned.
|
Rule Designer API | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||