public interface IlrValueProvider
IlrValueProvider represents a value provider used for enumerated
values that use a tree structure.
An IlrValueProvider is invoked by the prediction engine to
provide the list of possible values for a given concept at a specific
prediction point. If filtering is required according to the context
the implementation of the value provider can use the syntax node passed to
the prepare() method in order to compute a filtered list of
values to return.
Note that in an error recovery situation, the node passed to
prepare() may not have the expected structure.
| Modifier and Type | Method and Description |
|---|---|
void |
dispose()
Disposes of the value provider after a visit.
|
java.lang.Object[] |
getChildren(java.lang.Object parent)
Returns the child elements of the given parent element.
|
java.lang.String |
getDisplayText(java.lang.Object element,
java.util.Locale locale)
Returns the localized text that can be displayed in viewers.
|
java.lang.Object |
getParent(java.lang.Object element)
Returns the parent for the given element.
|
java.lang.String |
getText(java.lang.Object element,
java.util.Locale locale)
Returns the localized text that can inserted in rule text.
|
java.lang.Object[] |
getValues()
Returns the elements at the root level.
|
boolean |
hasChildren(java.lang.Object element)
States whether the given element has children.
|
boolean |
isExclusive()
Returns
true if the value provider accepts only the values
returned by getValues(), and does not accept any other value entered
in a value editor. |
void |
prepare(IlrSyntaxTree.Node node)
Prepares the value provider to a visit with the given branch of the Abstract Syntax Tree.
|
void prepare(IlrSyntaxTree.Node node)
node - The parent node under which a value can be added.java.lang.Object[] getValues()
java.lang.Object[] getChildren(java.lang.Object parent)
parent - The parent element.java.lang.Object getParent(java.lang.Object element)
element - The child element.boolean hasChildren(java.lang.Object element)
element - The element.true if the given element has children,
and false if it has no children.java.lang.String getDisplayText(java.lang.Object element,
java.util.Locale locale)
element - The element.locale - The locale.java.lang.String getText(java.lang.Object element,
java.util.Locale locale)
element - The element.locale - The locale.void dispose()
boolean isExclusive()
true if the value provider accepts only the values
returned by getValues(), and does not accept any other value entered
in a value editor.© Copyright IBM Corp. 1987, 2017