Examples of XMIResource


Examples of org.eclipse.emf.ecore.xmi.XMIResource

  }

  public static class Factory implements Resource.Factory {

    public Resource createResource(URI uri) {
      XMIResource res = new JexResource(uri);
//      Map defaultLoadOptions = res.getDefaultLoadOptions();
//      defaultLoadOptions.put(XMLResource.OPTION_RECORD_UNKNOWN_FEATURE, Boolean.TRUE);
      return res;
    }
View Full Code Here

Examples of org.eclipse.emf.ecore.xmi.XMIResource

        task.getDeploy().setApplication( ParametersFactory.eINSTANCE.createApplication() );
        task.getDeploy().getApplication().setName( fFirstPage.getProjectName() );       
        task.getDeploy().setInfo( ParametersFactory.eINSTANCE.createInfo() );
        task.setSignjar( AntTasksFactory.eINSTANCE.createSignJar() );
       
        final XMIResource resource= new XMIResourceImpl();
        resource.getContents().add( task );
       
        WorkspaceModifyOperation operation = new WorkspaceModifyOperation() {
          @Override
          public void execute( IProgressMonitor monitor ) {

            if ( !resource.getContents().isEmpty() ) {
              Map<Object, Object> options = new HashMap<Object, Object>();
              options.put(XMIResource.OPTION_USE_XMI_TYPE, Boolean.TRUE);

              ByteArrayOutputStream streamOut = null;
              ByteArrayInputStream streamIn = null;
              try {
                streamOut = new ByteArrayOutputStream();
                resource.save( streamOut, options );
                streamIn = new ByteArrayInputStream( streamOut.toByteArray() );
                buildFile.create( streamIn, true, monitor );
              }
              catch ( IOException | CoreException e ) {
                // TODO Auto-generated catch block
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.