org.mmbase.util
Class BridgeCaster
java.lang.Object
org.mmbase.util.BridgeCaster
- All Implemented Interfaces:
- Caster
public class BridgeCaster
- extends Object
- implements Caster
Plugged into Casting to supply some extra casting based on the availability of an MMBase Bridge.
- Since:
- MMBase-2.0
BridgeCaster
public BridgeCaster()
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
toBoolean
public boolean toBoolean(Object i)
throws Caster.NotRecognized
- Specified by:
toBoolean in interface Caster
- Throws:
Caster.NotRecognized
isStringRepresentable
public boolean isStringRepresentable(Class<?> type)
- Specified by:
isStringRepresentable in interface Caster
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 s)
throws Caster.NotRecognized
- Specified by:
toString in interface Caster
- Throws:
Caster.NotRecognized
toNode
public static Node toNode(Object i,
Cloud cloud)
- Convert an object to an Node.
If the value is Numeric, the method
tries to obtain the mmbase object with that number.
A
Map returns a virtual Node representing the map, (a
MapNode).
All remaining situations return the node with the alias i.toString(), which can
be null if no node which such an alias.
- Parameters:
i - the object to convertcloud - the Cloud to use for loading a node
- Returns:
- the value as a
Node - Since:
- MMBase-1.7
toDataType
public static DataType<?> toDataType(Object o)
- Since:
- MMBase-1.9.1
toString
public String toString()
- Overrides:
toString in class Object
MMBase 2.0-SNAPSHOT - null