Package org.eclipse.emf.ecore.resource

Examples of org.eclipse.emf.ecore.resource.ResourceSet.createResource()


              //
              ResourceSet resourceSet = new ResourceSetImpl();

              // 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


    List affectedFiles = new LinkedList();
    IPath diagramModelPath = myFileCreationPage.getContainerFullPath()
        .append(myFileCreationPage.getFileName());
    URI diagramModelURI = URI.createFileURI(diagramModelPath.toString());
    ResourceSet resourceSet = myEditingDomain.getResourceSet();
    final Resource diagramResource = resourceSet
        .createResource(diagramModelURI);
    AbstractTransactionalCommand command = new AbstractTransactionalCommand(
        myEditingDomain,
        OntoUML.diagram.part.Messages.OntoUMLNewDiagramFileWizard_InitDiagramCommand,
        affectedFiles) {
View Full Code Here

              //
              ResourceSet resourceSet = new ResourceSetImpl();

              // 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

   * @throws IOException
   */
  public static DataGraph loadDataGraph(InputStream inputStream, Map options) throws IOException
  {
    ResourceSet resourceSet = DataObjectUtil.createResourceSet();
    Resource resource = resourceSet.createResource(URI.createURI("all.datagraph"));
    resource.load(inputStream, options);
    return (DataGraph)resource.getContents().get(0);
  }
 
  /**
 
View Full Code Here

          e.printStackTrace();
        }
      }
    }
 
    resource = (XMLResource)resourceSet.createResource(URI.createURI("http:///temp.xml"));
   
    XMLOptions xmlOptions = new XMLOptionsImpl();
    xmlOptions.setProcessAnyXML(true);
    resource.getDefaultLoadOptions().put(XMLResource.OPTION_XML_OPTIONS, xmlOptions);
View Full Code Here

    ResourceSet resourceSet = DataObjectUtil.createResourceSet();
    URI ecoreURI = URI.createURI("file:///temp.ecore");
    URI genModelURI = ecoreURI.trimFileExtension().appendFileExtension("genmodel");

    Resource ecoreResource = resourceSet.createResource(ecoreURI);
    ecoreResource.getContents().add(ePackage);

    Resource genModelResource = resourceSet.createResource(genModelURI);
    genModelResource.getContents().add(genModel);
View Full Code Here

    URI genModelURI = ecoreURI.trimFileExtension().appendFileExtension("genmodel");

    Resource ecoreResource = resourceSet.createResource(ecoreURI);
    ecoreResource.getContents().add(ePackage);

    Resource genModelResource = resourceSet.createResource(genModelURI);
    genModelResource.getContents().add(genModel);

    generateFromGenModel(genModel, targetDirectory, genOptions);
  }
View Full Code Here

      int length = objectInput.readInt();
      byte [] bytes = new byte [length];
      objectInput.readFully(bytes);

      ResourceSet resourceSet = createResourceSet();
      Resource resource = resourceSet.createResource(URI.createURI("all.datagraph"));
      resource.load(new ByteArrayInputStream(bytes), null);
      eDataGraph = (DataGraphImpl)resource.getContents().get(0);
    }

    protected ResourceSet createResourceSet()
View Full Code Here

  protected List /*Type*/define(InputSource inputSource, String schemaLocation)
  {
    try
    {
      ResourceSet resourceSet = DataObjectUtil.createResourceSet();
      Resource model = resourceSet.createResource(URI.createURI(schemaLocation != null ? schemaLocation : "null.xsd"));
      ((XSDResourceImpl)model).load(inputSource, null);
     
      List newTypes = new ArrayList();
      for (Iterator schemaIter = model.getContents().iterator(); schemaIter.hasNext(); )
      {
View Full Code Here

            resourceSet.getPackageRegistry().put(
                    "http://www.omg.org/spec/BPMN/20100524/MODEL",
                    Bpmn2Package.eINSTANCE);
//            resourceSet.getPackageRegistry().put(DroolsPackage.eNS_URI,
//                    DroolsPackage.eINSTANCE);
            JBPMBpmn2ResourceImpl resource = (JBPMBpmn2ResourceImpl) resourceSet
                    .createResource(URI
                            .createURI("inputStream://dummyUriWithValidSuffix.xml"));
            resource.getDefaultLoadOptions().put(
                    JBPMBpmn2ResourceImpl.OPTION_ENCODING, "UTF-8");
            resource.setEncoding("UTF-8");
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.