public interface VerbalChoice extends Choice
VerbalProperty
Sample Usage:
To obtain the display value of a VerbalChoice 'verbalChoice' verbalChoice.getValue(); // This can be used to construct a list of auto-complete suggestions
To construct the editable display value for setting parameters and setting the choice on a VerbalRuleComponent
VerbalChoiceTokenizer vcTokenizer = verbalChoice.getVerbalChoiceTokenizer(); for(int k = 0; k < vcTokenizer.size(); k++) { VerbalChoiceToken token = vcTokenizer.get(k); String tokenValue = token.getValue(); switch(token.getType()){ case VerbalChoiceToken.Type.value: // Render tokenValue using a value editor case VerbalChoiceToken.Type.variable: // Render tokenValue using a variable chooser case VerbalChoiceToken.Type.expression: // Render tokenValue using an expression editor case VerbalChoiceToken.Type.text: // Render as Text uiComponentMap.put(uiComponent, token); } } verbalRuleComponent.setValue(verbalChoice);
To set the value of a required parameter in the VerbalChoice VerbalChoiceToken token = uiComponentMap.get(uiComponent); token.setValue(uiComponent.getValue());
To Add an Expression in the VerbalChoice for the [in] operator verbalChoice.addExpression(value);
To Remove an Expression from the VerbalChoice for the [in] operator VerbalChoiceToken token = uiComponentMap.get(uiComponent); verbalChoice.removeExpression(token);
Choice.Kind
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
VERBAL_CHOICE_EXPR
Place holder translated property for expressions
|
static java.lang.String |
VERBAL_CHOICE_TYPE
Place holder translated property for expressions
|
static java.lang.String |
VERBAL_CHOICE_VAR
Place holder translated property for variables
|
Modifier and Type | Method and Description |
---|---|
void |
addExpression(Choice value)
Adds an Expression to the VerbalChoice if and only if
VerbalChoice.canAddExpression() is true. |
void |
addExpression(java.lang.String value)
Adds an Expression to the VerbalChoice if and only if
VerbalChoice.canAddExpression() is true. |
boolean |
canAddExpression()
Can be used to check if Expressions can be added to this VerbalChoice
|
boolean |
canRemoveExpression(VerbalChoiceToken token)
Can be used to check if Expressions can be removed from this VerbalChoice
|
java.util.List<VerbalChoice> |
getSimilarChoices()
A list of VerbalChoices that are similar to this choice.
|
VerbalChoiceTokenizer |
getVerbalChoiceTokenizer()
Get a tokenizer to compute the display value of the VerbalChoice.
|
boolean |
hasParameters()
Check if the VerbalChoice has any required parameters
|
boolean |
isNewDefinition()
Does this VerbalChoice represent a new Definition
|
void |
removeExpression(VerbalChoiceToken token)
Removes an expression from the VerbalChoice if and only if
VerbalChoice.canRemoveExpression(oracle.rules.sdk2.dictionary.VerbalChoiceToken) is true and there are more than two Expressions. |
getAltValue, getChildren, getDefinition, getDescription, getDescription, getID, getKind, getListContentType, getListContentType, getListContentTypeID, getLiteralValue, getName, getName, getParent, getTranslatedName, getTranslatedValue, getTranslatedValue, getType, getType, getTypeID, getValue, getValue, getVerbalValue, getVerbalValue, isAssignable, isAssignablePrefix, isExpanded, isGlobal, isQualified, isSelectable, isStatic, isTestable
static final java.lang.String VERBAL_CHOICE_EXPR
static final java.lang.String VERBAL_CHOICE_TYPE
static final java.lang.String VERBAL_CHOICE_VAR
VerbalChoiceTokenizer getVerbalChoiceTokenizer()
void addExpression(java.lang.String value)
VerbalChoice.canAddExpression()
is true. Else, this is a no-op. Adding an Expression resets the VerbalChoice. To obtain the new display value for the VerbalChoice, MUST iterate through the VerbalChoiceTokenizer
from the beginningvalue
- Expression Valuevoid addExpression(Choice value)
VerbalChoice.canAddExpression()
is true. Else, this is a no-op. Adding an Expression resets the VerbalChoice. To obtain the new display value for the VerbalChoice, MUST iterate through the VerbalChoiceTokenizer
from the beginningvalue
- Choice representing the Expression Valuevoid removeExpression(VerbalChoiceToken token)
VerbalChoice.canRemoveExpression(oracle.rules.sdk2.dictionary.VerbalChoiceToken)
is true and there are more than two Expressions. Else, this is a no-op. Removing an Expression resets the VerbalChoice. To obtain the new display value for the VerbalChoice, MUST iterate through the VerbalChoiceTokenizer
from the beginningtoken
- Token representing the Expression to be removedboolean canAddExpression()
boolean canRemoveExpression(VerbalChoiceToken token)
token
- Token representing the Expression to be removedboolean hasParameters()
java.util.List<VerbalChoice> getSimilarChoices()
boolean isNewDefinition()