Java Code Examples for org.eclipse.emf.ecore.util.EcoreUtil.createFromString()

The following are Jave code examples for showing how to use createFromString() of the org.eclipse.emf.ecore.util.EcoreUtil class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: rest-modeling-framework   File: AbstractScopedVisitor.java   View Source Code Vote up 5 votes
private Object createFromString(final EAttribute eAttribute, final RAMLParser.IdContext valueToken) {
    try {
        return EcoreUtil.createFromString(eAttribute.getEAttributeType(), valueToken.getText());
    } catch (IllegalArgumentException e) {
        scope.addError("{0} at {1}", e.getMessage(), valueToken.getStart());
        return null;
    }
}