Class EFactoryValueConverter
- java.lang.Object
-
- org.eclipse.xtext.conversion.impl.EFactoryValueConverter
-
- All Implemented Interfaces:
IValueConverter<java.lang.Object>
public class EFactoryValueConverter extends java.lang.Object implements IValueConverter<java.lang.Object>
A value converter that delegates to theEFactoryof aEDataType.
-
-
Nested Class Summary
-
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 Constructor Description EFactoryValueConverter(org.eclipse.emf.ecore.EDataType dataType)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringtoString(java.lang.Object value)Transforms the given value to a string that is conformant to the expected terminal or data type rule.java.lang.ObjecttoValue(java.lang.String string, INode node)Creates a value from the given input.
-
-
-
Method Detail
-
toString
public java.lang.String toString(java.lang.Object value)
Description copied from interface:IValueConverterTransforms the given value to a string that is conformant to the expected terminal or data type rule.- Specified by:
toStringin interfaceIValueConverter<java.lang.Object>- Parameters:
value- the to-be-transformed value- Returns:
- a string represenation for that value.
-
toValue
public java.lang.Object toValue(java.lang.String string, INode node) throws ValueConverterExceptionDescription copied from interface:IValueConverterCreates a value from the given input. The input is conformant to a data type or terminal rule.
The given
stringornodemay be null but not both of them.- Specified by:
toValuein interfaceIValueConverter<java.lang.Object>- 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.
-
-