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

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


 
 
 
  public void reload() {
         
    resourceSet = new ResourceSetImpl();
    read();
  }
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

          @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

   *
   * @param fileName
   */
  public void loadSourceModel(String fileName){ 
    File sourceModelFile = new File (fileName);
    ResourceSet rSet = new ResourceSetImpl ();
    rSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put("*", _xmiFac);
    URI uri = URI.createFileURI(sourceModelFile.getAbsolutePath());
   
    Resource resource = null;
   
    try{
      resource = rSet.getResource(uri, true);
    }
    catch (Exception e) {
      // TODO: handle exception
      e.printStackTrace();
    }
View Full Code Here

   *
   * @param fileName
   */
  public void loadSourceModel(String fileName){ 
    File sourceModelFile = new File (fileName);
    ResourceSet rSet = new ResourceSetImpl ();
    rSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put("*", _xmiFac);
    URI uri = URI.createFileURI(sourceModelFile.getAbsolutePath());
    Resource resource = rSet.getResource(uri, true);
    if (resource != null) {
      if (resource.getContents().size() > 0) {
        sourceModel = (EObject) resource.getContents().get(0);
      }
    }
View Full Code Here

  public static String toPMML(AssociationRulesProducer associator) {

    // 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();
    pmml.setVersion("4.0");
    pmml.setDataDictionary(_40Factory.eINSTANCE.createDataDictionaryType());
View Full Code Here

    public Definitions getDefinitions(String xml) throws Exception {
        try {
            DroolsFactoryImpl.init();
            BpsimFactoryImpl.init();

            ResourceSet resourceSet = new ResourceSetImpl();
            resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap()
                    .put(Resource.Factory.Registry.DEFAULT_EXTENSION, new JBPMBpmn2ResourceFactoryImpl());
            resourceSet.getPackageRegistry().put("http://www.omg.org/spec/BPMN/20100524/MODEL", Bpmn2Package.eINSTANCE);
            resourceSet.getPackageRegistry().put("http://www.jboss.org/drools", DroolsPackage.eINSTANCE);

            JBPMBpmn2ResourceImpl resource = (JBPMBpmn2ResourceImpl) resourceSet.createResource(URI.createURI("inputStream://dummyUriWithValidSuffix.xml"));
            resource.getDefaultLoadOptions().put(JBPMBpmn2ResourceImpl.OPTION_ENCODING, "UTF-8");
            resource.setEncoding("UTF-8");
            Map<String, Object> options = new HashMap<String, Object>();
            options.put( JBPMBpmn2ResourceImpl.OPTION_ENCODING, "UTF-8" );
            options.put( JBPMBpmn2ResourceImpl.OPTION_DEFER_IDREF_RESOLUTION, true );
View Full Code Here

       * EcoreResourceFactoryImpl());
       * Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("*", new
       * XMIResourceFactoryImpl());
       */
      Activator.log("should not create a new ResourceSetImpl");
      return new ResourceSetImpl();
    }
  }
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.