當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。