|
||||||||
前のクラス 次のクラス | フレームあり フレームなし | |||||||
概要: 内部クラス | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド |
java.lang.Object | +--org.apache.commons.beanutils.ConvertUtils
Utility methods for converting String values to objects of the specified class. If you specify a Java primitive type, or an array of a Java primitive type, as a destination type, a scalar or array of the coresponding Java wrapper class will be created instead. If you attempt to convert an Object or Object array of a non-String and non-primitive type, it will be converted to a scalar String or array of Strings, as appropriate.
フィールドの概要 | |
private static java.lang.Boolean |
defaultBoolean
The default value for Boolean conversions. |
private static java.lang.Byte |
defaultByte
The default value for Byte conversions. |
private static java.lang.Character |
defaultCharacter
The default value for Character conversions. |
private static java.lang.Double |
defaultDouble
The default value for Double conversions. |
private static java.lang.Float |
defaultFloat
The default value for Float conversions. |
private static java.lang.Integer |
defaultInteger
The default value for Integer conversions. |
private static java.lang.Long |
defaultLong
The default value for Long conversions. |
private static java.lang.Short |
defaultShort
The default value for Short conversions. |
private static java.lang.Class |
stringClass
The Class object for java.lang.String. |
コンストラクタの概要 | |
ConvertUtils()
|
メソッドの概要 | |
static java.lang.String |
convert(java.lang.Object value)
Convert the specified value into a String. |
static java.lang.Object |
convert(java.lang.String[] values,
java.lang.Class clazz)
Convert an array of specified values to an array of objects of the specified class (if possible). |
static java.lang.Object |
convert(java.lang.String value,
java.lang.Class clazz)
Convert the specified value to an object of the specified class (if possible). |
private static java.lang.Boolean |
convertBoolean(java.lang.String value,
java.lang.Boolean defaultValue)
Convert a String value to a corresponding Boolean value. |
private static java.lang.Byte |
convertByte(java.lang.String value,
java.lang.Byte defaultValue)
Convert a String value to a corresponding Byte value. |
private static java.lang.Character |
convertCharacter(java.lang.String value,
java.lang.Character defaultValue)
Convert a String value to a corresponding Character value. |
private static java.lang.Double |
convertDouble(java.lang.String value,
java.lang.Double defaultValue)
Convert a String value to a corresponding Double value. |
private static java.lang.Float |
convertFloat(java.lang.String value,
java.lang.Float defaultValue)
Convert a String value to a corresponding Float value. |
private static java.lang.Integer |
convertInteger(java.lang.String value,
java.lang.Integer defaultValue)
Convert a String value to a corresponding Integer value. |
private static java.lang.Long |
convertLong(java.lang.String value,
java.lang.Long defaultValue)
Convert a String value to a corresponding Long value. |
private static java.lang.Short |
convertShort(java.lang.String value,
java.lang.Short defaultValue)
Convert a String value to a corresponding Short value. |
static boolean |
getDefaultBoolean()
|
static byte |
getDefaultByte()
|
static char |
getDefaultCharacter()
|
static double |
getDefaultDouble()
|
static float |
getDefaultFloat()
|
static int |
getDefaultInteger()
|
static long |
getDefaultLong()
|
static short |
getDefaultShort()
|
static void |
setDefaultBoolean(boolean newDefaultBoolean)
|
static void |
setDefaultByte(byte newDefaultByte)
|
static void |
setDefaultCharacter(char newDefaultCharacter)
|
static void |
setDefaultDouble(double newDefaultDouble)
|
static void |
setDefaultFloat(float newDefaultFloat)
|
static void |
setDefaultInteger(int newDefaultInteger)
|
static void |
setDefaultLong(long newDefaultLong)
|
static void |
setDefaultShort(short newDefaultShort)
|
クラス java.lang.Object から継承したメソッド |
|
フィールドの詳細 |
private static java.lang.Boolean defaultBoolean
private static java.lang.Byte defaultByte
private static java.lang.Character defaultCharacter
private static java.lang.Double defaultDouble
private static java.lang.Float defaultFloat
private static java.lang.Integer defaultInteger
private static java.lang.Long defaultLong
private static java.lang.Short defaultShort
private static java.lang.Class stringClass
コンストラクタの詳細 |
public ConvertUtils()
メソッドの詳細 |
public static boolean getDefaultBoolean()
public static void setDefaultBoolean(boolean newDefaultBoolean)
public static byte getDefaultByte()
public static void setDefaultByte(byte newDefaultByte)
public static char getDefaultCharacter()
public static void setDefaultCharacter(char newDefaultCharacter)
public static double getDefaultDouble()
public static void setDefaultDouble(double newDefaultDouble)
public static float getDefaultFloat()
public static void setDefaultFloat(float newDefaultFloat)
public static int getDefaultInteger()
public static void setDefaultInteger(int newDefaultInteger)
public static long getDefaultLong()
public static void setDefaultLong(long newDefaultLong)
public static short getDefaultShort()
public static void setDefaultShort(short newDefaultShort)
public static java.lang.String convert(java.lang.Object value)
value
- Value to be converted (may be null)public static java.lang.Object convert(java.lang.String value, java.lang.Class clazz)
type
as the name of a Java primitive
type, an instance of the corresponding wrapper class (initialized
to the correct value) is returned instead.value
- Value to be converted (may be null)clazz
- Java class to be converted to (must be java.lang.String
or one of the primitive type wrappers)public static java.lang.Object convert(java.lang.String[] values, java.lang.Class clazz)
type
as one of the Java primitive types, an array of that type will be
returned; otherwise an array of the requested type (must be String
or a Java wrapper class for the primitive types) will be returned.value
- Value to be converted (may be null)clazz
- Java array class to be converted to (must be String[],
or an array of one of the Java primitive types)private static java.lang.Boolean convertBoolean(java.lang.String value, java.lang.Boolean defaultValue)
value
- The string value to convertdefaultValue
- Default value to return on a conversion errorprivate static java.lang.Byte convertByte(java.lang.String value, java.lang.Byte defaultValue)
value
- The string value to convertdefaultValue
- Default value to return on a conversion errorprivate static java.lang.Character convertCharacter(java.lang.String value, java.lang.Character defaultValue)
value
- The string value to convertdefaultValue
- Default value to return on a conversion errorprivate static java.lang.Double convertDouble(java.lang.String value, java.lang.Double defaultValue)
value
- The string value to convertdefaultValue
- Default value to return on a conversion errorprivate static java.lang.Float convertFloat(java.lang.String value, java.lang.Float defaultValue)
value
- The string value to convertdefaultValue
- Default value to return on a conversion errorprivate static java.lang.Integer convertInteger(java.lang.String value, java.lang.Integer defaultValue)
value
- The string value to convertdefaultValue
- Default value to return on a conversion errorprivate static java.lang.Long convertLong(java.lang.String value, java.lang.Long defaultValue)
value
- The string value to convertdefaultValue
- Default value to return on a conversion errorprivate static java.lang.Short convertShort(java.lang.String value, java.lang.Short defaultValue)
value
- The string value to convertdefaultValue
- Default value to return on a conversion error
|
||||||||
前のクラス 次のクラス | フレームあり フレームなし | |||||||
概要: 内部クラス | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド |