Save This Page
Home » xwork-2.1.1-src » com.opensymphony.xwork2.conversion.impl » [javadoc | source]
com.opensymphony.xwork2.conversion.impl
public class: DefaultTypeConverter [javadoc | source]
java.lang.Object
   com.opensymphony.xwork2.conversion.impl.DefaultTypeConverter

All Implemented Interfaces:
    TypeConverter

Direct Known Subclasses:
    AnnotationXWorkConverter, XWorkConverter, XWorkBasicConverter, EnumTypeConverter

Default type conversion. Converts among numeric types and also strings. Contains the basic type mapping code from OGNL.
Constructor:
 public DefaultTypeConverter() 
Method from com.opensymphony.xwork2.conversion.impl.DefaultTypeConverter Summary:
bigDecValue,   bigIntValue,   booleanValue,   convertValue,   convertValue,   convertValue,   doubleValue,   enumValue,   getTypeConverter,   longValue,   stringValue,   stringValue
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from com.opensymphony.xwork2.conversion.impl.DefaultTypeConverter Detail:
 public static BigDecimal bigDecValue(Object value) throws NumberFormatException 
    Evaluates the given object as a BigDecimal.
 public static BigInteger bigIntValue(Object value) throws NumberFormatException 
    Evaluates the given object as a BigInteger.
 public static boolean booleanValue(Object value) 
    Evaluates the given object as a boolean: if it is a Boolean object, it's easy; if it's a Number or a Character, returns true for non-zero objects; and otherwise returns true for non-null objects.
 public Object convertValue(Object value,
    Class toType) 
    Returns the value converted numerically to the given class type This method also detects when arrays are being converted and converts the components of one array to the type of the other.
 public Object convertValue(Map context,
    Object value,
    Class toType) 
 public Object convertValue(Map context,
    Object target,
    Member member,
    String propertyName,
    Object value,
    Class toType) 
 public static double doubleValue(Object value) throws NumberFormatException 
    Evaluates the given object as a double-precision floating-point number.
 public Enum enumValue(Class toClass,
    Object o) 
 public TypeConverter getTypeConverter(Map context) 
 public static long longValue(Object value) throws NumberFormatException 
    Evaluates the given object as a long integer.
 public static String stringValue(Object value) 
    Evaluates the given object as a String.
 public static String stringValue(Object value,
    boolean trim) 
    Evaluates the given object as a String and trims it if the trim flag is true.