com.mortbay.Util
Class ConverterSet.PrimitiveConverter

java.lang.Object
  |
  +--com.mortbay.Util.ConverterBase
        |
        +--com.mortbay.Util.ConverterSet.PrimitiveConverter
Enclosing class:
ConverterSet

public static class ConverterSet.PrimitiveConverter
extends ConverterBase


Field Summary
static java.math.BigDecimal aBigDec
           
static java.math.BigInteger aBigInt
           
static java.lang.Boolean aBoolean
           
static java.lang.Byte aByte
           
static java.lang.Character aCharacter
           
static java.lang.Double aDouble
           
static java.lang.Float aFloat
           
static java.lang.Integer aInteger
           
static java.lang.Long aLong
           
static java.lang.Short aShort
           
 
Constructor Summary
ConverterSet.PrimitiveConverter()
           
 
Method Summary
protected  java.lang.Object doConvert(java.lang.Object toConvert, java.lang.Class convertTo, Converter context, boolean safe)
          Convert an Object to another type.
static java.lang.Class[] getPrimitives()
          Return an Array of all the primitive class types
 
Methods inherited from class com.mortbay.Util.ConverterBase
convert, setTransformMode, unsafeConvert
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

aBoolean

public static final java.lang.Boolean aBoolean

aByte

public static final java.lang.Byte aByte

aCharacter

public static final java.lang.Character aCharacter

aDouble

public static final java.lang.Double aDouble

aFloat

public static final java.lang.Float aFloat

aInteger

public static final java.lang.Integer aInteger

aLong

public static final java.lang.Long aLong

aShort

public static final java.lang.Short aShort

aBigInt

public static final java.math.BigInteger aBigInt

aBigDec

public static final java.math.BigDecimal aBigDec
Constructor Detail

ConverterSet.PrimitiveConverter

public ConverterSet.PrimitiveConverter()
Method Detail

getPrimitives

public static java.lang.Class[] getPrimitives()
Return an Array of all the primitive class types

doConvert

protected java.lang.Object doConvert(java.lang.Object toConvert,
                                     java.lang.Class convertTo,
                                     Converter context,
                                     boolean safe)
Description copied from class: ConverterBase
Convert an Object to another type.
Overrides:
doConvert in class ConverterBase
Tags copied from class: ConverterBase
Parameters:
toConvert - Value to convert
convertTo - Type to convert to
context - The context within which the converter was called. If Converters use other Converters, this is passed as the outermost Converter so that recursive calls have access to all available Converters. Converter implementations should pass this if passed null.
safe - If false, errors should be returned.
Returns:
null if this converter doesn't handle this type to convertTo, or a ConvertFail exception if there was an error and safe is false.