commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Carman" <ja...@carmanconsulting.com>
Subject Re: jxpath - how to access Boolean is.......() ?
Date Thu, 30 Oct 2008 16:48:59 GMT
The "is" accessor method is not valid for non-boolean types (that's
little 'b' and not big 'B') per the JavaBeans specification.

On Thu, Oct 30, 2008 at 12:15 PM,  <torsten.reinhard@gi-de.com> wrote:
> Hi,
>
> I have some JAXB generated classes like this:
>
> public class OPBDataType
>    implements Serializable
> {
> ...
>    @XmlElement(name = "OPB_NamePos")
>    protected Boolean opbNamePos;
> ...
>
>    public Boolean isOPBNamePos() {
>        return opbNamePos;
>    }
>
>    public void setOPBNamePos(Boolean value) {
>        this.opbNamePos = value;
>    }
> ...
> }
>
> now, I want to access the property "OPBNamePos", but I always get
>
> org.apache.commons.jxpath.JXPathException: Cannot access property:
> .........OPBDataType.OPBNamePos; No read method
> at org.apache.commons.jxpath.util.ValueUtils.getValue(ValueUtils.java:370)
>        at
> org.apache.commons.jxpath.ri.model.beans.BeanPropertyPointer.getBaseValue(BeanPropertyPointer.java:120)
>        at
> org.apache.commons.jxpath.ri.model.beans.BeanPropertyPointer.getImmediateNode(BeanPropertyPointer.java:149)
>        at
> org.apache.commons.jxpath.ri.model.beans.PropertyPointer.getImmediateValuePointer(PropertyPointer.java:161)
>        at
> org.apache.commons.jxpath.ri.model.NodePointer.getValuePointer(NodePointer.java:297)
>        at
> org.apache.commons.jxpath.ri.JXPathContextReferenceImpl.getValue(JXPathContextReferenceImpl.java:370)
>        at
> org.apache.commons.jxpath.ri.JXPathContextReferenceImpl.getValue(JXPathContextReferenceImpl.java:313)
>
> I guess the reason is the BeanInfo API, where only boolean is......() is
> supported by default.
>
> => Is there an easy way to resolve this?
>
> I dont want to write special BeanInfo classes, because I have a lot of
> JAXB generated stuff........
>
>
> Thanx, Torsten
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Mime
View raw message