import org.simantics.db.WriteGraph;
import org.simantics.db.common.utils.NameUtils;
import org.simantics.db.exception.DatabaseException;
+import org.simantics.db.layer0.exception.InvalidVariableException;
+import org.simantics.db.layer0.exception.MissingVariableException;
+import org.simantics.db.layer0.exception.MissingVariableValueException;
+import org.simantics.db.layer0.exception.NonWritableVariableException;
import org.simantics.db.layer0.request.PropertyInfo;
import org.simantics.db.layer0.variable.RVI.RVIPart;
import org.simantics.db.layer0.variable.Variables.Role;
@Override
public <T> T getPropertyValue(ReadGraph graph, String name) throws DatabaseException {
- throw new DatabaseException("Could not resolve property " + name);
+ throw new MissingVariableValueException("Could not resolve property " + name);
}
@Override
public <T> T getPropertyValue(ReadGraph graph, Resource property) throws DatabaseException {
- throw new DatabaseException("Could not resolve property " + NameUtils.getSafeName(graph, property, true));
+ throw new MissingVariableValueException("Could not resolve property " + NameUtils.getSafeName(graph, property, true));
}
@Override
public <T> T getPossiblePropertyValue(ReadGraph graph, String name) throws DatabaseException {
- throw new DatabaseException("Could not resolve property " + name);
+ throw new MissingVariableValueException("Could not resolve property " + name);
}
@Override
public <T> T getPossiblePropertyValue(ReadGraph graph, Resource property) throws DatabaseException {
- throw new DatabaseException("Could not resolve property " + NameUtils.getSafeName(graph, property, true));
+ throw new MissingVariableValueException("Could not resolve property " + NameUtils.getSafeName(graph, property, true));
}
@Override
public <T> T getPropertyValue(ReadGraph graph, String name, Binding binding) throws DatabaseException {
- throw new DatabaseException("Could not resolve property " + name);
+ throw new MissingVariableValueException("Could not resolve property " + name);
}
@Override
public <T> T getPropertyValue(ReadGraph graph, Resource property, Binding binding) throws DatabaseException {
- throw new DatabaseException("Could not resolve property " + NameUtils.getSafeName(graph, property, true));
+ throw new MissingVariableValueException("Could not resolve property " + NameUtils.getSafeName(graph, property, true));
}
@Override
public <T> T getPossiblePropertyValue(ReadGraph graph, String name, Binding binding) throws DatabaseException {
- throw new DatabaseException("Could not resolve property " + name);
+ throw new MissingVariableValueException("Could not resolve property " + name);
}
@Override
@Override
public void setValue(WriteGraph graph, Object value, Binding binding) throws DatabaseException {
- throw new DatabaseException("Not supported");
+ throw new NonWritableVariableException("Not supported");
}
@Override
public void setValue(WriteGraph graph, Object value) throws DatabaseException {
- throw new DatabaseException("Not supported");
+ throw new NonWritableVariableException("Not supported");
}
@Override
public void setPropertyValue(WriteGraph graph, String name, Object value, Binding binding) throws DatabaseException {
- throw new DatabaseException("Not supported");
+ throw new NonWritableVariableException("Not supported");
}
@Override
public void setPropertyValue(WriteGraph graph, Resource property, Object value, Binding binding) throws DatabaseException {
- throw new DatabaseException("Not supported");
+ throw new NonWritableVariableException("Not supported");
}
@Override
public void setPropertyValue(WriteGraph graph, String name, Object value) throws DatabaseException {
- throw new DatabaseException("Not supported");
+ throw new NonWritableVariableException("Not supported");
}
@Override
public void setPropertyValue(WriteGraph graph, Resource property, Object value) throws DatabaseException {
- throw new DatabaseException("Not supported");
+ throw new NonWritableVariableException("Not supported");
}
@Override
public Variable getChild(ReadGraph graph, String name) throws DatabaseException {
- throw new DatabaseException("Could not resolve child " + name);
+ throw new MissingVariableException("Could not resolve child " + name, getPossibleRepresents(graph));
}
@Override
@Override
public Variable getProperty(ReadGraph graph, String name) throws DatabaseException {
- throw new DatabaseException("Could not resolve property " + name);
+ throw new MissingVariableException("Could not resolve property " + name, getPossibleRepresents(graph));
}
@Override
public Variable getProperty(ReadGraph graph, Resource property) throws DatabaseException {
- throw new DatabaseException("Could not resolve property " + NameUtils.getSafeName(graph, property, true));
+ throw new MissingVariableException("Could not resolve property " + NameUtils.getSafeName(graph, property, true), getPossibleRepresents(graph));
}
@Override
public Variable browse(ReadGraph graph, String suffix) throws DatabaseException {
if (suffix.isEmpty())
return this;
- throw new DatabaseException("Could not browse with suffix '" + suffix + "'");
+ throw new MissingVariableException("Could not browse with suffix '" + suffix + "'", getPossibleRepresents(graph));
}
@Override
@Override
public Variable browse(ReadGraph graph, Resource config) throws DatabaseException {
- throw new DatabaseException("Could not browse '" + NameUtils.getSafeName(graph, config, true) + "'");
+ throw new MissingVariableException("Could not browse '" + NameUtils.getSafeName(graph, config, true) + "'", getPossibleRepresents(graph));
}
@Override
@Override
public Variable resolve(ReadGraph graph, RVIPart part) throws DatabaseException {
- throw new DatabaseException("not supported");
+ throw new InvalidVariableException("not supported");
}
@Override
@Override
public String getLabel(ReadGraph graph) throws DatabaseException {
- throw new DatabaseException("not supported");
+ throw new InvalidVariableException("not supported");
}
@Override
@Override
public Variable getPredicate(ReadGraph graph) throws DatabaseException {
- throw new DatabaseException("not supported");
+ throw new InvalidVariableException("not supported");
}
@Override
public Variable getPossiblePredicate(ReadGraph graph) throws DatabaseException {
- throw new DatabaseException("not supported");
+ throw new InvalidVariableException("not supported");
}
@Override
public Resource getPredicateResource(ReadGraph graph) throws DatabaseException {
- throw new DatabaseException("not supported");
+ throw new InvalidVariableException("not supported");
}
@Override
@Override
public Resource getRepresents(ReadGraph graph) throws DatabaseException {
- throw new DatabaseException("no resource representation");
+ throw new InvalidVariableException("no resource representation");
}
@Override
@Override
public Resource getType(ReadGraph graph) throws DatabaseException {
- throw new DatabaseException("not supported");
+ throw new InvalidVariableException("not supported");
}
@Override
@Override
public Resource getType(ReadGraph graph, Resource baseType) throws DatabaseException {
- throw new DatabaseException("not supported");
+ throw new InvalidVariableException("not supported");
}
@Override