Package org.eclipse.emf.ecore.resource

Examples of org.eclipse.emf.ecore.resource.Resource.save()


    File modelFile = new File("test.modeldoc");
        URI fileURI = URI.createFileURI(modelFile
                .getAbsolutePath());
        Resource resource = resourceSet.createResource(fileURI);
        resource.getContents().add(root);
        resource.save(Collections.EMPTY_MAP);
     
    // generate code
    ModeldocCodeGenerator codegen = new ModeldocCodeGenerator();
    IStatus status = codegen.generateCode(modelFile);
    assertTrue("Status was not OK: " + status, status.isOK());
View Full Code Here


      ResourceSet resourceSet = new ResourceSetImpl();
          URI fileURI = URI.createFileURI(new File("test.modeldoc")
                  .getAbsolutePath());
          Resource resource = resourceSet.createResource(fileURI);
          resource.getContents().add(c);
          resource.save(Collections.EMPTY_MAP);
    }
       
        // try loading it!
    EMFClass c2 = null;
    {
View Full Code Here

    File modelFile = new File(filename);
        URI fileURI = URI.createFileURI(modelFile
                .getAbsolutePath());
        Resource resource = resourceSet.createResource(fileURI);
        resource.getContents().add(model);
        resource.save(Collections.EMPTY_MAP);
       
        return modelFile;
  }

  /**
 
View Full Code Here

      }
     
      for (EObject root : rootObjects) {
        resource.getContents().add(root);
      }
      resource.save(null);
  }
 
}
View Full Code Here

  {

    Resource resource = ((DefinitionImpl)wsdlDef).eResource();
    try
    {
      resource.save(sink, null);
    }
    catch (IOException e)
    {
      throw new WSDLException(WSDLException.OTHER_ERROR, "Failed to save Definitions.", e);
    }
View Full Code Here

        } catch (InvalidXMLException e) {
          // this should not happen. TypeSystemUtil.typeSystem2TypeSystemDescription
          // should never produce an invalid TypeSystemDescription!
          throw new UIMARuntimeException(e);
        }
        outputResource.save(null);
        isModelGenerated = true;
      }

      // write XMI
      out = new FileOutputStream(name);
View Full Code Here

              ) {
                Resource nextResource = it.next();
                if (nextResource.isLoaded()
                    && !getEditingDomain().isReadOnly(
                        nextResource)) {
                  nextResource.save(UMLDiagramEditorUtil
                      .getSaveOptions());
                }
              }
            } catch (IOException ex) {
              throw new InvocationTargetException(
View Full Code Here

              // Save the contents of the resource to the file system.
              //
              Map<Object, Object> options = new HashMap<Object, Object>();
              options.put(XMLResource.OPTION_ENCODING, initialObjectCreationPage.getEncoding());
              resource.save(options);
            }
            catch (Exception exception) {
              TurtleEditorPlugin.INSTANCE.log(exception);
            }
            finally {
View Full Code Here

      System.out.println("Enter a list of file paths or URIs that have content like this:");
      try {
        Resource resource = resourceSet.createResource(URI.createURI("http:///My.turtle"));
        Turtle root = TurtleFactory.eINSTANCE.createTurtle();
        resource.getContents().add(root);
        resource.save(System.out, null);
      }
      catch (IOException exception) {
        exception.printStackTrace();
      }
    }
View Full Code Here

        // should
        // need
        // to
        // do
        // this.
        res.save(out, options);
    }

    // private void printHeader(final OutputStream out) throws IOException
    // {
    // final String header = "<md:metadatamodel \n"
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.