commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From torsten.reinh...@gi-de.com
Subject jxpath - how to access Boolean is.......() ?
Date Thu, 30 Oct 2008 16:15:31 GMT
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


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message