Java Code Examples for org.eclipse.emf.ecore.EClass#isInterface()
The following examples show how to use
org.eclipse.emf.ecore.EClass#isInterface() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: DefaultEcoreElementFactory.java From xtext-core with Eclipse Public License 2.0 | 5 votes |
@Override public EObject create(EClassifier classifier) { if (classifier == null) throw new NullPointerException("Classifier may not be null."); if (!(classifier instanceof EClass)) throw new IllegalArgumentException("Cannot create instance of datatype '" + classifier.getName() + "'"); EClass clazz = (EClass) classifier; if (clazz.isAbstract() || clazz.isInterface()) throw new IllegalArgumentException("Cannot create instance of abstract class '" + clazz.getName() + "'"); if (classifier.eIsProxy()) throw new IllegalStateException("Unresolved proxy "+((InternalEObject)classifier).eProxyURI()+". Make sure the EPackage has been registered."); return clazz.getEPackage().getEFactoryInstance().create(clazz); }
Example 2
Source File: LazyLinker.java From xtext-core with Eclipse Public License 2.0 | 5 votes |
protected EClass findInstantiableCompatible(EClass eType) { if (eType.isAbstract() || eType.isInterface()) { // check local Package EClass eClass = findSubTypeInEPackage(eType.getEPackage(), eType); if (eClass != null) return eClass; return globalFindInstantiableCompatible(eType); } return eType; }
Example 3
Source File: ExtendedMetaModel.java From BIMserver with GNU Affero General Public License v3.0 | 5 votes |
public EClass getRandomInstantiableSubClassOrSelf(EClass eType) { List<EClass> list = inheritedSubClasses.get(eType); EClass result = null; if (random.nextInt(list.size() + 1) == 0) { result = eType; } else { result = list.get(random.nextInt(list.size())); } if (result.isAbstract() || result.isInterface()) { return getRandomInstantiableSubClassOrSelf(eType); } else { return result; } }
Example 4
Source File: N4JSLinker.java From n4js with Eclipse Public License 1.0 | 4 votes |
private boolean isInstantiatableSubType(EClass c, EClass superType) { return !c.isAbstract() && !c.isInterface() && EcoreUtil2.isAssignableFrom(superType, c); }
Example 5
Source File: LazyLinker.java From xtext-core with Eclipse Public License 2.0 | 4 votes |
private boolean isInstantiatableSubType(EClass c, EClass superType) { return !c.isAbstract() && !c.isInterface() && EcoreUtil2.isAssignableFrom(superType, c); }
Example 6
Source File: EClasses.java From dsl-devkit with Eclipse Public License 1.0 | 2 votes |
/** * Determine whether a type is an instantiable subtype of another type. * * @param c * EClass to check. * @param superType * of which c should be a subtype. * @return {@code true}, if c is instantiable and assignment-compatible with {@code superType}. */ private static boolean isInstantiatableSubType(final EClass c, final EClass superType) { return !c.isAbstract() && !c.isInterface() && EcoreUtil2.isAssignableFrom(superType, c); }