java.lang.Objectorg.objectweb.telosys.common.Tool
Constructor Summary | |
Tool()
|
Method Summary | |
static java.lang.String |
buildClassName(java.lang.String sPattern,
java.lang.String sBeanName)
Build a class name by applying the given bean name in the given pattern The string "${BEANNAME}" in the pattern will be replaced by the bean name |
static java.lang.String |
buildPath(java.lang.String sLeftPart,
java.lang.String sRightPart)
Builds a path like "LeftPart" + "/" + "RightPart" without redundant separators |
static java.lang.String |
buildPath(java.lang.String sLeftPart,
java.lang.String sRightPart,
java.lang.String sSeparatorArg)
Builds a path like "LeftPart" + SEPARATOR + "RightPart" without redundant separators |
static void |
closeInputStream(java.io.InputStream in)
Close an input stream without exception |
static GenericVOList |
createVOListInstance(java.lang.Class cl)
|
static boolean |
fileExists(java.lang.String sFileName)
Check the existence of a file |
static java.util.Properties |
findAndLoadProperties(java.lang.String sFileName)
Try to find a properties file with classpath and load it (if found) |
static java.lang.String |
findFileByClassPath(java.lang.String sFileName)
Find a file using the CLASSPATH |
static java.lang.String |
getBeanName(java.lang.Class beanClass)
Determines the "bean name" from the given bean class Just retuns the "simple name" of the bean class name ( e.g. |
static boolean |
isVOListClass(java.lang.Class cl)
|
static boolean |
isVOListInstance(java.lang.Object obj)
|
static java.util.Properties |
loadProperties(java.io.InputStream is)
|
static java.util.Properties |
loadProperties(java.lang.String sFileName)
Load properties from a specific file name and return them |
static void |
showProperties(java.util.Properties prop)
Print the content of the properties on the standard output |
static void |
showProperties(java.util.Properties prop,
java.io.PrintStream out)
Print the content of the properties on a specific output |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Tool()
Method Detail |
public static java.lang.String buildPath(java.lang.String sLeftPart, java.lang.String sRightPart)
sLeftPart
- : left part ( with or without ending "/" )sRightPart
- : right part ( with or without starting "/" )
public static java.lang.String buildPath(java.lang.String sLeftPart, java.lang.String sRightPart, java.lang.String sSeparatorArg)
sLeftPart
- : left part ( with or without ending separator )sRightPart
- : right part ( with or without starting separator )sSeparatorArg
- : the separator to use ( e.g. "/", ".", ... )
public static void closeInputStream(java.io.InputStream in)
in
- public static boolean fileExists(java.lang.String sFileName)
sFileName
-
public static java.lang.String findFileByClassPath(java.lang.String sFileName)
sFileName
-
public static java.util.Properties findAndLoadProperties(java.lang.String sFileName)
sFileName
-
public static java.util.Properties loadProperties(java.lang.String sFileName)
sFileName
-
public static java.util.Properties loadProperties(java.io.InputStream is)
public static void showProperties(java.util.Properties prop)
prop
- public static void showProperties(java.util.Properties prop, java.io.PrintStream out)
prop
- out
- public static boolean isVOListClass(java.lang.Class cl)
public static boolean isVOListInstance(java.lang.Object obj)
public static GenericVOList createVOListInstance(java.lang.Class cl)
public static java.lang.String buildClassName(java.lang.String sPattern, java.lang.String sBeanName)
sPattern
- the pattern ( e.g. "my.package.${BEANNAME}Suffix" )sBeanName
-
public static java.lang.String getBeanName(java.lang.Class beanClass)
beanClass
-