org.mmbase.util
Class BasicCaster

java.lang.Object
  extended by org.mmbase.util.BasicCaster
All Implemented Interfaces:
Caster

public class BasicCaster
extends Object
implements Caster

Since:
MMBase-2.0

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.mmbase.util.Caster
Caster.NotRecognized
 
Constructor Summary
BasicCaster()
           
 
Method Summary
 boolean isStringRepresentable(Class<?> type)
           
 boolean toBoolean(Object o)
           
 double toDouble(Object i)
           
 float toFloat(Object i)
           
 int toInt(Object i)
           
 long toLong(Object i)
           
 Map toMap(Object o)
           
 String toString(Object o)
           
<C> C
toType(Class<C> type, Object cloud, Object value)
           
 Object unWrap(Object o)
           
 Object wrap(Object o, CharTransformer escaper)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BasicCaster

public BasicCaster()
Method Detail

toType

public <C> C toType(Class<C> type,
                    Object cloud,
                    Object value)
         throws Caster.NotRecognized
Specified by:
toType in interface Caster
Throws:
Caster.NotRecognized

wrap

public Object wrap(Object o,
                   CharTransformer escaper)
            throws Caster.NotRecognized
Specified by:
wrap in interface Caster
Throws:
Caster.NotRecognized

unWrap

public Object unWrap(Object o)
              throws Caster.NotRecognized
Specified by:
unWrap in interface Caster
Throws:
Caster.NotRecognized

toMap

public Map toMap(Object o)
          throws Caster.NotRecognized
Specified by:
toMap in interface Caster
Throws:
Caster.NotRecognized

toInt

public int toInt(Object i)
          throws Caster.NotRecognized
Specified by:
toInt in interface Caster
Throws:
Caster.NotRecognized

toLong

public long toLong(Object i)
            throws Caster.NotRecognized
Specified by:
toLong in interface Caster
Throws:
Caster.NotRecognized

toFloat

public float toFloat(Object i)
              throws Caster.NotRecognized
Specified by:
toFloat in interface Caster
Throws:
Caster.NotRecognized

toDouble

public double toDouble(Object i)
                throws Caster.NotRecognized
Specified by:
toDouble in interface Caster
Throws:
Caster.NotRecognized

toString

public String toString(Object o)
                throws Caster.NotRecognized
Specified by:
toString in interface Caster
Throws:
Caster.NotRecognized

toBoolean

public boolean toBoolean(Object o)
                  throws Caster.NotRecognized
Specified by:
toBoolean in interface Caster
Throws:
Caster.NotRecognized

isStringRepresentable

public boolean isStringRepresentable(Class<?> type)
Specified by:
isStringRepresentable in interface Caster


MMBase 2.0-SNAPSHOT - null