/** * {@inheritDoc} This method supports the syntax as described in the class * comment. */ @Override public <T> List<QueryResult<T>> query(final T root, final String key, final NodeHandler<T> handler) { final List<QueryResult<T>> results = new LinkedList<>(); findNodesForKey(new DefaultConfigurationKey(this, key).iterator(), root, results, handler); return results; }
@Override public String attributeKey(final String parentKey, final String attributeName) { final DefaultConfigurationKey key = new DefaultConfigurationKey(this, parentKey); key.appendAttribute(attributeName); return key.toString(); }
/** * Splits the at path into its components. * * @param at the at string * @return a collection with the names of the single components */ private Collection<String> parseAt(final String at) { if (at == null) { return null; } final Collection<String> result = new ArrayList<>(); final DefaultConfigurationKey.KeyIterator it = new DefaultConfigurationKey( AT_ENGINE, at).iterator(); while (it.hasNext()) { result.add(it.nextKey()); } return result; } }
new DefaultConfigurationKey(exprEngine); DefaultConfigurationKey keyLast = keyEmpty; final Set<String> keySet = new HashSet<>(); new DefaultConfigurationKey(exprEngine, key); closeElements(keyLast, keyAct); final String elem = openElements(keyLast, keyAct, config, keySet);
/** * {@inheritDoc} This implementation takes the * given parent key, adds a property delimiter, and then adds the node's * name. * The name of the root node is a blank string. Note that no indices are * returned. */ @Override public <T> String nodeKey(final T node, final String parentKey, final NodeHandler<T> handler) { if (parentKey == null) { // this is the root node return StringUtils.EMPTY; } final DefaultConfigurationKey key = new DefaultConfigurationKey(this, parentKey); key.append(handler.nodeName(node), true); return key.toString(); }
final DefaultConfigurationKey result = new DefaultConfigurationKey(getExpressionEngine());
/** * {@inheritDoc} This implementation works similar to {@code nodeKey()}; * however, each key returned by this method has an index (except for the * root node). The parent key is prepended to the name of the current node * in any case and without further checks. If it is <b>null</b>, only the * name of the current node with its index is returned. */ @Override public <T> String canonicalKey(final T node, final String parentKey, final NodeHandler<T> handler) { final String nodeName = handler.nodeName(node); final T parent = handler.getParent(node); final DefaultConfigurationKey key = new DefaultConfigurationKey(this, parentKey); key.append(StringUtils.defaultString(nodeName)); if (parent != null) { // this is not the root key key.appendIndex(determineIndex(node, parent, nodeName, handler)); } return key.toString(); }
public <T> NodeAddData<T> prepareAdd(final T root, final String key, final NodeHandler<T> handler) final DefaultConfigurationKey.KeyIterator it = new DefaultConfigurationKey( this, key).iterator(); if (!it.hasNext())
final DefaultConfigurationKey result = new DefaultConfigurationKey(getExpressionEngine()); final KeyIterator it1 = iterator(); final KeyIterator it2 = other.iterator();