public class KeywordAlternativeConverter extends AbstractValueConverter<java.lang.String> implements IValueConverter.RuleSpecific
IValueConverter.RuleSpecificNO_OP_CONVERTER| Constructor and Description |
|---|
KeywordAlternativeConverter() |
| Modifier and Type | Method and Description |
|---|---|
protected java.lang.String |
keywordToString(Keyword keyword) |
protected java.lang.IllegalArgumentException |
mismatchedRuleBody(AbstractRule rule) |
protected void |
processElement(AbstractElement element,
AbstractRule rule,
com.google.common.collect.ImmutableSet.Builder<java.lang.String> result) |
void |
setRule(AbstractRule rule) |
java.lang.String |
toString(java.lang.String value)
Transforms the given value to a string that is conformant to the expected
terminal or data type rule.
|
java.lang.String |
toValue(java.lang.String string,
INode node)
Creates a value from the given input.
|
public java.lang.String toValue(java.lang.String string,
INode node)
throws ValueConverterException
IValueConverterCreates a value from the given input. The input is conformant to a data type or terminal rule.
The given string
or node may be null but not both of them.
toValue in interface IValueConverter<java.lang.String>string - the string that was inferred from the node. Usually the node's text
but may be reduced to the parts of the node that are not
hidden.node - the parsed node including hidden parts.null.ValueConverterException - indicates that the string or node did not fulfil
the expected format.public java.lang.String toString(java.lang.String value)
throws ValueConverterException
IValueConvertertoString in interface IValueConverter<java.lang.String>value - the to-be-transformed valueValueConverterException - indicates that the value cannot be converted to a valid string.protected java.lang.String keywordToString(Keyword keyword)
public void setRule(AbstractRule rule)
setRule in interface IValueConverter.RuleSpecificjava.lang.IllegalArgumentException - if the rule is not a datatype rule or does not match
the pattern RuleName: 'keyword' | 'other';
protected void processElement(AbstractElement element, AbstractRule rule, com.google.common.collect.ImmutableSet.Builder<java.lang.String> result)
protected java.lang.IllegalArgumentException mismatchedRuleBody(AbstractRule rule)