public void set(Object object, String xpath, Object value, Class target) throws IllegalAttributeException { if (object instanceof FeatureType) { throw new IllegalAttributeException(null, "feature type is immutable"); } JXPathContext context = JXPathContext.newContext(object); Enumeration declaredPrefixes = namespaces.getDeclaredPrefixes(); while (declaredPrefixes.hasMoreElements()) { String prefix = (String) declaredPrefixes.nextElement(); String uri = namespaces.getURI(prefix); context.registerNamespace(prefix, uri); } context.setValue(xpath, value); assert value == context.getValue(xpath); } }
public void set(Object object, String xpath, Object value, Class target) throws IllegalAttributeException { context(object).setValue(xpath, value); }
public void set(Object object, String xpath, Object value, Class target) throws IllegalAttributeException { context(object).setValue(xpath, value); }
public void set(Object object, String xpath, Object value, Class target) throws IllegalAttributeException { context( object ).setValue( xpath, value ); }
/** * Sets the attribute value on the passed JXPathContext */ public void doSave(Widget frmModel, JXPathContext jxpc) { jxpc.setValue("@" + this.name, this.value); if (getLogger().isDebugEnabled()) { getLogger().debug("done saving " + this); } }
context.setValue(entry.getKey().toString(), entry.getValue());
/** * Set map with its child * * @param path XPath to node * @param map node Map */ public void setMap(String path, Map<String, Object> map) { try { getJXPath().setValue(path, map); } catch (Exception e) { getJXPath().createPathAndSetValue(path, map); } }
/** * Sets the value of the specified node. If the node doesn't exist it is * created. * * @param path XPath to node * @param value value to set */ public void set(String path, String value) { try { getJXPath().setValue(path, value); } catch (Exception e) { getJXPath().createPathAndSetValue(path, value); } }
/** * Set Map on the specified path * * @param path XPath to node * @param map node Map */ public void setJsonMap(String path, Map<String, JsonConfigHelper> map) { for (String key : map.keySet()) { JsonConfigHelper json = map.get(key); try { getJXPath().setValue(path + "/" + key, json.getMap("/")); } catch (Exception e) { getJXPath().createPathAndSetValue(path + "/" + key, json.getMap("/")); } } }
public void set(Object object, String xpath, Object value, Class target) throws IllegalAttributeException { if (object instanceof FeatureType) { throw new IllegalAttributeException("feature type is immutable"); } JXPathContext context = JXPathContext.newContext(object); Enumeration declaredPrefixes = namespaces.getDeclaredPrefixes(); while (declaredPrefixes.hasMoreElements()) { String prefix = (String) declaredPrefixes.nextElement(); String uri = namespaces.getURI(prefix); context.registerNamespace(prefix, uri); } context.setValue(xpath, value); assert value == context.getValue(xpath); } }
public void set(Object object, String xpath, Object value, Class target) throws IllegalAttributeException { if (object instanceof FeatureType) { throw new IllegalAttributeException(null, "feature type is immutable"); } JXPathContext context = JXPathContext.newContext(object); Enumeration declaredPrefixes = namespaces.getDeclaredPrefixes(); while (declaredPrefixes.hasMoreElements()) { String prefix = (String) declaredPrefixes.nextElement(); String uri = namespaces.getURI(prefix); context.registerNamespace(prefix, uri); } context.setValue(xpath, value); assert value == context.getValue(xpath); } }
/** * Move node from one path to another path in the JSON * * @param source XPath to node * @param dest XPath to node */ public void move(String source, String dest) { Object copyValue = getJXPath().getValue(source); getJXPath().removePath(source); try { getJXPath().setValue(dest, copyValue); } catch (Exception e) { getJXPath().createPathAndSetValue(dest, copyValue); } }