Class DefaultTerminalConverter
- java.lang.Object
-
- org.eclipse.xtext.conversion.impl.AbstractValueConverter<T>
-
- org.eclipse.xtext.conversion.impl.AbstractLexerBasedConverter<java.lang.Object>
-
- org.eclipse.xtext.conversion.impl.DefaultTerminalConverter
-
- All Implemented Interfaces:
IValueConverter<java.lang.Object>
,IValueConverter.RuleSpecific
public class DefaultTerminalConverter extends AbstractLexerBasedConverter<java.lang.Object>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
DefaultTerminalConverter.Factory
-
Nested classes/interfaces inherited from interface org.eclipse.xtext.conversion.IValueConverter
IValueConverter.RuleSpecific
-
-
Field Summary
-
Fields inherited from interface org.eclipse.xtext.conversion.IValueConverter
NO_OP_CONVERTER
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
DefaultTerminalConverter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
setDataType(org.eclipse.emf.ecore.EDataType dataType)
protected java.lang.String
toEscapedString(java.lang.Object value)
java.lang.Object
toValue(java.lang.String string, INode node)
Creates a value from the given input.-
Methods inherited from class org.eclipse.xtext.conversion.impl.AbstractLexerBasedConverter
assertTokens, assertTokens, assertValidValue, createTokenContentMismatchException, createTokenTypeMismatchException, getLexer, getLexerProvider, getRule, getRuleName, getRuleName, getTokenDefMap, getTokenDefProvider, getTokenSource, setLexerProvider, setRule, setTokenDefProvider, toString
-
-
-
-
Method Detail
-
setDataType
protected void setDataType(org.eclipse.emf.ecore.EDataType dataType)
-
toValue
public java.lang.Object toValue(java.lang.String string, INode node) throws ValueConverterException
Description copied from interface:IValueConverter
Creates a value from the given input. The input is conformant to a data type or terminal rule.
The given
string
ornode
may be null but not both of them.- Parameters:
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 nothidden
.node
- the parsed node including hidden parts.- Returns:
- the new value or
null
. - Throws:
ValueConverterException
- indicates that the string or node did not fulfil the expected format.
-
toEscapedString
protected java.lang.String toEscapedString(java.lang.Object value)
- Overrides:
toEscapedString
in classAbstractLexerBasedConverter<java.lang.Object>
-
-