|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.springframework.beandoc.util.BeanDocUtils
public class BeanDocUtils
Collection of static utility methods used by BeanDoc.
Method Summary | |
---|---|
static Map |
filterByPrefix(Map map,
String prefix)
Returns a new Map containing only those entries from
map whose key starts with prefix . |
static Map |
filterByPrefix(Map map,
String prefix,
boolean removePrefix)
Returns a new Map containing only those entries from
map whose key starts with prefix . |
static String |
getRelativePath(String input)
Return a String denoting a relative path marker for the input file name (String). |
static Resource[] |
getResources(String[] inputFileNames)
Convert string values to physical resources |
static List |
listFilesRecursively(File rootDir,
FileFilter filter)
Returns a List of File objects based on
criteria specified. |
static String[] |
normaliseFileNames(Resource[] inputFiles)
For the given array of Resources, return an equivalent length array of filenames that uniquely identify each file-system resource from the shortest possible common root. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static Map filterByPrefix(Map map, String prefix)
Map
containing only those entries from
map
whose key starts with prefix
. Prefixes
are removed from the keys in the returned Map
.
map
- the original Map
to be filtered; must not be
null
prefix
- prefix by which entries are filtered; may be empty of
null
Map
with filtered entriesfilterByPrefix(Map, String, boolean)
public static Map filterByPrefix(Map map, String prefix, boolean removePrefix)
Map
containing only those entries from
map
whose key starts with prefix
.
map
- the original Map
to be filtered; must not be
null
prefix
- prefix by which entries are filtered; may be empty of
null
removePrefix
- should prefixes be removed from entries in the
returned Map
?
Map
with filtered entriespublic static Resource[] getResources(String[] inputFileNames) throws IOException
inputFileNames
- an array of Strings representing resource names
Resource
's resolved from the input
names
IOException
public static String[] normaliseFileNames(Resource[] inputFiles)
For example, given the following Resources (files);
/projects/myproject/file1.xml /projects/myproject/module1/file1.xml /projects/myproject/module2/file1.xmlthe method will return a String array of the following names;
file1.xml module1/file1.xml module2/file1.xmlhaving stripped the longest common path from all of the input names.
inputFiles
- an array of Resources which must be resolvable as Files
public static String getRelativePath(String input)
input
-
public static List listFilesRecursively(File rootDir, FileFilter filter)
List
of File
objects based on
criteria specified. The functionality is equivalent to
File.listFiles()
but with the added benefit of recursing
all subdirectories from the root directory supplied.
rootDir
- A File
object which indicates the root
location to begin searching matching files. If not an existing directory
on disk, an IllegalArgumentException
will be thrown.filter
- A FileFilter
that is used to specify which
File
's should be returned.
List
of File
objects that match
the criteria specified in the FileFilter
parameter
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |