Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle Business Rules
11g Release 1 (11.1.1)

E10663-02


oracle.rules.sdk2.dictionary
Class ChoiceList

java.lang.Object
  extended by oracle.rules.sdk2.dictionary.ChoiceList


public class ChoiceList
extends java.lang.Object

A ChoiceList provides a hierarchy to the flat array of Strings returned from the SDK2 getOptions methods.

We use String[] for 3 different purposes:

  1. pass the flat options from the SDK to the ChoiceList constructor
  2. return the options for each level in the hierarchy (return of getNextChoices)
  3. to represent a partial or complete selection from first level to N levels (previousSelections) (List<String&rt; is also provided for convenience)

Constructor Summary
ChoiceList(java.lang.String[] optionList)
           

 

Method Summary
static java.lang.String flattenSelection(java.util.List<java.lang.String> previousSelections)
           
static java.lang.String flattenSelection(java.lang.String... previousSelections)
          get a Selection String suitable for SDK2 set value methods.
 java.lang.String[] getFirstChoices()
          Just a convenient wrapper for ChoiceList.getNextChoices(String[])
 java.lang.String[] getNextChoices(java.util.List<java.lang.String> previousSelections)
           
 java.lang.String[] getNextChoices(java.lang.String... previousSelections)
           
 java.lang.String[] getNextChoices(java.lang.String flatSelection)
          Get the next level of choices given the previous selections, in order of first to last level.
 java.lang.String[] getSelectionByIndex(int index)
          Given an index of a selection from an SDK2 option list, get the parsed selection from this ChoiceList
 boolean isSelectionComplete(java.util.List<java.lang.String> previousSelections)
           
 boolean isSelectionComplete(java.lang.String... previousSelections)
          is the selection a complete selection?
static java.util.List<java.lang.String> parseSelection(java.lang.String selection)
          parse a Selection String into String[] with '.' a delimiter.

 

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

 

Constructor Detail

ChoiceList

public ChoiceList(java.lang.String[] optionList)

Method Detail

getNextChoices

public java.lang.String[] getNextChoices(java.lang.String flatSelection)
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

public java.lang.String[] getNextChoices(java.lang.String... previousSelections)

getNextChoices

public java.lang.String[] getNextChoices(java.util.List<java.lang.String> previousSelections)

flattenSelection

public static java.lang.String flattenSelection(java.lang.String... previousSelections)
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

public static java.lang.String flattenSelection(java.util.List<java.lang.String> previousSelections)

parseSelection

public static java.util.List<java.lang.String> parseSelection(java.lang.String selection)
parse a Selection String into String[] with '.' a delimiter. For example, "String.match" becomes {"String", "match"}
Parameters:
selection -
Returns:
arrayized selection

getFirstChoices

public java.lang.String[] getFirstChoices()
Just a convenient wrapper for ChoiceList.getNextChoices(String[])
Returns:
first level of choices

isSelectionComplete

public boolean isSelectionComplete(java.lang.String... previousSelections)
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

public boolean isSelectionComplete(java.util.List<java.lang.String> previousSelections)

getSelectionByIndex

public java.lang.String[] getSelectionByIndex(int index)
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

Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle Business Rules
11g Release 1 (11.1.1)

E10663-02


Copyright © 2009, Oracle and/or its affiliates. All rights reserved.