Package org.eclipse.xtext.parser
Class DefaultEcoreElementFactory
- java.lang.Object
-
- org.eclipse.xtext.parser.DefaultEcoreElementFactory
-
- All Implemented Interfaces:
IAstFactory
- Direct Known Subclasses:
CardinalityAwareEcoreFactory
public class DefaultEcoreElementFactory extends java.lang.Object implements IAstFactory
-
-
Constructor Summary
Constructors Constructor Description DefaultEcoreElementFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(org.eclipse.emf.ecore.EObject object, java.lang.String feature, java.lang.Object value, java.lang.String ruleName, INode node)Adds a given value to a list described by the given feature.org.eclipse.emf.ecore.EObjectcreate(org.eclipse.emf.ecore.EClassifier classifier)Creates an instance of the given type which has to be anEClass.IValueConverterServicegetConverterService()protected java.lang.ObjectgetTokenAsStringIfPossible(java.lang.Object tokenOrValue)voidset(org.eclipse.emf.ecore.EObject object, java.lang.String feature, java.lang.Object value, java.lang.String ruleName, INode node)Assigns a given value to a feature of the element_this.voidsetConverterService(IValueConverterService converterService)
-
-
-
Method Detail
-
getConverterService
public IValueConverterService getConverterService()
-
setConverterService
public void setConverterService(IValueConverterService converterService)
-
create
public org.eclipse.emf.ecore.EObject create(org.eclipse.emf.ecore.EClassifier classifier)
Description copied from interface:IAstFactoryCreates an instance of the given type which has to be anEClass.- Specified by:
createin interfaceIAstFactory- Parameters:
classifier- theEClassto be instantiated.- Returns:
- the instantiated
EObjectwhich must conform the given class.
-
set
public void set(org.eclipse.emf.ecore.EObject object, java.lang.String feature, java.lang.Object value, java.lang.String ruleName, INode node) throws ValueConverterExceptionDescription copied from interface:IAstFactoryAssigns a given value to a feature of the element_this. The value may be converted according to the optional lexer rule. The feature must be resolvable to a single value feature.- Specified by:
setin interfaceIAstFactory- Throws:
ValueConverterException- if the value cannot be converted.
-
getTokenAsStringIfPossible
protected java.lang.Object getTokenAsStringIfPossible(java.lang.Object tokenOrValue)
-
add
public void add(org.eclipse.emf.ecore.EObject object, java.lang.String feature, java.lang.Object value, java.lang.String ruleName, INode node) throws ValueConverterExceptionDescription copied from interface:IAstFactoryAdds a given value to a list described by the given feature. The list is owned by the element_this. The given value may be converted according to the optional lexer rule. The feature must be resolvable to a multi value feature.- Specified by:
addin interfaceIAstFactory- Throws:
ValueConverterException- if the value cannot be converted.
-
-