本文整理汇总了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();
}
示例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);
}
示例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;
}
示例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();
}
示例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);
}
示例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);
}
}
示例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);
}
示例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();
}
示例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;
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}
示例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;
}
示例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();
}