org.eclipse.xtext.parser
Class DefaultEcoreElementFactory

java.lang.Object
  extended by org.eclipse.xtext.parser.DefaultEcoreElementFactory
All Implemented Interfaces:
IAstFactory

public class DefaultEcoreElementFactory
extends java.lang.Object
implements IAstFactory

Author:
Sven Efftinge - Initial contribution and API

Constructor Summary
DefaultEcoreElementFactory()
           
 
Method Summary
 void add(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.EObject create(org.eclipse.emf.ecore.EClassifier classifier)
          Creates an instance of the given type which has to be an EClass.
 IValueConverterService getConverterService()
           
protected  java.lang.Object getTokenAsStringIfPossible(java.lang.Object tokenOrValue)
           
 void set(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.
 void setConverterService(IValueConverterService converterService)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultEcoreElementFactory

public DefaultEcoreElementFactory()
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: IAstFactory
Creates an instance of the given type which has to be an EClass.

Specified by:
create in interface IAstFactory
Parameters:
classifier - the EClass to be instantiated.
Returns:
the instantiated EObject which 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 ValueConverterException
Description copied from interface: IAstFactory
Assigns 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:
set in interface IAstFactory
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 ValueConverterException
Description copied from interface: IAstFactory
Adds 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:
add in interface IAstFactory
Throws:
ValueConverterException - if the value cannot be converted.