org.apache.commons.cli
public class TypeHandler extends Object
Version: $Revision: 1.2 $
Method Summary | |
---|---|
static Class | createClass(String str) Returns the class whose name is |
static Date | createDate(String str) Returns the date represented by |
static File | createFile(String str) Returns the File represented by |
static File[] | createFiles(String str) Returns the File[] represented by |
static Number | createNumber(String str) Create a number from a String. |
static Object | createObject(String str) Create an Object from the classname and empty constructor. |
static URL | createURL(String str) Returns the URL represented by |
static Object | createValue(String str, Object obj) Returns the |
static Object | createValue(String str, Class clazz) Returns the |
Returns the class whose name is str
.
Parameters: str the class name
Returns: The class if it is found, otherwise return null
Returns the date represented by str
.
Parameters: str the date string
Returns: The date if str
is a valid date string,
otherwise return null.
Returns the File represented by str
.
Parameters: str the File location
Returns: The file represented by str
.
Returns the File[] represented by str
.
Parameters: str the paths to the files
Returns: The File[] represented by str
.
Create a number from a String.
Parameters: str the value
Returns: the number represented by str
, if str
is not a number, null is returned.
Create an Object from the classname and empty constructor.
Parameters: str the argument value
Returns: the initialised object, or null if it couldn't create the Object.
Returns the URL represented by str
.
Parameters: str the URL string
Returns: The URL is str
is well-formed, otherwise
return null.
Returns the Object
of type obj
with the value of str
.
Parameters: str the command line value obj the type of argument
Returns: The instance of obj
initialised with
the value of str
.
Returns the Object
of type clazz
with the value of str
.
Parameters: str the command line value clazz the type of argument
Returns: The instance of clazz
initialised with
the value of str
.