org.springjutsu.validation.util
Class PathUtils

java.lang.Object
  extended by org.springjutsu.validation.util.PathUtils

public class PathUtils
extends Object


Constructor Summary
PathUtils()
           
 
Method Summary
static String appendPath(String... pathSegments)
           
static Class<?>[] getClassesForPathTokens(Class<?> clazz, String path, boolean unwrapCollectionTypes)
          Determine the class of each step in the selected path on the target class.
static Class<?> getClassForPath(Class<?> clazz, String path, boolean unwrapFinalCollectionType)
          Determine the class of the selected path on the target class.
static boolean pathExists(Class<?> clazz, String path)
          Determine if a path exists on the given class.
static String subPath(String path, Integer startToken, Integer endToken)
          Get a path constructed specified set of subpath segments from a path.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PathUtils

public PathUtils()
Method Detail

appendPath

public static String appendPath(String... pathSegments)

pathExists

public static boolean pathExists(Class<?> clazz,
                                 String path)
Determine if a path exists on the given class.

Parameters:
clazz - Class to check
path - Path to check
Returns:
true if path exists.

getClassForPath

public static Class<?> getClassForPath(Class<?> clazz,
                                       String path,
                                       boolean unwrapFinalCollectionType)
Determine the class of the selected path on the target class.

Parameters:
clazz - Class to check
path - Path to check
unwrapFinalCollectionType - if true returns the parameterized collection type
Returns:
class for path.

getClassesForPathTokens

public static Class<?>[] getClassesForPathTokens(Class<?> clazz,
                                                 String path,
                                                 boolean unwrapCollectionTypes)
Determine the class of each step in the selected path on the target class.

Parameters:
clazz - Class to check
path - Path to check
unwrapCollectionTypes - if true returns the parameterized collection type
Returns:
array of classes for each step of path.

subPath

public static String subPath(String path,
                             Integer startToken,
                             Integer endToken)
Get a path constructed specified set of subpath segments from a path.

Parameters:
path - the original path
startToken - The first token index, inclusive: if null, the first token.
endToken - The last token index, inclusive: if null, the last token.
Returns:
The extracted subpath.


Copyright © 2013 Spring Jutsu. All Rights Reserved.