commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Brian K. Wallace" <br...@transmorphix.com>
Subject [betwixt] BeanReader - setXXX(Object)
Date Fri, 04 Apr 2003 04:55:42 GMT
  I was wondering if there is something I'm missing, or if Betwixt just
  can't do it as is. Given the following XML:
<Element>
  <name>Element 1</name>
  <value>
    <Integer>5</Integer
  </value>
</Element>

and the following bean mapped to the "Element" XML element:

public class ElementBean {
  private String mName;
  private Object mValue;

  public ElementBean() {
  }

  public void setName(String iName) {
    mName = iName;
  }

  public String getName() {
    return mName;
  }


  public void setValue(Object iValue) {
    mValue = iValue;
  }

  public Object getValue() {
    return mValue;
  }
}

Is there any way to get the value (5) into the Element's setValue method
as an Integer as opposed to an Object?  I rely on being able to reuse
objects and pulling out the values as appropriate, but with the
BeanReader, all calls to 'getValue' result in Object@....
Aside from my 'Object'ion, the reader parses fine. Any help would be
appreciated.


Mime
View raw message