use of org.iobserve.model.persistence.IModelResource in project iobserve-analysis by research-iobserve.
the class ModelSnapshotWriter method loadModel.
private <T extends EObject> Resource loadModel(final ResourceSet resourceSet, final IModelResource<T> resourceHandler, final Class<T> clazz, final EClass eClass, final EPackage ePackage, final File baseDirectory) throws DBException {
final T model = resourceHandler.getModelRootNode(clazz, eClass);
final URI writeModelURI = URI.createFileURI(String.format("%s%sjpetstore", baseDirectory.toPath().toAbsolutePath().toString(), File.separator));
final Resource resource = resourceSet.createResource(writeModelURI.appendFileExtension(ePackage.getName()));
resource.getContents().add(model);
return resource;
}
use of org.iobserve.model.persistence.IModelResource in project iobserve-analysis by research-iobserve.
the class ModelNeo4JUtil method resolveAll.
public static synchronized void resolveAll(final ResourceSet resourceSet, final IModelResource<?>... modelResources) {
final EList<Resource> resources = resourceSet.getResources();
for (int i = 0; i < resources.size(); i++) {
final Resource resource = resources.get(i);
final TreeIterator<EObject> elements = resource.getAllContents();
while (elements.hasNext()) {
final EObject object = elements.next();
ModelNeo4JUtil.resolve(object, modelResources);
}
}
}
Aggregations