commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Lutz Ulrich" <>
Subject [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

the XML i want to parse with digester contains long values converted to
hexadecimal format, like


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
resulting value to the bean?


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message