Package org.eclipse.emf.ecore.resource.impl

Examples of org.eclipse.emf.ecore.resource.impl.ResourceSetImpl


   
    try{
      OCLExpression oExpression = null;
      OCL oOcl = org.eclipse.ocl.uml.OCL.newInstance(
          new UMLEnvironmentFactory(
              new ResourceSetImpl()));
      OCL.Helper helper = oOcl.createOCLHelper();
      //if(in_sExpressionType.compareTo(Configuration.getOCLInvId()) == 0)
      if(in_oContext instanceof org.eclipse.uml2.uml.Class)
      {
        org.eclipse.uml2.uml.Class oClass = (org.eclipse.uml2.uml.Class)in_oContext;
View Full Code Here


  public TestCaseGraphHelper()
  {
    m_oTestGoalMgr = new TestGoalManager();
   
    m_oResourceSet = new ResourceSetImpl();
    m_oResourceEcoreOut= m_oResourceSet.createResource(
        URI.createFileURI(
            Configuration.getEcoreOutput()));
    m_oResourceXMIOut= m_oResourceSet.createResource(
        URI.createFileURI(
View Full Code Here

   
    try{
      OCLExpression oExpression = null;
      OCL oOcl = org.eclipse.ocl.uml.OCL.newInstance(
          new UMLEnvironmentFactory(
              new ResourceSetImpl()));
      OCL.Helper helper = oOcl.createOCLHelper();
      //if(in_sExpressionType.compareTo(Configuration.getOCLInvId()) == 0)
      if(in_oContext instanceof org.eclipse.uml2.uml.Class)
      {
        org.eclipse.uml2.uml.Class oClass = (org.eclipse.uml2.uml.Class)in_oContext;
View Full Code Here

  private StateMachine getReferencedStateMachineFromDiagram(IFile oFile) {
   
    //Open the selected file as UML
    URI uri = URI.createFileURI(oFile.getLocationURI().getPath());
    ResourceSet resSet = new ResourceSetImpl();
    UMLResourcesUtil.init(resSet); // MDT/UML2 4.0.0 (Juno)
    Resource resource = resSet.getResource(uri, true);
    StateMachine oRetValue = null;
   
    //find the first instance of a StateMachine inside the UML file
    TreeIterator<EObject> it = resource.getAllContents();
    while (it.hasNext()) {
View Full Code Here

   *
   * alternative implementation: do not use the formatted output but resource sets
   */
  @Override
  public void startPrintStreams() {
    m_oResourceSet = new ResourceSetImpl();
    m_oResourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put
          (Resource.Factory.Registry.DEFAULT_EXTENSION,
           new TestsuiteexportResourceFactoryImpl());
    m_oResourceSet.getPackageRegistry().put(TestsuiteexportPackage.eNS_URI,
        TestsuiteexportPackage.eINSTANCE);
View Full Code Here

  /**
   * Load a model file directly.
   * Assumes that it will only contain one element (and tests this with JUnit).
   */
  protected EObject loadModelDirectly(String filename) {
    ResourceSet resourceSet = new ResourceSetImpl();
    URI uri = URI.createFileURI(filename);
    Resource resource = resourceSet.getResource(uri, true);
    assertNotNull(resource);
    assertEquals("there should only be one contents in the model file", 1, resource.getContents().size());
    return resource.getContents().get(0);
  }
View Full Code Here

    if((m!=null)&&(m.getName()!=null)) {
      //Setting up the model location
      URI location = buildEMFModelURI(uri, m);
      // Saving the model resource
      resultingEmfResource =
        new ResourceSetImpl().createResource(location);
      monitor.worked(2);
      resultingEmfResource.getContents().add(m);
      try {
        resultingEmfResource.save(null);
      } catch (IOException ioe) {
View Full Code Here

          @Override
          protected void execute(IProgressMonitor progressMonitor) {
            try {
              // Create a resource set
              //
              ResourceSet resourceSet = new ResourceSetImpl();

              // Get the URI of the model file.
              //
              URI fileURI = URI.createPlatformResourceURI(modelFile.getFullPath().toString(), true);

              // Create a resource for this file.
              //
              Resource resource = resourceSet.createResource(fileURI);

              // Add the initial model object to the contents.
              //
              EObject rootObject = createInitialModel();
              if (rootObject != null) {
View Full Code Here

          @Override
          protected void execute(IProgressMonitor progressMonitor) {
            try {
              // Create a resource set
              //
              ResourceSet resourceSet = new ResourceSetImpl();

              // Get the URI of the model file.
              //
              URI fileURI = URI.createPlatformResourceURI(modelFile.getFullPath().toString(), true);

              // Create a resource for this file.
              //
              Resource resource = resourceSet.createResource(fileURI);

              // Add the initial model object to the contents.
              //
              EObject rootObject = createInitialModel();
              if (rootObject != null) {
View Full Code Here

  public static String toPMML(Instances data) {

    // Create a resource set to hold the resources.
    //
    ResourceSet resourceSet = new ResourceSetImpl();

    // Register the appropriate resource factory to handle all file
    // extensions.
    //
    resourceSet
        .getResourceFactoryRegistry()
        .getExtensionToFactoryMap()
        .put(Resource.Factory.Registry.DEFAULT_EXTENSION,
            new _40ResourceFactoryImpl());

    // Register the package to ensure it is available during loading.
    //
    resourceSet.getPackageRegistry().put(_40Package.eNS_URI,
        _40Package.eINSTANCE);

    Resource resource = resourceSet.createResource(URI
        .createURI("http://www.admire-project.eu/PMML-4_0"));

    DocumentRoot documentRoot = _40Factory.eINSTANCE.createDocumentRoot();

    PMMLType pmml = _40Factory.eINSTANCE.createPMMLType();
View Full Code Here

TOP

Related Classes of org.eclipse.emf.ecore.resource.impl.ResourceSetImpl

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.