public class TypeHandler extends Object
| Constructor and Description |
|---|
TypeHandler() |
| Modifier and Type | Method and Description |
|---|---|
static Class |
createClass(String classname)
Returns the class whose name is
classname. |
static Date |
createDate(String str)
Returns the date represented by
str. |
static File |
createFile(String str)
Returns the File represented by
str. |
static File[] |
createFiles(String str)
Returns the File[] represented by
str. |
static Number |
createNumber(String str)
Create a number from a String.
|
static Object |
createObject(String classname)
Create an Object from the classname and empty constructor.
|
static URL |
createURL(String str)
Returns the URL represented by
str. |
static Object |
createValue(String str,
Class clazz)
Returns the
Object of type clazz
with the value of str. |
static Object |
createValue(String str,
Object obj)
Returns the
Object of type obj
with the value of str. |
public static Object createValue(String str, Object obj) throws ParseException
Object of type obj
with the value of str.str - the command line valueobj - the type of argumentobj initialised with
the value of str.ParseExceptionpublic static Object createValue(String str, Class clazz) throws ParseException
Object of type clazz
with the value of str.str - the command line valueclazz - the type of argumentclazz initialised with
the value of str.ParseExceptionpublic static Object createObject(String classname) throws ParseException
classname - the argument valueParseExceptionpublic static Number createNumber(String str) throws ParseException
str - the valuestr, if str
is not a number, null is returned.ParseExceptionpublic static Class createClass(String classname) throws ParseException
classname.classname - the class nameParseExceptionpublic static Date createDate(String str) throws ParseException
str.str - the date stringstr is a valid date string,
otherwise return null.ParseExceptionpublic static URL createURL(String str) throws ParseException
str.str - the URL stringstr is well-formed, otherwise
return null.ParseExceptionpublic static File createFile(String str) throws ParseException
str.str - the File locationstr.ParseExceptionpublic static File[] createFiles(String str) throws ParseException
str.str - the paths to the filesstr.ParseExceptionCopyright © 2002-2014 The Apache Software Foundation. All Rights Reserved.