|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.mmbase.util.Casting
| Constructor Summary | |
Casting()
|
|
| Method Summary | |
static boolean |
toBoolean(java.lang.Object b)
Get a value of a certain field. |
static byte[] |
toByte(java.lang.Object obj)
Get a binary value of a object. |
static java.util.Date |
toDate(java.lang.Object i)
How to convert mmbase object to a Date object |
static double |
toDouble(java.lang.Object i)
Get a value of a certain field. |
static float |
toFloat(java.lang.Object i)
Get a value of a certain field. |
static int |
toInt(java.lang.Object i)
Get a value of a certain field. |
static int |
toInt(java.lang.Object i,
int def)
as toInt, but with configurable fallback-value |
static java.lang.Integer |
toInteger(java.lang.Object i)
Get a value of a certain field. |
static java.util.List |
toList(java.lang.Object o)
|
static long |
toLong(java.lang.Object i)
|
static long |
toLong(java.lang.Object i,
long def)
Get a value of a certain field. |
static Node |
toNode(java.lang.Object i,
Cloud cloud)
|
static MMObjectNode |
toNode(java.lang.Object i,
MMObjectBuilder parent)
Get a value of a certain field. |
static java.lang.String |
toString(java.lang.Object o)
Get a value of a certain field. |
static java.lang.StringBuffer |
toStringBuffer(java.lang.StringBuffer buffer,
java.lang.Object o)
|
static java.io.Writer |
toWriter(java.io.Writer writer,
java.lang.Object o)
|
static org.w3c.dom.Document |
toXML(java.lang.Object o,
java.lang.String documentType,
java.lang.String conversion)
Returns the value of the specified field as a dom.Document
If the node value is not itself a Document, the method attempts to
attempts to convert the String value into an XML. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public Casting()
| Method Detail |
public static java.lang.String toString(java.lang.Object o)
o - the object which must be presented as a string
String
public static java.lang.StringBuffer toStringBuffer(java.lang.StringBuffer buffer,
java.lang.Object o)
public static java.io.Writer toWriter(java.io.Writer writer,
java.lang.Object o)
throws java.io.IOException
java.io.IOExceptionpublic static java.util.List toList(java.lang.Object o)
public static org.w3c.dom.Document toXML(java.lang.Object o,
java.lang.String documentType,
java.lang.String conversion)
dom.Document
If the node value is not itself a Document, the method attempts to
attempts to convert the String value into an XML.
If the value cannot be converted, this method returns null
o - the object to be converted to an XML document
null
java.lang.IllegalArgumentException - if the Field is not of type TYPE_XML.public static byte[] toByte(java.lang.Object obj)
obj - The object to be converted to a byte[]
byte [] (binary/blob field)
public static MMObjectNode toNode(java.lang.Object i,
MMObjectBuilder parent)
null.
int
public static Node toNode(java.lang.Object i,
Cloud cloud)
public static int toInt(java.lang.Object i)
int
public static int toInt(java.lang.Object i,
int def)
public static boolean toBoolean(java.lang.Object b)
true
if the value is a positive, non-zero, value. In other words, values '0'
and '-1' are concidered false.
If the value is a string, this call returns true if
the value is "true" or "yes" (case-insensitive).
In all other cases (including calling byte fields), false
is returned.
Note that there is currently no basic MMBase boolean type, but some
excecuteFunction calls may return a Boolean result.
intpublic static java.lang.Integer toInteger(java.lang.Object i)
Integer
public static long toLong(java.lang.Object i,
long def)
longpublic static long toLong(java.lang.Object i)
public static float toFloat(java.lang.Object i)
floatpublic static java.util.Date toDate(java.lang.Object i)
public static double toDouble(java.lang.Object i)
double
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||