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

The following are Jave code examples for showing how to use replace() 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.
Example 1
Project: rest-modeling-framework   File:   Source Code and License Vote up 6 votes
private EObject resolveType(final ParserRuleContext ruleContext, final EObject superType) {
    final EObject resolvedType;

    if (superType.eIsProxy()) {
        resolvedType = null;
    } else {
        resolvedType = create(superType.eClass(), ruleContext);
        EcoreUtil.replace(unresolved, resolvedType);

        final Token nameToken = ruleContext.getStart();
        final String name = nameToken.getText();
        final Scope typeScope = scope.with(resolvedType, TYPE_CONTAINER__TYPES);

                .setValue(name, nameToken);

                .setValue(superType, nameToken);

    return resolvedType;