|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.commons.cli.TypeHandler
This is a temporary implementation. TypeHandler will handle the pluggableness of OptionTypes and it will direct all of these types of conversion functionalities to ConvertUtils component in Commons alreayd. BeanUtils I think.
Constructor Summary | |
TypeHandler()
|
Method Summary | |
static java.lang.Class |
createClass(java.lang.String str)
Returns the class whose name is str . |
static java.util.Date |
createDate(java.lang.String str)
Returns the date represented by str . |
static java.io.File |
createFile(java.lang.String str)
Returns the File represented by str . |
static java.io.File[] |
createFiles(java.lang.String str)
Returns the File[] represented by str . |
static java.lang.Number |
createNumber(java.lang.String str)
Create a number from a String. |
static java.lang.Object |
createObject(java.lang.String str)
Create an Object from the classname and empty constructor. |
static java.net.URL |
createURL(java.lang.String str)
Returns the URL represented by str . |
static java.lang.Object |
createValue(java.lang.String str,
java.lang.Class clazz)
Returns the Object of type clazz
with the value of str . |
static java.lang.Object |
createValue(java.lang.String str,
java.lang.Object obj)
Returns the Object of type obj
with the value of str . |
Methods inherited from class java.lang.Object |
|
Constructor Detail |
public TypeHandler()
Method Detail |
public static java.lang.Object createValue(java.lang.String str, java.lang.Object obj)
Returns the Object
of type obj
with the value of str
.
str
- the command line valueobj
- the type of argumentobj
initialised with
the value of str
.public static java.lang.Object createValue(java.lang.String str, java.lang.Class clazz)
Returns the Object
of type clazz
with the value of str
.
str
- the command line valueclazz
- the type of argumentclazz
initialised with
the value of str
.public static java.lang.Object createObject(java.lang.String str)
Create an Object from the classname and empty constructor.
str
- the argument valuepublic static java.lang.Number createNumber(java.lang.String str)
Create a number from a String.
str
- the valuestr
, if str
is not a number, null is returned.public static java.lang.Class createClass(java.lang.String str)
Returns the class whose name is str
.
str
- the class namepublic static java.util.Date createDate(java.lang.String str)
Returns the date represented by str
.
str
- the date stringstr
is a valid date string,
otherwise return null.public static java.net.URL createURL(java.lang.String str)
Returns the URL represented by str
.
str
- the URL stringstr
is well-formed, otherwise
return null.public static java.io.File createFile(java.lang.String str)
Returns the File represented by str
.
str
- the File locationstr
.public static java.io.File[] createFiles(java.lang.String str)
Returns the File[] represented by str
.
str
- the paths to the filesstr
.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |