@Test
  public void testSchemaValidationOnLoadWithInvalidFile() {
    String fileName = DATA_BASEDIR + "bare.xml"; // $NON-NLS-1$

    // prepare resource set
    ResourceSet resourceSet = new ResourceSetImpl();
    EPackage.Registry.INSTANCE.put(XMLTypePackage.eNS_URI, XMLTypePackage.eINSTANCE);
    EPackage.Registry.INSTANCE.put(XMLNamespacePackage.eNS_URI, XMLNamespacePackage.eINSTANCE);
    resourceSet.getPackageRegistry().put(MyreqifPackage.eNS_URI, MyreqifPackage.eINSTANCE);
    resourceSet
        .getResourceFactoryRegistry()
        .getExtensionToFactoryMap()
        .put("xml", new MyreqifResourceFactoryImpl()); // $NON-NLS-1$

    // load data
    URI emfURI = URI.createURI(fileName, true);
    Resource resource = resourceSet.createResource(emfURI);
    HashMap<String, Object> options = new HashMap<String, Object>();
    enableSchemaValidationAndNewMethods(options);

    try {
      resource.load(options);
    } catch (IOException ioe) {
      assertTrue(ioe.getMessage(), ioe.getMessage().contains("cvc-complex-type.2.4.a:"));
    }

    // validate data
    assertEquals(1, resource.getErrors().size());
    assertTrue(resource.getContents().get(0) instanceof DocumentRoot);
  }
  /**
   * 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 Graphics2dPackage#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 Graphics2dPackage init() {
    if (isInited)
      return (Graphics2dPackage) EPackage.Registry.INSTANCE.getEPackage(Graphics2dPackage.eNS_URI);

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

    isInited = true;

    // Initialize simple dependencies
    WidgetsPackage.eINSTANCE.eClass();
    StylesPackage.eINSTANCE.eClass();
    LayoutsPackage.eINSTANCE.eClass();
    UtilPackage.eINSTANCE.eClass();

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

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

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

    // Update the registry and return the package
    EPackage.Registry.INSTANCE.put(Graphics2dPackage.eNS_URI, theGraphics2dPackage);
    return theGraphics2dPackage;
  }
  public void register(Injector injector) {
    if (!EPackage.Registry.INSTANCE.containsKey(
        "http://www.eclipse.org/2011/xtext/idea/ui/common/types/xtext/ui/Refactoring")) {
      EPackage.Registry.INSTANCE.put(
          "http://www.eclipse.org/2011/xtext/idea/ui/common/types/xtext/ui/Refactoring",
          org.eclipse
              .xtext
              .idea
              .common
              .types
              .refactoringTestLanguage
              .RefactoringTestLanguagePackage
              .eINSTANCE);
    }

    org.eclipse.xtext.resource.IResourceFactory resourceFactory =
        injector.getInstance(org.eclipse.xtext.resource.IResourceFactory.class);
    org.eclipse.xtext.resource.IResourceServiceProvider serviceProvider =
        injector.getInstance(org.eclipse.xtext.resource.IResourceServiceProvider.class);
    Resource.Factory.Registry.INSTANCE
        .getExtensionToFactoryMap()
        .put("ideaTypesRefactoring", resourceFactory);
    org.eclipse.xtext.resource.IResourceServiceProvider.Registry.INSTANCE
        .getExtensionToFactoryMap()
        .put("ideaTypesRefactoring", serviceProvider);
  }
Пример #4
0
  private static QvtOperationalModuleEnv initLibEnvironment(Library lib, Module libModule) {
    EPackage.Registry registry = new EPackageRegistryImpl();
    QvtOperationalModuleEnv libEnv =
        new QvtOperationalEnvFactory(registry).createModuleEnvironment(libModule);

    EPackage.Registry libEnvRegistry = libEnv.getEPackageRegistry();
    // set our desired stdlib version to be resolved by oclstdlib package name
    EPackage oclStdlibPackage = libEnv.getOCLStandardLibrary().getOclAny().getEPackage();
    libEnv.getEPackageRegistry().put(oclStdlibPackage.getNsURI(), oclStdlibPackage);

    if (lib.getInMetamodels() != null) {
      for (String mm : lib.getInMetamodels()) {
        EPackage ePackage = EPackage.Registry.INSTANCE.getEPackage(mm);
        if (ePackage != null) {
          libEnvRegistry.put(mm, ePackage);
        }
      }
    }
    if (lib.getOutMetamodels() != null) {
      for (String mm : lib.getOutMetamodels()) {
        EPackage ePackage = EPackage.Registry.INSTANCE.getEPackage(mm);
        if (ePackage != null) {
          libEnvRegistry.put(mm, ePackage);
        }
      }
    }
    return libEnv;
  }
  /**
   * Creates, registers, and initializes the <b>Package</b> for this model, and for any others upon
   * which it depends. Simple dependencies are satisfied by calling this method on all dependent
   * packages before doing anything else. This method drives initialization for interdependent
   * packages directly, in parallel with this package, itself.
   *
   * <p>Of this package and its interdependencies, all packages which have not yet been registered
   * by their URI values are first created and registered. The packages are then initialized in two
   * steps: meta-model objects for all of the packages are created before any are initialized, since
   * one package's meta-model objects may refer to those of another.
   *
   * <p>Invocation of this method will not affect any packages that have already been initialized.
   * <!-- begin-user-doc -->
   *
   * @return the JAXRS Library registry package
   *     <!-- end-user-doc -->
   * @see #eNS_URI
   * @see #createPackageContents()
   * @see #initializePackageContents()
   * @generated
   */
  public static JAXRSLibraryRegistryPackage init() {
    if (isInited)
      return (JAXRSLibraryRegistryPackage)
          EPackage.Registry.INSTANCE.getEPackage(JAXRSLibraryRegistryPackage.eNS_URI);

    // Obtain or create and register package
    JAXRSLibraryRegistryPackageImpl theJAXRSLibraryRegistryPackage =
        (JAXRSLibraryRegistryPackageImpl)
            (EPackage.Registry.INSTANCE.getEPackage(eNS_URI)
                    instanceof JAXRSLibraryRegistryPackageImpl
                ? EPackage.Registry.INSTANCE.getEPackage(eNS_URI)
                : new JAXRSLibraryRegistryPackageImpl());

    isInited = true;

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

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

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

    return theJAXRSLibraryRegistryPackage;
  }
Пример #6
0
 /**
  *
  * <!-- begin-user-doc -->
  * <!-- end-user-doc -->
  *
  * @generated
  */
 public IComment addComment() {
   org.eclipse.emf.ecore.EPackage ePackage =
       org.eclipse.emf.ecore.EPackage.Registry.INSTANCE.getEPackage(
           "http://www.openhealthtools.org/mdht/uml/cda/apitest");
   org.eclipse.emf.ecore.EFactory eFactory =
       org.eclipse.emf.ecore.EPackage.Registry.INSTANCE.getEFactory(
           "http://www.openhealthtools.org/mdht/uml/cda/apitest");
   org.eclipse.emf.ecore.EClass eClass =
       (org.eclipse.emf.ecore.EClass) ePackage.getEClassifier("Comment");
   org.eclipse.emf.ecore.EObject eObject = eFactory.create(eClass);
   try {
     java.lang.reflect.Method initMethod =
         eObject.getClass().getMethod("init", new java.lang.Class[0]);
     initMethod.invoke(eObject, new Object[0]);
   } catch (Exception e) {
     // no init() method
   }
   org.eclipse.emf.ecore.EPackage domainPackage = this.eClass().getEPackage();
   org.eclipse.emf.ecore.EFactory domainFactory = domainPackage.getEFactoryInstance();
   org.eclipse.emf.ecore.EClass domainEClass =
       (org.eclipse.emf.ecore.EClass) domainPackage.getEClassifier("IComment");
   IComment value = (IComment) domainFactory.create(domainEClass);
   value.setCDAType((org.openhealthtools.mdht.uml.cda.Act) eObject);
   this.getCDAType().addAct((org.openhealthtools.mdht.uml.cda.Act) eObject);
   return value;
 }
  /**
   * 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 DawnGmfGenmodelPackage#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 DawnGmfGenmodelPackage init() {
    if (isInited) {
      return (DawnGmfGenmodelPackage)
          EPackage.Registry.INSTANCE.getEPackage(DawnGmfGenmodelPackage.eNS_URI);
    }

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

    isInited = true;

    // Initialize simple dependencies
    DawngenmodelPackage.eINSTANCE.eClass();
    GMFGenPackage.eINSTANCE.eClass();

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

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

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

    // Update the registry and return the package
    EPackage.Registry.INSTANCE.put(DawnGmfGenmodelPackage.eNS_URI, theDawnGmfGenmodelPackage);
    return theDawnGmfGenmodelPackage;
  }
  @Override
  protected boolean readElement(IConfigurationElement element, boolean add) {
    if (element.getName().equals(TAG_RESOURCE)) {
      String packageURI = element.getAttribute(ATT_URI);
      if (packageURI == null) {
        logMissingAttribute(element, ATT_URI);
      } else if (element.getAttribute(ATT_LOCATION) == null) {
        logMissingAttribute(element, ATT_LOCATION);
      } else if (add) {
        Object previous =
            EPackage.Registry.INSTANCE.put(
                packageURI, new EPackageDescriptor.Dynamic(element, ATT_LOCATION));
        if (previous instanceof PluginClassDescriptor) {
          PluginClassDescriptor descriptor = (PluginClassDescriptor) previous;
          EcorePlugin.INSTANCE.log(
              "Both '"
                  + descriptor.element.getContributor().getName()
                  + "' and '"
                  + element.getContributor().getName()
                  + "' register a package for '"
                  + packageURI
                  + "'");
        }

        return true;
      } else {
        EPackage.Registry.INSTANCE.remove(packageURI);
        return true;
      }
    }

    return false;
  }
 @Override
 public Injector createInjectorAndDoEMFRegistration() {
   EPackage.Registry.INSTANCE.put(TaskPackage.eNS_URI, TaskPackage.eINSTANCE);
   EPackage.Registry.INSTANCE.put(QueryPackage.eNS_URI, QueryPackage.eINSTANCE);
   new QueryStandaloneSetup().createInjectorAndDoEMFRegistration();
   return super.createInjectorAndDoEMFRegistration();
 }
  public void register(Injector injector) {
    if (!EPackage.Registry.INSTANCE.containsKey(
        "http://www.bme.hu/mit/inf/gomrp/statemachine/dsl/text/StateMachineDSL")) {
      EPackage.Registry.INSTANCE.put(
          "http://www.bme.hu/mit/inf/gomrp/statemachine/dsl/text/StateMachineDSL",
          hu.bme
              .mit
              .inf
              .gomrp
              .statemachine
              .dsl
              .text
              .stateMachineDSL
              .StateMachineDSLPackage
              .eINSTANCE);
    }

    org.eclipse.xtext.resource.IResourceFactory resourceFactory =
        injector.getInstance(org.eclipse.xtext.resource.IResourceFactory.class);
    org.eclipse.xtext.resource.IResourceServiceProvider serviceProvider =
        injector.getInstance(org.eclipse.xtext.resource.IResourceServiceProvider.class);
    Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("smbm", resourceFactory);
    org.eclipse.xtext.resource.IResourceServiceProvider.Registry.INSTANCE
        .getExtensionToFactoryMap()
        .put("smbm", serviceProvider);
  }
Пример #11
0
  /**
   * Creates, registers, and initializes the <b>Package</b> for this model, and for any others upon
   * which it depends. Simple dependencies are satisfied by calling this method on all dependent
   * packages before doing anything else. This method drives initialization for interdependent
   * packages directly, in parallel with this package, itself.
   *
   * <p>Of this package and its interdependencies, all packages which have not yet been registered
   * by their URI values are first created and registered. The packages are then initialized in two
   * steps: meta-model objects for all of the packages are created before any are initialized, since
   * one package's meta-model objects may refer to those of another.
   *
   * <p>Invocation of this method will not affect any packages that have already been initialized.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   *
   * @see #eNS_URI
   * @see #createPackageContents()
   * @see #initializePackageContents()
   * @generated
   */
  public static QVTCSTPackage init() {
    if (isInited)
      return (QVTCSTPackage) EPackage.Registry.INSTANCE.getEPackage(QVTCSTPackage.eNS_URI);

    // Obtain or create and register package
    QVTCSTPackageImpl theQVTCSTPackage =
        (QVTCSTPackageImpl)
            (EPackage.Registry.INSTANCE.getEPackage(eNS_URI) instanceof QVTCSTPackageImpl
                ? EPackage.Registry.INSTANCE.getEPackage(eNS_URI)
                : new QVTCSTPackageImpl());

    isInited = true;

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

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

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

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

    return theQVTCSTPackage;
  }
Пример #12
0
  /**
   * 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 RuleEnginePackage#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 RuleEnginePackage init() {
    if (isInited)
      return (RuleEnginePackage) EPackage.Registry.INSTANCE.getEPackage(RuleEnginePackage.eNS_URI);

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

    isInited = true;

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

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

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

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

    // Update the registry and return the package
    EPackage.Registry.INSTANCE.put(RuleEnginePackage.eNS_URI, theRuleEnginePackage);
    return theRuleEnginePackage;
  }
Пример #13
0
  /**
   * 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 LibraryPackage#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 LibraryPackage init() {
    if (isInited)
      return (LibraryPackage) EPackage.Registry.INSTANCE.getEPackage(LibraryPackage.eNS_URI);

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

    isInited = true;

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

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

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

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

    // Update the registry and return the package
    EPackage.Registry.INSTANCE.put(LibraryPackage.eNS_URI, theLibraryPackage);
    return theLibraryPackage;
  }
  /**
   * Creates, registers, and initializes the <b>Package</b> for this model, and for any others upon
   * which it depends. Simple dependencies are satisfied by calling this method on all dependent
   * packages before doing anything else. This method drives initialization for interdependent
   * packages directly, in parallel with this package, itself.
   *
   * <p>Of this package and its interdependencies, all packages which have not yet been registered
   * by their URI values are first created and registered. The packages are then initialized in two
   * steps: meta-model objects for all of the packages are created before any are initialized, since
   * one package's meta-model objects may refer to those of another.
   *
   * <p>Invocation of this method will not affect any packages that have already been initialized.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   *
   * @see #eNS_URI
   * @see #createPackageContents()
   * @see #initializePackageContents()
   * @generated
   */
  public static ScrPackage init() {
    if (isInited) return (ScrPackage) EPackage.Registry.INSTANCE.getEPackage(ScrPackage.eNS_URI);

    // Obtain or create and register package
    ScrPackageImpl theScrPackage =
        (ScrPackageImpl)
            (EPackage.Registry.INSTANCE.getEPackage(eNS_URI) instanceof ScrPackageImpl
                ? EPackage.Registry.INSTANCE.getEPackage(eNS_URI)
                : new ScrPackageImpl());

    isInited = true;

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

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

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

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

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

    return theScrPackage;
  }
  public void register(Injector injector) {

    org.eclipse.xtext.resource.IResourceFactory resourceFactory =
        injector.getInstance(org.eclipse.xtext.resource.IResourceFactory.class);
    org.eclipse.xtext.resource.IResourceServiceProvider serviceProvider =
        injector.getInstance(org.eclipse.xtext.resource.IResourceServiceProvider.class);
    Resource.Factory.Registry.INSTANCE
        .getExtensionToFactoryMap()
        .put("eobjectatoffsettestlanguage", resourceFactory);
    org.eclipse.xtext.resource.IResourceServiceProvider.Registry.INSTANCE
        .getExtensionToFactoryMap()
        .put("eobjectatoffsettestlanguage", serviceProvider);

    if (!EPackage.Registry.INSTANCE.containsKey(
        "http://www.xtext.org/EObjectAtOffsetTestLanguage")) {
      EPackage.Registry.INSTANCE.put(
          "http://www.xtext.org/EObjectAtOffsetTestLanguage",
          org.eclipse
              .xtext
              .resource
              .eObjectAtOffsetTestLanguage
              .EObjectAtOffsetTestLanguagePackage
              .eINSTANCE);
    }
  }
Пример #16
0
  /**
   * 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 MyDslPackage#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 MyDslPackage init() {
    if (isInited)
      return (MyDslPackage) EPackage.Registry.INSTANCE.getEPackage(MyDslPackage.eNS_URI);

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

    isInited = true;

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

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

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

    // Update the registry and return the package
    EPackage.Registry.INSTANCE.put(MyDslPackage.eNS_URI, theMyDslPackage);
    return theMyDslPackage;
  }
Пример #17
0
 /** Subclasses may override. */
 public void initPackages(IRepository repository, List<EPackage> packages) {
   for (String nsURI : new HashSet<String>(EPackage.Registry.INSTANCE.keySet())) {
     if (isInitialPackage(repository, nsURI)) {
       EPackage ePackage = EPackage.Registry.INSTANCE.getEPackage(nsURI);
       packages.add(ePackage);
     }
   }
 }
  /**
   * 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 StatesPackage#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 StatesPackage init() {
    if (isInited)
      return (StatesPackage) EPackage.Registry.INSTANCE.getEPackage(StatesPackage.eNS_URI);

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

    isInited = true;

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

    // Obtain or create and register interdependencies
    ArduinoTracePackageImpl theArduinoTracePackage =
        (ArduinoTracePackageImpl)
            (EPackage.Registry.INSTANCE.getEPackage(ArduinoTracePackage.eNS_URI)
                    instanceof ArduinoTracePackageImpl
                ? EPackage.Registry.INSTANCE.getEPackage(ArduinoTracePackage.eNS_URI)
                : ArduinoTracePackage.eINSTANCE);
    StepsPackageImpl theStepsPackage =
        (StepsPackageImpl)
            (EPackage.Registry.INSTANCE.getEPackage(StepsPackage.eNS_URI)
                    instanceof StepsPackageImpl
                ? EPackage.Registry.INSTANCE.getEPackage(StepsPackage.eNS_URI)
                : StepsPackage.eINSTANCE);
    ArduinoPackageImpl theArduinoPackage_1 =
        (ArduinoPackageImpl)
            (EPackage.Registry.INSTANCE.getEPackage(
                        arduinoTrace.States.arduino.ArduinoPackage.eNS_URI)
                    instanceof ArduinoPackageImpl
                ? EPackage.Registry.INSTANCE.getEPackage(
                    arduinoTrace.States.arduino.ArduinoPackage.eNS_URI)
                : arduinoTrace.States.arduino.ArduinoPackage.eINSTANCE);

    // Create package meta-data objects
    theStatesPackage.createPackageContents();
    theArduinoTracePackage.createPackageContents();
    theStepsPackage.createPackageContents();
    theArduinoPackage_1.createPackageContents();

    // Initialize created meta-data
    theStatesPackage.initializePackageContents();
    theArduinoTracePackage.initializePackageContents();
    theStepsPackage.initializePackageContents();
    theArduinoPackage_1.initializePackageContents();

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

    // Update the registry and return the package
    EPackage.Registry.INSTANCE.put(StatesPackage.eNS_URI, theStatesPackage);
    return theStatesPackage;
  }
  /**
   * 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 EnactmentPackage#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 EnactmentPackage init() {
    if (isInited)
      return (EnactmentPackage) EPackage.Registry.INSTANCE.getEPackage(EnactmentPackage.eNS_URI);

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

    isInited = true;

    // Initialize simple dependencies
    TasksPackage.eINSTANCE.eClass();
    NormInstancesPackage.eINSTANCE.eClass();
    ServicePackage.eINSTANCE.eClass();

    // Obtain or create and register interdependencies
    ActionPackageImpl theActionPackage =
        (ActionPackageImpl)
            (EPackage.Registry.INSTANCE.getEPackage(ActionPackage.eNS_URI)
                    instanceof ActionPackageImpl
                ? EPackage.Registry.INSTANCE.getEPackage(ActionPackage.eNS_URI)
                : ActionPackage.eINSTANCE);
    EventPackageImpl theEventPackage =
        (EventPackageImpl)
            (EPackage.Registry.INSTANCE.getEPackage(EventPackage.eNS_URI)
                    instanceof EventPackageImpl
                ? EPackage.Registry.INSTANCE.getEPackage(EventPackage.eNS_URI)
                : EventPackage.eINSTANCE);
    FactPackageImpl theFactPackage =
        (FactPackageImpl)
            (EPackage.Registry.INSTANCE.getEPackage(FactPackage.eNS_URI) instanceof FactPackageImpl
                ? EPackage.Registry.INSTANCE.getEPackage(FactPackage.eNS_URI)
                : FactPackage.eINSTANCE);

    // Create package meta-data objects
    theEnactmentPackage.createPackageContents();
    theActionPackage.createPackageContents();
    theEventPackage.createPackageContents();
    theFactPackage.createPackageContents();

    // Initialize created meta-data
    theEnactmentPackage.initializePackageContents();
    theActionPackage.initializePackageContents();
    theEventPackage.initializePackageContents();
    theFactPackage.initializePackageContents();

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

    // Update the registry and return the package
    EPackage.Registry.INSTANCE.put(EnactmentPackage.eNS_URI, theEnactmentPackage);
    return theEnactmentPackage;
  }
Пример #20
0
class Libraries extends Plugin {

  public static final String OCL_LIBRARY_PACKAGE =
      EPackage.Registry.INSTANCE.get(EcoreEnvironment.OCL_STANDARD_LIBRARY_NS_URI)
              instanceof EPackage
          ? ((EPackage)
                  EPackage.Registry.INSTANCE.get(EcoreEnvironment.OCL_STANDARD_LIBRARY_NS_URI))
              .getName()
          : "oclstdlib"; //$NON-NLS-1$
}
 private void initProjectsAndMetamodels() {
   for (IProject project : ((INewRefactoringWizard) getWizard()).getProjects()) {
     projectCombo.add(project.getName());
   }
   Object[] metamodelObjects =
       EPackage.Registry.INSTANCE.keySet().toArray(new Object[EPackage.Registry.INSTANCE.size()]);
   Arrays.sort(metamodelObjects);
   for (Object object : metamodelObjects) {
     metamodelCombo.add(object.toString());
   }
 }
Пример #22
0
  /**
   * 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 EditorPackage#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 EditorPackage init() {
    if (isInited)
      return (EditorPackage) EPackage.Registry.INSTANCE.getEPackage(EditorPackage.eNS_URI);

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

    isInited = true;

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

    // Obtain or create and register interdependencies
    MIDPackageImpl theMIDPackage =
        (MIDPackageImpl)
            (EPackage.Registry.INSTANCE.getEPackage(MIDPackage.eNS_URI) instanceof MIDPackageImpl
                ? EPackage.Registry.INSTANCE.getEPackage(MIDPackage.eNS_URI)
                : MIDPackage.eINSTANCE);
    RelationshipPackageImpl theRelationshipPackage =
        (RelationshipPackageImpl)
            (EPackage.Registry.INSTANCE.getEPackage(RelationshipPackage.eNS_URI)
                    instanceof RelationshipPackageImpl
                ? EPackage.Registry.INSTANCE.getEPackage(RelationshipPackage.eNS_URI)
                : RelationshipPackage.eINSTANCE);
    OperatorPackageImpl theOperatorPackage =
        (OperatorPackageImpl)
            (EPackage.Registry.INSTANCE.getEPackage(OperatorPackage.eNS_URI)
                    instanceof OperatorPackageImpl
                ? EPackage.Registry.INSTANCE.getEPackage(OperatorPackage.eNS_URI)
                : OperatorPackage.eINSTANCE);

    // Create package meta-data objects
    theEditorPackage.createPackageContents();
    theMIDPackage.createPackageContents();
    theRelationshipPackage.createPackageContents();
    theOperatorPackage.createPackageContents();

    // Initialize created meta-data
    theEditorPackage.initializePackageContents();
    theMIDPackage.initializePackageContents();
    theRelationshipPackage.initializePackageContents();
    theOperatorPackage.initializePackageContents();

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

    // Update the registry and return the package
    EPackage.Registry.INSTANCE.put(EditorPackage.eNS_URI, theEditorPackage);
    return theEditorPackage;
  }
Пример #23
0
  public static Set<EPackage> getAllPackages() {
    Set<EPackage> result = new HashSet<EPackage>();
    Set<String> nsURIs = new HashSet(EPackage.Registry.INSTANCE.keySet());
    for (String nsURI : nsURIs) {
      EPackage ePackage = EPackage.Registry.INSTANCE.getEPackage(nsURI);
      result.add(ePackage);
      collectSubPackages(ePackage, result);
    }

    return result;
  }
  public static void standalone(EPackage... metaModels) {
    for (EPackage metaModel : metaModels) {
      EPackage.Registry.INSTANCE.put(metaModel.getNsURI(), metaModel);
    }
    EPackage.Registry.INSTANCE.put(EcorePackage.eINSTANCE.getNsURI(), EcorePackage.eINSTANCE);
    Resource.Factory.Registry.INSTANCE
        .getExtensionToFactoryMap()
        .put("ecore", new XMIResourceFactoryImpl());

    instance = new EmfFragActivator();
    instance.init();
  }
  public void register(Injector injector) {
    if (!EPackage.Registry.INSTANCE.containsKey("http://www.xtext.org/builddsl")) {
      EPackage.Registry.INSTANCE.put("http://www.xtext.org/builddsl", BuildPackage.eINSTANCE);
    }
    IResourceFactory resourceFactory = injector.getInstance(IResourceFactory.class);
    IResourceServiceProvider serviceProvider = injector.getInstance(IResourceServiceProvider.class);

    Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("build", resourceFactory);
    IResourceServiceProvider.Registry.INSTANCE
        .getExtensionToFactoryMap()
        .put("build", serviceProvider);
  }
  /**
   * 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 CinematicPackage#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 CinematicPackage init() {
    if (isInited)
      return (CinematicPackage) EPackage.Registry.INSTANCE.getEPackage(CinematicPackage.eNS_URI);

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

    isInited = true;

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

    // Obtain or create and register interdependencies
    ViewPackageImpl theViewPackage =
        (ViewPackageImpl)
            (EPackage.Registry.INSTANCE.getEPackage(ViewPackage.eNS_URI) instanceof ViewPackageImpl
                ? EPackage.Registry.INSTANCE.getEPackage(ViewPackage.eNS_URI)
                : ViewPackage.eINSTANCE);
    FlowPackageImpl theFlowPackage =
        (FlowPackageImpl)
            (EPackage.Registry.INSTANCE.getEPackage(FlowPackage.eNS_URI) instanceof FlowPackageImpl
                ? EPackage.Registry.INSTANCE.getEPackage(FlowPackage.eNS_URI)
                : FlowPackage.eINSTANCE);
    ToolkitsPackageImpl theToolkitsPackage =
        (ToolkitsPackageImpl)
            (EPackage.Registry.INSTANCE.getEPackage(ToolkitsPackage.eNS_URI)
                    instanceof ToolkitsPackageImpl
                ? EPackage.Registry.INSTANCE.getEPackage(ToolkitsPackage.eNS_URI)
                : ToolkitsPackage.eINSTANCE);

    // Create package meta-data objects
    theCinematicPackage.createPackageContents();
    theViewPackage.createPackageContents();
    theFlowPackage.createPackageContents();
    theToolkitsPackage.createPackageContents();

    // Initialize created meta-data
    theCinematicPackage.initializePackageContents();
    theViewPackage.initializePackageContents();
    theFlowPackage.initializePackageContents();
    theToolkitsPackage.initializePackageContents();

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

    // Update the registry and return the package
    EPackage.Registry.INSTANCE.put(CinematicPackage.eNS_URI, theCinematicPackage);
    return theCinematicPackage;
  }
Пример #27
0
  /**
   * 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 MmPackage#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 MmPackage init() {
    if (isInited) return (MmPackage) EPackage.Registry.INSTANCE.getEPackage(MmPackage.eNS_URI);

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

    isInited = true;

    // Obtain or create and register interdependencies
    PictogramsPackageImpl thePictogramsPackage =
        (PictogramsPackageImpl)
            (EPackage.Registry.INSTANCE.getEPackage(PictogramsPackage.eNS_URI)
                    instanceof PictogramsPackageImpl
                ? EPackage.Registry.INSTANCE.getEPackage(PictogramsPackage.eNS_URI)
                : PictogramsPackage.eINSTANCE);
    AlgorithmsPackageImpl theAlgorithmsPackage =
        (AlgorithmsPackageImpl)
            (EPackage.Registry.INSTANCE.getEPackage(AlgorithmsPackage.eNS_URI)
                    instanceof AlgorithmsPackageImpl
                ? EPackage.Registry.INSTANCE.getEPackage(AlgorithmsPackage.eNS_URI)
                : AlgorithmsPackage.eINSTANCE);
    StylesPackageImpl theStylesPackage =
        (StylesPackageImpl)
            (EPackage.Registry.INSTANCE.getEPackage(StylesPackage.eNS_URI)
                    instanceof StylesPackageImpl
                ? EPackage.Registry.INSTANCE.getEPackage(StylesPackage.eNS_URI)
                : StylesPackage.eINSTANCE);

    // Create package meta-data objects
    theMmPackage.createPackageContents();
    thePictogramsPackage.createPackageContents();
    theAlgorithmsPackage.createPackageContents();
    theStylesPackage.createPackageContents();

    // Initialize created meta-data
    theMmPackage.initializePackageContents();
    thePictogramsPackage.initializePackageContents();
    theAlgorithmsPackage.initializePackageContents();
    theStylesPackage.initializePackageContents();

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

    // Update the registry and return the package
    EPackage.Registry.INSTANCE.put(MmPackage.eNS_URI, theMmPackage);
    return theMmPackage;
  }
 @Override
 protected List<EPackage> getEPackages() {
   List<EPackage> result = new ArrayList<EPackage>();
   result.add(
       EPackage.Registry.INSTANCE.getEPackage(
           "http://www.eclipse.org/qvt/pivot/1.0/QVTOperationalCS"));
   result.add(EPackage.Registry.INSTANCE.getEPackage("http://www.eclipse.org/ocl/2015/BaseCS"));
   result.add(
       EPackage.Registry.INSTANCE.getEPackage("http://www.eclipse.org/ocl/2015/EssentialOCLCS"));
   result.add(
       EPackage.Registry.INSTANCE.getEPackage(
           "http://www.eclipse.org/qvt/pivot/1.0/ImperativeOCLCS"));
   return result;
 }
  public void register(Injector injector) {
    if (!EPackage.Registry.INSTANCE.containsKey("http://www.bundleDsl.com/BundleDsl")) {
      EPackage.Registry.INSTANCE.put(
          "http://www.bundleDsl.com/BundleDsl", com.bundleDsl.bundleDsl.BundleDslPackage.eINSTANCE);
    }

    org.eclipse.xtext.resource.IResourceFactory resourceFactory =
        injector.getInstance(org.eclipse.xtext.resource.IResourceFactory.class);
    org.eclipse.xtext.resource.IResourceServiceProvider serviceProvider =
        injector.getInstance(org.eclipse.xtext.resource.IResourceServiceProvider.class);
    Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("bdsl", resourceFactory);
    org.eclipse.xtext.resource.IResourceServiceProvider.Registry.INSTANCE
        .getExtensionToFactoryMap()
        .put("bdsl", serviceProvider);
  }
  public void register(Injector injector) {
    if (!EPackage.Registry.INSTANCE.containsKey("http://www.caltoopia.org/frontend/Cal")) {
      EPackage.Registry.INSTANCE.put(
          "http://www.caltoopia.org/frontend/Cal", org.caltoopia.frontend.cal.CalPackage.eINSTANCE);
    }

    org.eclipse.xtext.resource.IResourceFactory resourceFactory =
        injector.getInstance(org.eclipse.xtext.resource.IResourceFactory.class);
    org.eclipse.xtext.resource.IResourceServiceProvider serviceProvider =
        injector.getInstance(org.eclipse.xtext.resource.IResourceServiceProvider.class);
    Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("cal", resourceFactory);
    org.eclipse.xtext.resource.IResourceServiceProvider.Registry.INSTANCE
        .getExtensionToFactoryMap()
        .put("cal", serviceProvider);
  }