/** * Appends the name of a property to this key. If necessary, a property * delimiter will be added. Property delimiters in the given string will not * be escaped. * * @param property the name of the property to be added * @return a reference to this object */ public DefaultConfigurationKey append(final String property) { return append(property, false); }
/** * {@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(); }
result.append(it1.currentKey()); if (it1.hasIndex)
/** * {@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(); }
result.append(k.substring(i));
/** * Fires all necessary element start events for the specified key. This * method is called for each key obtained from the configuration to be * converted. It ensures that all elements "between" the last key and the * actual key are opened and their values are set. * * @param keyLast the last processed key * @param keyAct the actual key * @param config the configuration to process * @param keySet the set with the processed keys * @return the name of the last element on the path */ protected String openElements(final DefaultConfigurationKey keyLast, final DefaultConfigurationKey keyAct, final Configuration config, final Set<String> keySet) { final DefaultConfigurationKey.KeyIterator it = keyLast.differenceKey(keyAct).iterator(); final DefaultConfigurationKey k = keyLast.commonKey(keyAct); for (it.nextKey(); it.hasNext(); it.nextKey()) { k.append(it.currentKey(true)); elementStart(it.currentKey(true), config.getProperty(k.toString())); keySet.add(k.toString()); } return it.currentKey(true); }