commons-user mailing list archives

[digester] How to convert the type of a XML-value before passing it as argument to bean

Date

Wed, 19 May 2004 13:50:04 GMT

hello,
the XML i want to parse with digester contains long values converted to
hexadecimal format, like
<value>34FA5</value>
since the text represents a long value, the corresponding bean
shall have a corresponding long property, not a string property:
class MyBean
{
long value;
public long getValue() { return value; }
public void setValue(long value) { this.value = value; }
}
how do you convert the long value given as a hexadezimal string
to long without letting the conversion be part of the bean logic?
of course, i know the conversion routine java.lang.Long.parseLong(String
s, int radix).
but how do i configure my digester to call this method before passing
the
resulting value to the bean?
regards,
lutz
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org