Package org.eclipse.emf.ecore.xmi.impl

Examples of org.eclipse.emf.ecore.xmi.impl.XMIResourceFactoryImpl


   */
  public static TypeSystemDescription ecore2UimaTypeSystem(String aEcoreFilePath, Map aOptions)
          throws URISyntaxException {
    // register default resource factory
    Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("*",
            new XMIResourceFactoryImpl());
    // create resource set to hold the resource we're loading and its dependent resources
    ResourceSet resourceSet = new ResourceSetImpl();
    // convert file path to absolute path -- seems to be required for propery proxy resolution
    File inputFile = new File(aEcoreFilePath);
    URI absoluteInputURI = URI.createFileURI(inputFile.getAbsolutePath());
View Full Code Here


  @BeforeClass
  public static void setup() throws IOException{
   
    Map<String,Object> map = Factory.Registry.INSTANCE.getExtensionToFactoryMap();
    map.put("simTL4J", new SimTL4JResourceFactory());
    map.put("xmi", new XMIResourceFactoryImpl());
    map.put("ecore", new  XMIResourceFactoryImpl());
   
    EPackage.Registry.INSTANCE.put("http://www.emftext.org/java/", JavaPackage.eINSTANCE);
   
    ResourceSet resourceSet = new ResourceSetImpl();
    Resource umlMetamodel = resourceSet.createResource(
View Full Code Here

    save("output/inputModel.xmi",getTemplate().getInputModel("model").getModelResource());
  }
 
  private void save(String path, Resource r) throws Exception{
    ResourceSet resourceSet = new ResourceSetImpl();
      resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put("*", new XMIResourceFactoryImpl());

      URI uri = URI.createFileURI(new File(path).getAbsolutePath());
      Resource resource = resourceSet.createResource(uri);
      Vector<EObject> rootObjects = new Vector<EObject>();
      for(EObject root : r.getContents()){
View Full Code Here

  @BeforeClass
  public static void setup() throws IOException{
   
    Map<String,Object> map = Factory.Registry.INSTANCE.getExtensionToFactoryMap();
    map.put("simTL4J", new SimTL4JResourceFactory());
    map.put("xmi", new XMIResourceFactoryImpl());
    map.put("ecore", new  XMIResourceFactoryImpl());
   
    EPackage.Registry.INSTANCE.put("http://www.emftext.org/java/", JavaPackage.eINSTANCE);
   
    ResourceSet resourceSet = new ResourceSetImpl();
    Resource umlMetamodel = resourceSet.createResource(resolveURI(URI.createURI("file://input/Metamodel_uml.ecore")));
View Full Code Here

  @BeforeClass
  public static void setup() throws IOException{
   
    Map<String,Object> map = Factory.Registry.INSTANCE.getExtensionToFactoryMap();
    map.put("simTL4J", new SimTL4JResourceFactory());
    map.put("xmi", new XMIResourceFactoryImpl());
    map.put("ecore", new  XMIResourceFactoryImpl());
   
    EPackage.Registry.INSTANCE.put("http://www.emftext.org/java/", JavaPackage.eINSTANCE);
   
    ResourceSet resourceSet = new ResourceSetImpl();
    Resource umlMetamodel = resourceSet.createResource(
View Full Code Here

      if (writeEcoreTypeSystem && !isModelGenerated) {
        TypeSystemDescription tsDesc = TypeSystemUtil.typeSystem2TypeSystemDescription(aCas
                .getTypeSystem());
        // register default resource factory
        Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("*",
                new XMIResourceFactoryImpl());
        ResourceSet resourceSet = new ResourceSetImpl();
        URI outputURI = URI.createFileURI(new File(mOutputDir, "typesystem.ecore")
                .getAbsolutePath());
        Resource outputResource = resourceSet.createResource(outputURI);
        schemaLocationMap = new HashMap();
View Full Code Here

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

    // Register the package to ensure it is available during loading.
    //
    resourceSet.getPackageRegistry().put
      (TurtlePackage.eNS_URI,
View Full Code Here

      if (writeEcoreTypeSystem && !isModelGenerated) {
        TypeSystemDescription tsDesc = TypeSystemUtil.typeSystem2TypeSystemDescription(aCas
                .getTypeSystem());
        // register default resource factory
        Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("*",
                new XMIResourceFactoryImpl());
        ResourceSet resourceSet = new ResourceSetImpl();
        URI outputURI = URI.createFileURI(new File(mOutputDir, "typesystem.ecore")
                .getAbsolutePath());
        Resource outputResource = resourceSet.createResource(outputURI);
        schemaLocationMap = new HashMap();
View Full Code Here

   *            file to write the Model to
   */
  protected static void save(EList<? extends EObject> model, String fileName) {
    UMLResourcesUtil.init(RESOURCE_SET); // MDT/UML2 4.0.0 (Juno)
    Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put(
        "xmi", new XMIResourceFactoryImpl()); //$NON-NLS-1$
    Resource resource = RESOURCE_SET.createResource(URI
        .createFileURI(fileName));
    resource.getContents().addAll(model);

    try {
View Full Code Here

    m_oOpts.put(XMLResource.OPTION_SCHEMA_LOCATION, Boolean.TRUE);
    m_oOpts.put(XMLResource.OPTION_ENCODING, "UTF-8");

    Resource.Factory.Registry reg = Resource.Factory.Registry.INSTANCE;
    Map<String, Object> m = reg.getExtensionToFactoryMap();
    m.put(Resource.Factory.Registry.DEFAULT_EXTENSION, new XMIResourceFactoryImpl());
  }
View Full Code Here

TOP

Related Classes of org.eclipse.emf.ecore.xmi.impl.XMIResourceFactoryImpl

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.