/** * Compose a prefix and suffix EL path, where the prefix has not been escaped, * and is not null. * @param prefix A single path segment (bean name) starting the path, may not * be null or empty. This will become escaped. * @param suffix A single path segment (property name) continuing the path, * may not be null or empty. This will become escaped. * @return A properly escaped full path, representing "prefix.suffix". */ public static String buildPath(String prefix, String suffix) { CharWrap toappend = new CharWrap(); composeSegment(toappend, prefix); toappend.append('.'); composeSegment(toappend, suffix); return toappend.toString(); }
/** * Compose a prefix and suffix EL path, where the prefix is already escaped. * Prefix may be empty, but not null. The suffix will become escaped. * * @param prefix path prefix * @param suffix path sufix * @return el path */ public static String composePath(String prefix, String suffix) { CharWrap toappend = new CharWrap(prefix); if (toappend.size != 0) { toappend.append('.'); } composeSegment(toappend, suffix); return toappend.toString(); }
/** * Builds an EL path of variable length, from a subsection of an array of segments. * * @param segments path segments * @param start begin index * @param finish end index * @return el path */ public static String buildPath(String[] segments, int start, int finish) { CharWrap toappend = new CharWrap(); for (int i = start; i < finish; i++) { if (toappend.size != 0) { toappend.append('.'); } composeSegment(toappend, segments[i]); } return toappend.toString(); }