public void setValue(String xpath, Object value) throws PreceptorViolationException, InvalidXPathSyntaxException {
setValue(xpath, value, null);
}
public void setValue(String xpath, Object value, Context context) throws PreceptorViolationException, InvalidXPathSyntaxException {
Node node = (Node) index.get(xpath);
if (node != null) {
node.setValue((String) value);
}
else {
if (preceptor != null) {
getLogger().debug("checking preceptor for [" + String.valueOf(xpath) + "]");
if (preceptor.isValidNode(xpath)) {
node = createNode(xpath);
node.setValue((String) value);
}
else {
throw new PreceptorViolationException("[" + String.valueOf(xpath) + "] is prohibited by preceptor");
}
}
else {
getLogger().debug("no preceptor");
node = createNode(xpath);
node.setValue((String) value);
}
}
}