|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Object | +--org.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 certain field. |
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 java.lang.Integer |
toInteger(java.lang.Object i)
Get a value of a certain field. |
static long |
toLong(java.lang.Object i)
Get a value of a certain field. |
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 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)
fieldName - the name of the field who's data to returnString
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 nullfieldName - the name of the field to be returnednulljava.lang.IllegalArgumentException - if the Field is not of type TYPE_XML.public static byte[] toByte(java.lang.Object obj)
fieldName - the name of the field who's data to returnbyte [] (binary/blob field)
public static MMObjectNode toNode(java.lang.Object i,
MMObjectBuilder parent)
null.fieldName - the name of the field who's data to returnintpublic static int toInt(java.lang.Object i)
fieldName - the name of the field who's data to returnintpublic 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.fieldName - the name of the field who's data to returnintpublic static java.lang.Integer toInteger(java.lang.Object i)
fieldName - the name of the field who's data to returnIntegerpublic static long toLong(java.lang.Object i)
fieldName - the name of the field who's data to returnlongpublic static float toFloat(java.lang.Object i)
fieldName - the name of the field who's data to returnfloatpublic static double toDouble(java.lang.Object i)
fieldName - the name of the field who's data to returndouble
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||