@Override public String toString() { final StringBuilder b = new StringBuilder(); for (final Node node : nodes) { if (b.length() > 0 && node.getKind() == ElementKind.PROPERTY) { b.append('.'); } b.append(node.toString()); } return b.toString(); }
protected String normalizePath(final Path path) { if (path == null) { return "N/A"; } StringBuilder builder = new StringBuilder(); boolean first = true; for (final Node node : path) { final String input = node.toString(); if (input.isEmpty()) { continue; } if (!first) { builder.append(PROPERTY_PATH_SEPARATOR); } PropertyNamingStrategy namingStrategy = PROPERTY_NAMING_STRATEGIES.get(input); if (namingStrategy == null) { namingStrategy = defaultNamingStrategy; } final String output = namingStrategy.apply(node); builder.append(output); first = false; } return builder.toString(); } }
fieldName = it.next().toString();
fieldName = it.next().toString();
private String printPropertyPath(Path path) { if (path == null) return "UNKNOWN"; String propertyPath = ""; Path.Node parameterNode = null; // Construct string representation of property path. // This will strip away any other nodes added by RESTEasy (method, parameter, ...). for (Path.Node node : path) { if (node.getKind() == ElementKind.PARAMETER) { parameterNode = node; } if (node.getKind() == ElementKind.PROPERTY) { if (!propertyPath.isEmpty()) { propertyPath += "."; } propertyPath += node; } } if (propertyPath.isEmpty() && parameterNode != null) { // No property path constructed, assume this is a validation failure on a request parameter. propertyPath = parameterNode.toString(); } return propertyPath; }
@Override public String apply(final Node node) { if (node == null) return null; // garbage in, garbage out return translate(node.toString()); }
@Override public String apply(final Node node) { if (node == null) return null; // garbage in, garbage out return translate(node.toString()); }