| java.lang.Object uk.org.ponder.beanutil.PathUtil
PathUtil | public class PathUtil (Code) | | A set of utility methods to operate on dot-separated bean paths.
author: Antranig Basman (antranig@caret.cam.ac.uk) |
Method Summary | |
public static String | buildPath(String[] segments) Builds an EL path of from an array of path segments. | public static String | buildPath(String[] segments, int start, int finish) Builds an EL path of variable length, from a subsection of an array of
segments. | public static String | buildPath(String prefix, String suffix) Compose a prefix and suffix EL path, where the prefix has not been escaped,
and is not null.
Parameters: prefix - A single path segment (bean name) starting the path, may notbe null or empty. | public static String | composePath(String prefix, String suffix) Compose a prefix and suffix EL path, where the prefix is already escaped.
Prefix may be empty, but not null. | public static String | composePathEncoded(String head, String tail) | static void | composeSegment(CharWrap toaccept, String toappend) | public static String | getFromHeadPath(String path) | public static String | getHeadPath(String path) | public static String | getHeadPathEncoded(String path) | static String | getPathSegment(String path, int i) | static int | getPathSegment(CharWrap accept, String path, int i) | public static String | getTailPath(String path) | public static String | getToTailPath(String path) | static int | lastDotIndex(String path) | public static String[] | splitPath(String path) |
buildPath | public static String buildPath(String[] segments)(Code) | | Builds an EL path of from an array of path segments. Particulary good when using
Strings of BeanLocators, Maps, and friends. Assumes none of the segments
have been escaped yet.
|
buildPath | public static String buildPath(String[] segments, int start, int finish)(Code) | | Builds an EL path of variable length, from a subsection of an array of
segments.
|
buildPath | public static String buildPath(String prefix, String suffix)(Code) | | Compose a prefix and suffix EL path, where the prefix has not been escaped,
and is not null.
Parameters: prefix - A single path segment (bean name) starting the path, may notbe null or empty. This will become escaped. Parameters: suffix - A single path segment (property name) continuing the path,may not be null or empty. This will become escaped. A properly escaped full path, representing "prefix.suffix". |
composePath | public static String composePath(String prefix, String suffix)(Code) | | 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.
|
composePathEncoded | public static String composePathEncoded(String head, String tail)(Code) | | Compose head and tail paths, where escaping is unnecessary *
|
getHeadPathEncoded | public static String getHeadPathEncoded(String path)(Code) | | Returns the first path segment, without performing unescaping *
|
getTailPath | public static String getTailPath(String path)(Code) | | Returns the very last path component of a bean path
|
splitPath | public static String[] splitPath(String path)(Code) | | Parses a path into an array of decoded EL segments *
|
|
|