当前位置: 首页>>代码示例>>Java>>正文


Java EPackageImpl类代码示例

本文整理汇总了Java中org.eclipse.emf.ecore.impl.EPackageImpl的典型用法代码示例。如果您正苦于以下问题:Java EPackageImpl类的具体用法?Java EPackageImpl怎么用?Java EPackageImpl使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


EPackageImpl类属于org.eclipse.emf.ecore.impl包,在下文中一共展示了EPackageImpl类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getQualifiedPackageInterfaceName

import org.eclipse.emf.ecore.impl.EPackageImpl; //导入依赖的package包/类
/**
 * Returns the qualified package interface name for the given epackage (model).
 *
 * @param ePackage
 *          the model
 * @return the package interface name
 */
public static String getQualifiedPackageInterfaceName(final EPackage ePackage) {
  if (ePackage.getClass() == EPackageImpl.class) {
    // EPackage loaded from ecore model
    GenPackage genPackage = findGenPackage(ePackage);
    if (genPackage != null) {
      return genPackage.getQualifiedPackageInterfaceName();
    }
  } else {
    // EPackage loaded from Java
    Class<?>[] interfaces = ePackage.getClass().getInterfaces();
    if (interfaces != null && interfaces.length > 0) {
      return interfaces[0].getName();
    }
  }
  return null;
}
 
开发者ID:dsldevkit,项目名称:dsl-devkit,代码行数:24,代码来源:CheckGenModelUtil.java

示例2: apply

import org.eclipse.emf.ecore.impl.EPackageImpl; //导入依赖的package包/类
@Override
public PersistentEObject apply(Id id) {
    PersistentEObject object;
    EClass eClass = DirectWriteMapStore.this.resolveInstanceOf(id);
    if (nonNull(eClass)) {
        EObject eObject;
        if (Objects.equals(eClass.getEPackage().getClass(), EPackageImpl.class)) {
            // Dynamic EMF
            eObject = PersistenceFactory.getInstance().create(eClass);
        }
        else {
            eObject = EcoreUtil.create(eClass);
        }
        object = PersistentEObject.from(eObject);
        object.id(id);
        object.setMapped(true);
    }
    else {
        throw new RuntimeException("Element " + id + " does not have an associated EClass");
    }
    return object;
}
 
开发者ID:atlanmod,项目名称:NeoEMF,代码行数:23,代码来源:DirectWriteMapStore.java

示例3: apply

import org.eclipse.emf.ecore.impl.EPackageImpl; //导入依赖的package包/类
@Override
public PersistentEObject apply(Id id) {
    PersistentEObject object;
    EClass eClass = DirectWriteHBaseStore.this.resolveInstanceOf(id);
    if (nonNull(eClass)) {
        EObject eObject;
        if (Objects.equals(eClass.getEPackage().getClass(), EPackageImpl.class)) {
            // Dynamic EMF
            eObject = PersistenceFactory.getInstance().create(eClass);
        }
        else {
            eObject = EcoreUtil.create(eClass);
        }
        object = PersistentEObject.from(eObject);
        object.id(id);
        object.setMapped(true);
    }
    else {
        throw new RuntimeException("Element " + id + " does not have an associated EClass");
    }
    return object;
}
 
开发者ID:atlanmod,项目名称:NeoEMF,代码行数:23,代码来源:DirectWriteHBaseStore.java

示例4: apply

import org.eclipse.emf.ecore.impl.EPackageImpl; //导入依赖的package包/类
@Override
public PersistentEObject apply(Id id) {
    PersistentEObject object;
    if(isNull(eClass)) {
        /*
         *  Use the embedded vertex to compute the eClass instead of the id to avoid
         *  a backend query to retrieve the vertex
         */
        eClass = BlueprintsPersistenceBackend.this.resolveInstanceOf(vertex);
    }
    if (nonNull(eClass)) {
        EObject eObject;
        if (Objects.equals(eClass.getEPackage().getClass(), EPackageImpl.class)) {
            // Dynamic EMF
            eObject = PersistenceFactory.getInstance().create(eClass);
        }
        else {
            eObject = EcoreUtil.create(eClass);
        }
        object = PersistentEObject.from(eObject);
        object.id(id);
        object.setMapped(true);
    }
    else {
        throw new RuntimeException("Element " + id + " does not have an associated EClass");
    }
    return object;
}
 
开发者ID:atlanmod,项目名称:NeoEMF,代码行数:29,代码来源:BlueprintsPersistenceBackend.java

示例5: freeze

import org.eclipse.emf.ecore.impl.EPackageImpl; //导入依赖的package包/类
/**
 * Marks the package to indicate that it and everything it contains or that its contents depend on can no longer be changed.
 * This helps to improve the performance of the model but has no other effect.
 */
public static void freeze(EPackage ePackage)
{
  try
  {
    ((EPackageImpl)ePackage).freeze();
  }
  catch (ClassCastException exception)
  {
    // Ignore if we can't freeze.
  }
}
 
开发者ID:LangleyStudios,项目名称:eclipse-avro,代码行数:16,代码来源:EcoreUtil.java

示例6: qualifiedPackageInterfaceName

import org.eclipse.emf.ecore.impl.EPackageImpl; //导入依赖的package包/类
/**
 * Returns the qualified package interface name for the given epackage (model).
 *
 * @param ePackage
 *          the model
 * @return the package interface name
 */
public static String qualifiedPackageInterfaceName(final EPackage ePackage) {
  return ePackage.getClass() == EPackageImpl.class ? findGenPackage(ePackage).getQualifiedPackageInterfaceName()
      : ePackage.getClass().getInterfaces()[0].getName();
}
 
开发者ID:dsldevkit,项目名称:dsl-devkit,代码行数:12,代码来源:GenModelUtil2.java


注:本文中的org.eclipse.emf.ecore.impl.EPackageImpl类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。