/** * Append the string representation of the filter to the provided buffer. * * @param builder The buffer to which the string representation of the * filter is to be appended. */ public void toString(final StringBuilder builder) { builder.append(filterAttribute); builder.append(' '); builder.append(getFilterType().getStringValue()); builder.append(' '); builder.append(filterValue.toString()); } }
/** * Append the string representation of the filter to the provided buffer. * * @param builder The buffer to which the string representation of the * filter is to be appended. */ public void toString(final StringBuilder builder) { builder.append(filterAttribute); builder.append(' '); builder.append(getFilterType().getStringValue()); builder.append(' '); builder.append(filterValue.toString()); } }
@Override public void onValueNode(ValueNode node, Optional<ContainerNode<?>> parent, List<PathElement> path) { String value = node.isTextual() ? node.textValue() : node.toString(); List<String> placeholders = extractPlaceholderStrings(value); if (!placeholders.isEmpty()) { String pathString = new NodePath(path).toString(); for (String placeholder : placeholders) { unresolvedPlaceholderDescriptions.add(new UnresolvedPlaceholder(pathString, value, placeholder)); } } } }
@Override public void onValueNode(ValueNode node, Optional<ContainerNode<?>> parent, List<PathElement> path) { String value = node.isTextual() ? node.textValue() : node.toString(); List<Placeholder> placeholders = extractPlaceholders(value); if (!placeholders.isEmpty()) { for (Placeholder placeholder : placeholders) { if (placeholder.hasDefaultValue()) { String valueWithReplacements = replacePlaceholder(value, placeholder.name(), placeholder.defaultValue()); last(path).setChild(parent.get(), TextNode.valueOf(valueWithReplacements)); if (LOGGER.isDebugEnabled()) { LOGGER.debug("At {}, replaced {} with {}", new Object[]{path, value, valueWithReplacements}); } } } } } }
@Override public void onValueNode(ValueNode node, Optional<ContainerNode<?>> parent, List<PathElement> pathAsList) { String path = new NodePath(pathAsList).toString(); String value = node.isTextual() ? node.textValue() : node.toString(); List<Placeholder> placeholders = extractPlaceholders(value); if (placeholders.isEmpty() && !resolved.containsKey(path)) { resolved.put(path, value); passAgain = true; } else { boolean changes = false; for (Placeholder placeholder : placeholders) { String replacement = resolved.get(placeholder.name()); if (replacement != null) { String valueWithReplacements = replacePlaceholder(value, placeholder.name(), replacement); last(pathAsList).setChild(parent.get(), TextNode.valueOf(valueWithReplacements)); if (LOGGER.isDebugEnabled()) { LOGGER.debug("At {}, replaced {} with {}", new Object[]{pathAsList, value, valueWithReplacements}); } value = valueWithReplacements; changes = true; } } passAgain |= changes; } } }