import org.simantics.databoard.binding.Binding;
import org.simantics.databoard.binding.impl.ObjectVariantBinding;
import org.simantics.databoard.type.Datatype;
+import org.simantics.db.DevelopmentKeys;
import org.simantics.db.ReadGraph;
import org.simantics.db.Resource;
import org.simantics.db.WriteGraph;
import org.simantics.db.exception.DatabaseException;
import org.simantics.db.exception.DatatypeNotFoundException;
import org.simantics.db.exception.ValidationException;
-import org.simantics.db.exception.VariableException;
import org.simantics.db.layer0.exception.InvalidVariableException;
import org.simantics.db.layer0.exception.MissingVariableValueException;
import org.simantics.db.layer0.exception.PendingVariableException;
public <T> T getValue(ReadGraph graph) throws DatabaseException {
if(Development.DEVELOPMENT) {
- String error = L0Validations.checkValueType(graph, parentResource, property.predicate);
- if(error != null) {
- LOGGER.error(error);
- //throw new ValidationException(error);
+ if(Development.<Boolean>getProperty(DevelopmentKeys.L0_VALIDATION, Bindings.BOOLEAN)) {
+ String error = L0Validations.checkValueType(graph, parentResource, property.predicate);
+ if(error != null) {
+ LOGGER.error(error);
+ throw new ValidationException(error);
+ }
}
}
return getValue(graph);
if(Development.DEVELOPMENT) {
- String error = L0Validations.checkValueType(graph, parentResource, property.predicate);
- if(error != null) {
- LOGGER.error(error);
- throw new ValidationException(error);
+ if(Development.<Boolean>getProperty(DevelopmentKeys.L0_VALIDATION, Bindings.BOOLEAN)) {
+ String error = L0Validations.checkValueType(graph, parentResource, property.predicate);
+ if(error != null) {
+ LOGGER.error(error);
+ throw new ValidationException(error);
+ }
}
}
public void setValue(WriteGraph graph, Object value, Binding binding) throws DatabaseException {
if(Development.DEVELOPMENT) {
- String error = L0Validations.checkValueType(graph, parentResource, property.predicate);
- if(error != null) {
- LOGGER.error(error);
- //throw new ValidationException(error);
+ if(Development.<Boolean>getProperty(DevelopmentKeys.L0_VALIDATION, Bindings.BOOLEAN)) {
+ String error = L0Validations.checkValueType(graph, parentResource, property.predicate);
+ if(error != null) {
+ LOGGER.error(error);
+ throw new ValidationException(error);
+ }
}
}
public void setValue(WriteGraph graph, Object value) throws DatabaseException {
if(Development.DEVELOPMENT) {
- String error = L0Validations.checkValueType(graph, parentResource, property.predicate);
- if(error != null) {
- LOGGER.error(error);
- throw new ValidationException(error);
+ if(Development.<Boolean>getProperty(DevelopmentKeys.L0_VALIDATION, Bindings.BOOLEAN)) {
+ String error = L0Validations.checkValueType(graph, parentResource, property.predicate);
+ if(error != null) {
+ LOGGER.error(error);
+ throw new ValidationException(error);
+ }
}
}