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


Java EPackage类代码示例

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


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

示例1: init

import org.eclipse.emf.ecore.EPackage; //导入依赖的package包/类
/**
 * Creates the default factory implementation.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public static PkmntcgoFactory init()
{
  try
  {
    PkmntcgoFactory thePkmntcgoFactory = (PkmntcgoFactory)EPackage.Registry.INSTANCE.getEFactory(PkmntcgoPackage.eNS_URI);
    if (thePkmntcgoFactory != null)
    {
      return thePkmntcgoFactory;
    }
  }
  catch (Exception exception)
  {
    EcorePlugin.INSTANCE.log(exception);
  }
  return new PkmntcgoFactoryImpl();
}
 
开发者ID:rehne93,项目名称:pokemon-tcgo-deck-generator,代码行数:23,代码来源:PkmntcgoFactoryImpl.java

示例2: loadPackage

import org.eclipse.emf.ecore.EPackage; //导入依赖的package包/类
/**
 * Laods the package and any sub-packages from their serialized form.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public void loadPackage() {
	if (isLoaded)
		return;
	isLoaded = true;

	URL url = getClass().getResource(packageFilename);
	if (url == null) {
		throw new RuntimeException("Missing serialized package: " + packageFilename);
	}
	URI uri = URI.createURI(url.toString());
	Resource resource = new EcoreResourceFactoryImpl().createResource(uri);
	try {
		resource.load(null);
	} catch (IOException exception) {
		throw new WrappedException(exception);
	}
	initializeFromLoadedEPackage(this, (EPackage) resource.getContents().get(0));
	createResource(eNS_URI);
}
 
开发者ID:shenan4321,项目名称:BIMplatform,代码行数:26,代码来源:Ifc2x3tc1PackageImpl.java

示例3: init

import org.eclipse.emf.ecore.EPackage; //导入依赖的package包/类
/**
 * Creates, registers, and initializes the <b>Package</b> for this model, and for any others upon which it depends.
 * 
 * <p>This method is used to initialize {@link FsmPackage#eINSTANCE} when that field is accessed.
 * Clients should not invoke it directly. Instead, they should simply access that field to obtain the package.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @see #eNS_URI
 * @see #createPackageContents()
 * @see #initializePackageContents()
 * @generated
 */
public static FsmPackage init() {
	if (isInited) return (FsmPackage)EPackage.Registry.INSTANCE.getEPackage(FsmPackage.eNS_URI);

	// Obtain or create and register package
	FsmPackageImpl theFsmPackage = (FsmPackageImpl)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof FsmPackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI) : new FsmPackageImpl());

	isInited = true;

	// Initialize simple dependencies
	EcorePackage.eINSTANCE.eClass();

	// Create package meta-data objects
	theFsmPackage.createPackageContents();

	// Initialize created meta-data
	theFsmPackage.initializePackageContents();

	// Mark meta-data to indicate it can't be changed
	theFsmPackage.freeze();

 
	// Update the registry and return the package
	EPackage.Registry.INSTANCE.put(FsmPackage.eNS_URI, theFsmPackage);
	return theFsmPackage;
}
 
开发者ID:eclipse,项目名称:gemoc-studio,代码行数:38,代码来源:FsmPackageImpl.java

示例4: init

import org.eclipse.emf.ecore.EPackage; //导入依赖的package包/类
/**
 * Creates the default factory implementation.
 * <!-- begin-user-doc --> <!-- end-user-doc -->
 * @generated
 */
public static RuncmdsModuleFactory init()
{
  try
  {
    RuncmdsModuleFactory theRuncmdsModuleFactory = (RuncmdsModuleFactory)EPackage.Registry.INSTANCE.getEFactory(RuncmdsModulePackage.eNS_URI);
    if (theRuncmdsModuleFactory != null)
    {
      return theRuncmdsModuleFactory;
    }
  }
  catch (Exception exception)
  {
    EcorePlugin.INSTANCE.log(exception);
  }
  return new RuncmdsModuleFactoryImpl();
}
 
开发者ID:Morgan-Stanley,项目名称:Saturn,代码行数:22,代码来源:RuncmdsModuleFactoryImpl.java

示例5: loadPackage

import org.eclipse.emf.ecore.EPackage; //导入依赖的package包/类
/**
 * Laods the package and any sub-packages from their serialized form.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public void loadPackage() {
	if (isLoaded) return;
	isLoaded = true;

	URL url = getClass().getResource(packageFilename);
	if (url == null) {
		throw new RuntimeException("Missing serialized package: " + packageFilename);
	}
	URI uri = URI.createURI(url.toString());
	Resource resource = new EcoreResourceFactoryImpl().createResource(uri);
	try {
		resource.load(null);
	}
	catch (IOException exception) {
		throw new WrappedException(exception);
	}
	initializeFromLoadedEPackage(this, (EPackage)resource.getContents().get(0));
	createResource(eNS_URI);
}
 
开发者ID:georghinkel,项目名称:ttc2017smartGrids,代码行数:26,代码来源:COSEMPackageImpl.java

示例6: visit

import org.eclipse.emf.ecore.EPackage; //导入依赖的package包/类
@Override
public void visit(Tuple tuple, String param) {
    if (hasElement(tuple)) {
        return;
    }

    EPackage firstRoot = this.m_rootPackages.iterator()
        .next();
    EClass eClass = g_EcoreFactory.createEClass();
    setElement(tuple, eClass);

    eClass.setName(getTupleName(tuple));

    firstRoot.getEClassifiers()
        .add(eClass);

    int typeIndex = 1;
    for (Type type : tuple.getTypes()) {
        Field typeField =
            new Field(Name.getName(getTupleElementName(tuple, typeIndex++)), type, 1, 1);
        EStructuralFeature eStructFeat = (EStructuralFeature) getElement(typeField);
        eClass.getEStructuralFeatures()
            .add(eStructFeat);
    }
}
 
开发者ID:meteoorkip,项目名称:JavaGraph,代码行数:26,代码来源:TypeToEcore.java

示例7: register

import org.eclipse.emf.ecore.EPackage; //导入依赖的package包/类
public void register(Injector injector) {
	if (!EPackage.Registry.INSTANCE.containsKey("http://www.baernreuther.de/dsls/Pkmntcgo")) {
		EPackage.Registry.INSTANCE.put("http://www.baernreuther.de/dsls/Pkmntcgo", PkmntcgoPackage.eINSTANCE);
	}
	IResourceFactory resourceFactory = injector.getInstance(IResourceFactory.class);
	IResourceServiceProvider serviceProvider = injector.getInstance(IResourceServiceProvider.class);
	
	Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("ptcgo", resourceFactory);
	IResourceServiceProvider.Registry.INSTANCE.getExtensionToFactoryMap().put("ptcgo", serviceProvider);
}
 
开发者ID:rehne93,项目名称:pokemon-tcgo-deck-generator,代码行数:11,代码来源:PkmntcgoStandaloneSetupGenerated.java

示例8: init

import org.eclipse.emf.ecore.EPackage; //导入依赖的package包/类
/**
 * Creates the default factory implementation.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public static OperationalLimitsFactory init() {
	try {
		OperationalLimitsFactory theOperationalLimitsFactory = (OperationalLimitsFactory)EPackage.Registry.INSTANCE.getEFactory(OperationalLimitsPackage.eNS_URI);
		if (theOperationalLimitsFactory != null) {
			return theOperationalLimitsFactory;
		}
	}
	catch (Exception exception) {
		EcorePlugin.INSTANCE.log(exception);
	}
	return new OperationalLimitsFactoryImpl();
}
 
开发者ID:georghinkel,项目名称:ttc2017smartGrids,代码行数:19,代码来源:OperationalLimitsFactoryImpl.java

示例9: init

import org.eclipse.emf.ecore.EPackage; //导入依赖的package包/类
/**
 * Creates, registers, and initializes the <b>Package</b> for this model, and for any others upon which it depends.
 * 
 * <p>This method is used to initialize {@link RulesPackage#eINSTANCE} when that field is accessed.
 * Clients should not invoke it directly. Instead, they should simply access that field to obtain the package.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @see #eNS_URI
 * @generated
 */
public static RulesPackage init() {
	if (isInited)
		return (RulesPackage) EPackage.Registry.INSTANCE.getEPackage(RulesPackage.eNS_URI);

	// Obtain or create and register package
	RulesPackageImpl theRulesPackage = (RulesPackageImpl) (EPackage.Registry.INSTANCE
			.get(eNS_URI) instanceof RulesPackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI)
					: new RulesPackageImpl());

	isInited = true;

	// Initialize simple dependencies
	OutagePreventionJointargetPackage.eINSTANCE.eClass();
	GluemodelPackage.eINSTANCE.eClass();
	LanguagePackage.eINSTANCE.eClass();

	// Obtain or create and register interdependencies
	Task2PackageImpl theTask2Package = (Task2PackageImpl) (EPackage.Registry.INSTANCE
			.getEPackage(Task2Package.eNS_URI) instanceof Task2PackageImpl
					? EPackage.Registry.INSTANCE.getEPackage(Task2Package.eNS_URI) : Task2Package.eINSTANCE);

	// Load packages
	theTask2Package.loadPackage();

	// Fix loaded packages
	theRulesPackage.fixPackageContents();
	theTask2Package.fixPackageContents();

	// Mark meta-data to indicate it can't be changed
	theRulesPackage.freeze();

	// Update the registry and return the package
	EPackage.Registry.INSTANCE.put(RulesPackage.eNS_URI, theRulesPackage);
	return theRulesPackage;
}
 
开发者ID:georghinkel,项目名称:ttc2017smartGrids,代码行数:46,代码来源:RulesPackageImpl.java

示例10: init

import org.eclipse.emf.ecore.EPackage; //导入依赖的package包/类
/**
 * Creates the default factory implementation.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public static FinancialFactory init() {
	try {
		FinancialFactory theFinancialFactory = (FinancialFactory)EPackage.Registry.INSTANCE.getEFactory(FinancialPackage.eNS_URI);
		if (theFinancialFactory != null) {
			return theFinancialFactory;
		}
	}
	catch (Exception exception) {
		EcorePlugin.INSTANCE.log(exception);
	}
	return new FinancialFactoryImpl();
}
 
开发者ID:georghinkel,项目名称:ttc2017smartGrids,代码行数:19,代码来源:FinancialFactoryImpl.java

示例11: init

import org.eclipse.emf.ecore.EPackage; //导入依赖的package包/类
/**
 * Creates the default factory implementation.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public static CoreFactory init() {
	try {
		CoreFactory theCoreFactory = (CoreFactory)EPackage.Registry.INSTANCE.getEFactory(CorePackage.eNS_URI);
		if (theCoreFactory != null) {
			return theCoreFactory;
		}
	}
	catch (Exception exception) {
		EcorePlugin.INSTANCE.log(exception);
	}
	return new CoreFactoryImpl();
}
 
开发者ID:SvenPeldszus,项目名称:rgse.ttc17.emoflon.tgg,代码行数:19,代码来源:CoreFactoryImpl.java

示例12: init

import org.eclipse.emf.ecore.EPackage; //导入依赖的package包/类
/**
 * Creates the default factory implementation.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public static DatatypesFactory init() {
	try {
		DatatypesFactory theDatatypesFactory = (DatatypesFactory)EPackage.Registry.INSTANCE.getEFactory(DatatypesPackage.eNS_URI);
		if (theDatatypesFactory != null) {
			return theDatatypesFactory;
		}
	}
	catch (Exception exception) {
		EcorePlugin.INSTANCE.log(exception);
	}
	return new DatatypesFactoryImpl();
}
 
开发者ID:SvenPeldszus,项目名称:rgse.ttc17.emoflon.tgg,代码行数:19,代码来源:DatatypesFactoryImpl.java

示例13: init

import org.eclipse.emf.ecore.EPackage; //导入依赖的package包/类
/**
 * Creates the default factory implementation.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public static FsmTraceFactory init() {
	try {
		FsmTraceFactory theFsmTraceFactory = (FsmTraceFactory)EPackage.Registry.INSTANCE.getEFactory(FsmTracePackage.eNS_URI);
		if (theFsmTraceFactory != null) {
			return theFsmTraceFactory;
		}
	}
	catch (Exception exception) {
		EcorePlugin.INSTANCE.log(exception);
	}
	return new FsmTraceFactoryImpl();
}
 
开发者ID:eclipse,项目名称:gemoc-studio,代码行数:19,代码来源:FsmTraceFactoryImpl.java

示例14: init

import org.eclipse.emf.ecore.EPackage; //导入依赖的package包/类
/**
 * Creates, registers, and initializes the <b>Package</b> for this model, and for any others upon which it depends.
 * 
 * <p>This method is used to initialize {@link ToscaPackage#eINSTANCE} when that field is accessed.
 * Clients should not invoke it directly. Instead, they should simply access that field to obtain the package.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @see #eNS_URI
 * @see #createPackageContents()
 * @see #initializePackageContents()
 * @generated
 */
public static ToscaPackage init() {
	if (isInited) return (ToscaPackage)EPackage.Registry.INSTANCE.getEPackage(ToscaPackage.eNS_URI);

	// Obtain or create and register package
	ToscaPackageImpl theToscaPackage = (ToscaPackageImpl)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof ToscaPackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI) : new ToscaPackageImpl());

	isInited = true;

	// Initialize simple dependencies
	InfrastructurePackage.eINSTANCE.eClass();
	PlatformPackage.eINSTANCE.eClass();
	SlaPackage.eINSTANCE.eClass();
	OCCIPackage.eINSTANCE.eClass();

	// Create package meta-data objects
	theToscaPackage.createPackageContents();

	// Initialize created meta-data
	theToscaPackage.initializePackageContents();

	// Register package validator
	EValidator.Registry.INSTANCE.put
		(theToscaPackage, 
		 new EValidator.Descriptor() {
			 public EValidator getEValidator() {
				 return ToscaValidator.INSTANCE;
			 }
		 });

	// Mark meta-data to indicate it can't be changed
	theToscaPackage.freeze();

 
	// Update the registry and return the package
	EPackage.Registry.INSTANCE.put(ToscaPackage.eNS_URI, theToscaPackage);
	return theToscaPackage;
}
 
开发者ID:occiware,项目名称:TOSCA-Studio,代码行数:50,代码来源:ToscaPackageImpl.java

示例15: init

import org.eclipse.emf.ecore.EPackage; //导入依赖的package包/类
/**
 * Creates the default factory implementation.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public static InfMeteringFactory init() {
	try {
		InfMeteringFactory theInfMeteringFactory = (InfMeteringFactory)EPackage.Registry.INSTANCE.getEFactory(InfMeteringPackage.eNS_URI);
		if (theInfMeteringFactory != null) {
			return theInfMeteringFactory;
		}
	}
	catch (Exception exception) {
		EcorePlugin.INSTANCE.log(exception);
	}
	return new InfMeteringFactoryImpl();
}
 
开发者ID:georghinkel,项目名称:ttc2017smartGrids,代码行数:19,代码来源:InfMeteringFactoryImpl.java


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