1 package org.simantics.db.layer0.variable;
3 import org.simantics.db.ReadGraph;
4 import org.simantics.db.Resource;
5 import org.simantics.db.common.adaption.SimpleAdapter;
6 import org.simantics.db.exception.AdaptionException;
7 import org.simantics.db.exception.AssumptionException;
8 import org.simantics.db.exception.DatabaseException;
9 import org.simantics.db.layer0.exception.MissingVariableException;
11 public class URIResourceVariableAdapter extends SimpleAdapter<Variable> {
14 public Variable adapt(ReadGraph g, Resource r) throws DatabaseException {
16 return Variables.getVariable(g, r);
17 } catch (MissingVariableException e) {
18 throw new AdaptionException("Variables.getVariable failed", e);
19 } catch (AssumptionException e) {
20 throw new AdaptionException("Variables.getVariable failed", e);