@Test public void addModel() throws IOException { repository.addModel("SuperBrewer3000.json", CoffeeFactory.eINSTANCE.createBrewingUnit()); assertTrue(repository.hasModel("SuperBrewer3000.json")); }
public void addModel(final String modeluri, final EObject model) throws IOException { final Resource resource = resourceSet.createResource(createURI(modeluri)); resourceSet.getResources().add(resource); resource.getContents().add(model); resource.save(null); }
ModelRepository { public void addModel(final String modeluri, final EObject model) throws IOException { final Resource resource = resourceSet.createResource(createURI(modeluri)); resourceSet.getResources().add(resource); resource.getContents().add(model); resource.save(null); } }
ModelRepository { public void addModel(final String modeluri, final EObject model) throws IOException { final Resource resource = resourceSet.createResource(createURI(modeluri)); resourceSet.getResources().add(resource); resource.getContents().add(model); resource.save(null); } @Inject  ModelRepository(final AdapterFactory adapterFactory, final ServerConfiguration serverConfiguration,
      final ResourceManager resourceManager); }
ModelRepository { public void addModel(final String modeluri, final EObject model) throws IOException { final Resource resource = resourceSet.createResource(createURI(modeluri)); resourceSet.getResources().add(resource); resource.getContents().add(model); resource.save(null); } @Inject  ModelRepository(final AdapterFactory adapterFactory, final ServerConfiguration serverConfiguration,
      final ResourceManager resourceManager); void initialize(final String workspaceRoot, final boolean clearResources); Optional<EObject> getModel(final String modeluri); @SuppressWarnings("checkstyle:IllegalCatch") Optional<Resource> loadResource(final String modeluri); Map<URI, EObject> getAllModels(); void addModel(final String modeluri, final EObject model); Optional<Resource> updateModel(final String modeluri, final EObject model); void updateModel(final String modelURI, final CCommand command); void removeModel(final String modeluri); boolean saveModel(final String modeluri); Set<String> getAllModelUris(); }
ModelRepository { public void addModel(final String modeluri, final EObject model) throws IOException { final Resource resource = resourceSet.createResource(createURI(modeluri)); resourceSet.getResources().add(resource); resource.getContents().add(model); resource.save(null); } @Inject  ModelRepository(final AdapterFactory adapterFactory, final ServerConfiguration serverConfiguration,
      final ResourceManager resourceManager); void initialize(final String workspaceRoot, final boolean clearResources); Optional<EObject> getModel(final String modeluri); @SuppressWarnings("checkstyle:IllegalCatch") Optional<Resource> loadResource(final String modeluri); Map<URI, EObject> getAllModels(); void addModel(final String modeluri, final EObject model); Optional<Resource> updateModel(final String modeluri, final EObject model); void updateModel(final String modelURI, final CCommand command); void removeModel(final String modeluri); boolean saveModel(final String modeluri); Set<String> getAllModelUris();  }