Package oracle.rules.sdk2.dictionary
Class ChoiceList
java.lang.Object
oracle.rules.sdk2.dictionary.ChoiceList
A ChoiceList provides a hierarchy to the flat array of Strings returned from the
SDK2 getOptions methods.
We use String[] for 3 different purposes:
- pass the flat options from the SDK to the ChoiceList constructor
- return the options for each level in the hierarchy (return of getNextChoices)
- to represent a partial or complete selection from first level to N levels (previousSelections) (List<String&rt; is also provided for convenience)
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringflattenSelection(String... previousSelections) get a Selection String suitable for SDK2 set value methods.static StringflattenSelection(List<String> previousSelections) String[]Just a convenient wrapper forgetNextChoices(String[])String[]getNextChoices(String flatSelection) Get the next level of choices given the previous selections, in order of first to last level.String[]getNextChoices(String... previousSelections) String[]getNextChoices(List<String> previousSelections) String[]getSelectionByIndex(int index) Given an index of a selection from an SDK2 option list, get the parsed selection from this ChoiceListbooleanisSelectionComplete(String... previousSelections) is the selection a complete selection?booleanisSelectionComplete(List<String> previousSelections) parseSelection(String selection) parse a Selection String into String[] with '.' a delimiter.
-
Constructor Details
-
ChoiceList
-
-
Method Details
-
getNextChoices
Get the next level of choices given the previous selections, in order of first to last level. returns String[0], String[2], String[3], .. -
getNextChoices
-
getNextChoices
-
flattenSelection
get a Selection String suitable for SDK2 set value methods. For example, using a UI we have previously selected 2 levels "String" and "match" from TargetOptions.To set the Target: action.setTarget(ChoiceList.flattenSelection("String", "match"))
- Parameters:
previousSelections-- Returns:
- flattened selection
-
flattenSelection
-
parseSelection
parse a Selection String into String[] with '.' a delimiter. For example, "String.match" becomes {"String", "match"}- Parameters:
selection-- Returns:
- arrayized selection
-
getFirstChoices
Just a convenient wrapper forgetNextChoices(String[])- Returns:
- first level of choices
-
isSelectionComplete
is the selection a complete selection? Note the selection can be complete and not be a leaf. This method could be used to render complete selections in bold face in the UI.- Parameters:
previousSelections-- Returns:
- completeness or incompleteness of selections
-
isSelectionComplete
-
getSelectionByIndex
Given an index of a selection from an SDK2 option list, get the parsed selection from this ChoiceList- Parameters:
index- of selection from SDK- Returns:
- the selection
-