Skip to content

Commit

Permalink
EmfParsleyDslModelUtil in Java
Browse files Browse the repository at this point in the history
  • Loading branch information
LorenzoBettini committed Nov 22, 2023
1 parent 574a4dc commit 78adb5a
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 35 deletions.
Expand Up @@ -12,11 +12,9 @@ package org.eclipse.emf.parsley.dsl.tests

import com.google.inject.Inject
import org.eclipse.emf.parsley.dsl.model.Model
import org.eclipse.emf.parsley.dsl.util.EmfParsleyDslModelUtil
import org.eclipse.xtext.testing.InjectWith
import org.eclipse.xtext.testing.XtextRunner
import org.eclipse.xtext.testing.util.ParseHelper
import org.junit.Before
import org.junit.Test
import org.junit.runner.RunWith

Expand All @@ -29,11 +27,6 @@ class EmfParsleyDslModelUtilTest {

@Inject extension ParseHelper<Model>

@Before
def void instantiate() {
new EmfParsleyDslModelUtil
}

@Test
def void testContainingModule() {
val m = '''
Expand Down
@@ -0,0 +1,32 @@
/**
* Copyright (c) 2013 RCP Vision (http://www.rcp-vision.com) and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Lorenzo Bettini - initial API and implementation
*/
package org.eclipse.emf.parsley.dsl.util;

import static org.eclipse.xtext.EcoreUtil2.getContainerOfType;

import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.parsley.dsl.model.EmfFeatureAccess;

public class EmfParsleyDslModelUtil {

private EmfParsleyDslModelUtil() {
// only static utility methods
}

public static EmfFeatureAccess containingEmfFeatureAccess(final EObject o) {
return getContainerOfType(o, EmfFeatureAccess.class);
}

public static org.eclipse.emf.parsley.dsl.model.Module containingModule(final EObject o) {
return getContainerOfType(o,
org.eclipse.emf.parsley.dsl.model.Module.class);
}
}

This file was deleted.

0 comments on commit 78adb5a

Please sign in to comment.