commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From maomaode <maoma...@gmail.com>
Subject Is JXPath support Boolean?
Date Fri, 02 Feb 2007 02:38:55 GMT
Hi,

I'm a new user of JXPath, my working env: JDK5, JXPath 1.2

I have a Nested bean class:

Config.java which has a getter:

CacheConfig getCache() {
   return this.cache;
}

The CacheConfig.java which has two getters:

Boolean isEnable() {
   return this.enable;
}

String getDir() {
   return this.dir
}

So my simple test code is:

JXPathContext context = JXPathContext.newContext(config);
context.getValue("/cache/dir");
This one works perfectly

But, Unfortunately,
context.getValue("/cache/enable");

what i got is :

org.apache.commons.jxpath.JXPathException: Cannot access property: 
config.CacheConfig.enable
o read method
        at 
org.apache.commons.jxpath.util.ValueUtils.getValue(ValueUtils.java:348)
        at 
org.apache.commons.jxpath.ri.model.beans.BeanPropertyPointer.getBaseValue(BeanPropertyPointer.java:108)
        at 
org.apache.commons.jxpath.ri.model.beans.BeanPropertyPointer.getImmediateNode(BeanPropertyPointer.java:135)
        at 
org.apache.commons.jxpath.ri.model.beans.PropertyPointer.getImmediateValuePointer(PropertyPointer.java:127)
        at 
org.apache.commons.jxpath.ri.model.NodePointer.getValuePointer(NodePointer.java:238)
        at 
org.apache.commons.jxpath.ri.JXPathContextReferenceImpl.getValue(JXPathContextReferenceImpl.java:331)
        at 
org.apache.commons.jxpath.ri.JXPathContextReferenceImpl.getValue(JXPathContextReferenceImpl.java:280)

So, i wondering, the JXPath only support get***, not the is***?

I have raised a jira bug[1],  i got a quick response, thanks, BTW
The answer is JXPath do support is*** feature, so i guess i must misuse 
the JXPath, or the version is not correct?

Can someone help me out? just tell me how to retrieve the 
boolean/Boolean value from the beans, or tell me where is the unit test 
code.
TBH, i can not find the test case which include isFoo() mentioned in the 
jira response.

Thanks in advance
James.

[1]https://issues.apache.org/jira/browse/JXPATH-78?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel



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


Mime
View raw message