You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Rob Walker <ro...@ascert.com> on 2003/08/04 15:16:07 UTC

JXPATH - naming oddity when using with JAX-B

Have to say, I'm very much liking the look of combining JAX-B for object 
marshalling/unmarshalling and JXPATH for in memory object graph search.

One oddity I noticed:

I have a List containing classes of type PackagedDriverImpl, which itself 
implements an interface PackagedDriver.

This class has a getDriverDescriptor method, which returns an object of 
x.y.z.DriverDescriptor based on the the JAX-B generated schema.

My original JXPath search went along the following lines:

DriverDescriptor/Info/Driver[@Id='xxx.yyy']

This failed, and running it through debug I noticed that the leading capital 
letter of all my properties had been shifted to lower case. So, redoing my 
search as follows worked:

driverDescriptor/info/driver[@id='xxx.yyy']

Seemed a little odd. Anyone got any suggestions/advice on this?

TIA

-- Rob Walker


Ascert - Taking systems to the Edge
robw@ascert.com
+44 (0)20 7488 3470
www.Ascert.com



Re: JXPATH - naming oddity when using with JAX-B

Posted by Dmitri Plotnikov <dp...@yahoo.com>.
Yes, it's just the first letter.

- Dmitri

--- Rob Walker <ro...@ascert.com> wrote:
> Dmitri
> 
> Thanks for the info, have to say I'd not picked that up from the
> JavaBeans 
> spec.
> 
> Since under this scheme:
> 
> "DriverDescriptor" becomes "driverDescriptor"
> 
> Can I take it that the decapitalization only happens for the first
> "word" or 
> "letter"?
> 
> -- Rob
> 
> Send reply to:  	"Jakarta Commons Users List"
> <co...@jakarta.apache.org>
> Date sent:      	Mon, 4 Aug 2003 07:04:46 -0700 (PDT)
> From:           	Dmitri Plotnikov <dp...@yahoo.com>
> Send reply to:  	dmitri@apache.org
> Subject:        	Re: JXPATH - naming oddity when using with JAX-B
> To:             	Jakarta Commons Users List
> <co...@jakarta.apache.org>
> 
> > Rob,
> > 
> > When working with in-memory objects, JXPath relies on the JavaBean
> > specification, which prescribes a certain way of capitalizing
> property
> > names.  Specifically, we remove the "get" prefix from the method
> name
> > and de-capitalize the rest, unless it begins with two or more
> capital
> > letters. For instance, "getFoo" becomes "foo", getFOO() becomes
> "FOO".
> > 
> > - Dmitri
> > 
> > 
> > --- Rob Walker <ro...@ascert.com> wrote:
> > > Have to say, I'm very much liking the look of combining JAX-B for
> > > object 
> > > marshalling/unmarshalling and JXPATH for in memory object graph
> > > search.
> > > 
> > > One oddity I noticed:
> > > 
> > > I have a List containing classes of type PackagedDriverImpl,
> which
> > > itself 
> > > implements an interface PackagedDriver.
> > > 
> > > This class has a getDriverDescriptor method, which returns an
> object
> > > of 
> > > x.y.z.DriverDescriptor based on the the JAX-B generated schema.
> > > 
> > > My original JXPath search went along the following lines:
> > > 
> > > DriverDescriptor/Info/Driver[@Id='xxx.yyy']
> > > 
> > > This failed, and running it through debug I noticed that the
> leading
> > > capital 
> > > letter of all my properties had been shifted to lower case. So,
> > > redoing my 
> > > search as follows worked:
> > > 
> > > driverDescriptor/info/driver[@id='xxx.yyy']
> > > 
> > > Seemed a little odd. Anyone got any suggestions/advice on this?
> > > 
> > > TIA
> > > 
> > > -- Rob Walker
> > > 
> > > 
> > > Ascert - Taking systems to the Edge
> > > robw@ascert.com
> > > +44 (0)20 7488 3470
> > > www.Ascert.com
> > > 
> > > 
> > > 
> > >
> ---------------------------------------------------------------------
> > > To unsubscribe, e-mail:
> commons-user-unsubscribe@jakarta.apache.org
> > > For additional commands, e-mail:
> commons-user-help@jakarta.apache.org
> > > 
> > 
> > 
> > __________________________________
> > Do you Yahoo!?
> > Yahoo! SiteBuilder - Free, easy-to-use web site design software
> > http://sitebuilder.yahoo.com
> > 
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail:
> commons-user-help@jakarta.apache.org
> > 
> 
> 
> 
> Ascert - Taking systems to the Edge
> robw@ascert.com
> +44 (0)20 7488 3470
> www.Ascert.com
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
> 


__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

Re: JXPATH - naming oddity when using with JAX-B

Posted by Rob Walker <ro...@ascert.com>.
Dmitri

Thanks for the info, have to say I'd not picked that up from the JavaBeans 
spec.

Since under this scheme:

"DriverDescriptor" becomes "driverDescriptor"

Can I take it that the decapitalization only happens for the first "word" or 
"letter"?

-- Rob

Send reply to:  	"Jakarta Commons Users List" <co...@jakarta.apache.org>
Date sent:      	Mon, 4 Aug 2003 07:04:46 -0700 (PDT)
From:           	Dmitri Plotnikov <dp...@yahoo.com>
Send reply to:  	dmitri@apache.org
Subject:        	Re: JXPATH - naming oddity when using with JAX-B
To:             	Jakarta Commons Users List <co...@jakarta.apache.org>

> Rob,
> 
> When working with in-memory objects, JXPath relies on the JavaBean
> specification, which prescribes a certain way of capitalizing property
> names.  Specifically, we remove the "get" prefix from the method name
> and de-capitalize the rest, unless it begins with two or more capital
> letters. For instance, "getFoo" becomes "foo", getFOO() becomes "FOO".
> 
> - Dmitri
> 
> 
> --- Rob Walker <ro...@ascert.com> wrote:
> > Have to say, I'm very much liking the look of combining JAX-B for
> > object 
> > marshalling/unmarshalling and JXPATH for in memory object graph
> > search.
> > 
> > One oddity I noticed:
> > 
> > I have a List containing classes of type PackagedDriverImpl, which
> > itself 
> > implements an interface PackagedDriver.
> > 
> > This class has a getDriverDescriptor method, which returns an object
> > of 
> > x.y.z.DriverDescriptor based on the the JAX-B generated schema.
> > 
> > My original JXPath search went along the following lines:
> > 
> > DriverDescriptor/Info/Driver[@Id='xxx.yyy']
> > 
> > This failed, and running it through debug I noticed that the leading
> > capital 
> > letter of all my properties had been shifted to lower case. So,
> > redoing my 
> > search as follows worked:
> > 
> > driverDescriptor/info/driver[@id='xxx.yyy']
> > 
> > Seemed a little odd. Anyone got any suggestions/advice on this?
> > 
> > TIA
> > 
> > -- Rob Walker
> > 
> > 
> > Ascert - Taking systems to the Edge
> > robw@ascert.com
> > +44 (0)20 7488 3470
> > www.Ascert.com
> > 
> > 
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: commons-user-help@jakarta.apache.org
> > 
> 
> 
> __________________________________
> Do you Yahoo!?
> Yahoo! SiteBuilder - Free, easy-to-use web site design software
> http://sitebuilder.yahoo.com
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
> 



Ascert - Taking systems to the Edge
robw@ascert.com
+44 (0)20 7488 3470
www.Ascert.com



Re: JXPATH - naming oddity when using with JAX-B

Posted by Dmitri Plotnikov <dp...@yahoo.com>.
Rob,

When working with in-memory objects, JXPath relies on the JavaBean
specification, which prescribes a certain way of capitalizing property
names.  Specifically, we remove the "get" prefix from the method name
and de-capitalize the rest, unless it begins with two or more capital
letters. For instance, "getFoo" becomes "foo", getFOO() becomes "FOO".

- Dmitri


--- Rob Walker <ro...@ascert.com> wrote:
> Have to say, I'm very much liking the look of combining JAX-B for
> object 
> marshalling/unmarshalling and JXPATH for in memory object graph
> search.
> 
> One oddity I noticed:
> 
> I have a List containing classes of type PackagedDriverImpl, which
> itself 
> implements an interface PackagedDriver.
> 
> This class has a getDriverDescriptor method, which returns an object
> of 
> x.y.z.DriverDescriptor based on the the JAX-B generated schema.
> 
> My original JXPath search went along the following lines:
> 
> DriverDescriptor/Info/Driver[@Id='xxx.yyy']
> 
> This failed, and running it through debug I noticed that the leading
> capital 
> letter of all my properties had been shifted to lower case. So,
> redoing my 
> search as follows worked:
> 
> driverDescriptor/info/driver[@id='xxx.yyy']
> 
> Seemed a little odd. Anyone got any suggestions/advice on this?
> 
> TIA
> 
> -- Rob Walker
> 
> 
> Ascert - Taking systems to the Edge
> robw@ascert.com
> +44 (0)20 7488 3470
> www.Ascert.com
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
> 


__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com