You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Stephen Colebourne <sc...@btopenworld.com> on 2005/01/12 23:43:01 UTC

Re: [jxpath] Urgent : Array createPath problem

Use correct prefix
----- Original Message ----- 
> Hi All,
> 
> I am trying to call createPath to create array type of
> bean. I have registered my own AbstractFactory to the
> context.
> 
> I am calling
> jxPathContext.createPath("secondBeanArray[1]/thirdBean")
> . I have create the context using FirstBean. 
> 
> Method getSecondBeanArray() of FirstBean never returns
> null it always return a array (may be blank if no
> child bean i.e. SecondBean is added). 
> 
> Problem is createObject() method of my factory is not
> getting called in this scenario even though there is
> no SecondBean is added to FirstBean.
> 
> I debugged the problem and found that if
> getSecondBeanArray() returns a null then only my
> factory is getting called. 
> 
> But I can't return null from getSecondBeanArray()
> method.
> 
> Is there any direct way to solve this problem ??
> If not, is there any way if I extend some classes of
> JXPath API and register those
> 
> Thanks
> Puneet
> 
> 
> 
> __________________________________ 
> Do you Yahoo!? 
> The all-new My Yahoo! - What will yours do?
> http://my.yahoo.com 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-dev-help@jakarta.apache.org
> 
>


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


Re: [jxpath] Array Creation Problem

Posted by Dmitri Plotnikov <dm...@apache.org>.
Dear Puneet,

JXPath is designed to support both null and empty arrays.  If there is a 
problem, I cannot glean the what it is from the explanations you provided. 
Could you post a test case that illustrates the issue?

Thank you,

- Dmitri

----- Original Message ----- 
From: "puneet sharma" <pu...@yahoo.com>
To: "Jakarta Commons Developers List" <co...@jakarta.apache.org>
Sent: Thursday, January 13, 2005 7:10 AM
Subject: [jxpath] Array Creation Problem


> Hi All,
>
> I am trying to call createPath to create array type of
> bean. I have registered my own AbstractFactory to the
> context.
>
> I am calling
> jxPathContext.createPath("secondBeanArray[1]/thirdBean").
> I have created the context using FirstBean.
>
> Method getSecondBeanArray() of FirstBean never returns
> null it always return a array (may be blank if no
> child bean i.e. SecondBean is added).
>
> Problem is createObject() method of my factory is not
> getting called in this scenario even though there is
> no SecondBean already added to FirstBean.
>
> I debugged the problem and found that if
> getSecondBeanArray() returns a null then only my
> factory is getting called. But I can't return null
> from getSecondBeanArray() method.
>
> Is there any direct way to solve this problem ??
>
> If not, is there any way if I extend some classes of
> JXPath API and register those back?
>
> I saw the code also of JXPath API. And found that
> BeanPropertyPointer.createPath() is calling the
> PropertyPointer to create the node only in case of
> null.
>
> Thanks
> Puneet
>
>
>
> __________________________________
> Do you Yahoo!?
> Meet the all-new My Yahoo! - Try it today!
> http://my.yahoo.com
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-dev-help@jakarta.apache.org
>
>
> 


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


[jxpath] Array Creation Problem

Posted by puneet sharma <pu...@yahoo.com>.
Hi All,

I am trying to call createPath to create array type of
bean. I have registered my own AbstractFactory to the
context.

I am calling
jxPathContext.createPath("secondBeanArray[1]/thirdBean").
I have created the context using FirstBean. 

Method getSecondBeanArray() of FirstBean never returns
null it always return a array (may be blank if no
child bean i.e. SecondBean is added). 

Problem is createObject() method of my factory is not
getting called in this scenario even though there is
no SecondBean already added to FirstBean.

I debugged the problem and found that if
getSecondBeanArray() returns a null then only my
factory is getting called. But I can't return null
from getSecondBeanArray() method.

Is there any direct way to solve this problem ??

If not, is there any way if I extend some classes of
JXPath API and register those back?

I saw the code also of JXPath API. And found that
BeanPropertyPointer.createPath() is calling the
PropertyPointer to create the node only in case of
null.

Thanks
Puneet


		
__________________________________ 
Do you Yahoo!? 
Meet the all-new My Yahoo! - Try it today! 
http://my.yahoo.com 
 


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


Re: [jxpath] Urgent : Array createPath problem

Posted by puneet sharma <pu...@yahoo.com>.
Thanks for the reply

But I could not make out anything from your reply.

Can you elaborate some more. Which prefix you are
talking here ??

Puneet



--- Stephen Colebourne <sc...@btopenworld.com>
wrote:

> Use correct prefix
> ----- Original Message ----- 
> > Hi All,
> > 
> > I am trying to call createPath to create array
> type of
> > bean. I have registered my own AbstractFactory to
> the
> > context.
> > 
> > I am calling
> >
>
jxPathContext.createPath("secondBeanArray[1]/thirdBean")
> > . I have create the context using FirstBean. 
> > 
> > Method getSecondBeanArray() of FirstBean never
> returns
> > null it always return a array (may be blank if no
> > child bean i.e. SecondBean is added). 
> > 
> > Problem is createObject() method of my factory is
> not
> > getting called in this scenario even though there
> is
> > no SecondBean is added to FirstBean.
> > 
> > I debugged the problem and found that if
> > getSecondBeanArray() returns a null then only my
> > factory is getting called. 
> > 
> > But I can't return null from getSecondBeanArray()
> > method.
> > 
> > Is there any direct way to solve this problem ??
> > If not, is there any way if I extend some classes
> of
> > JXPath API and register those
> > 
> > Thanks
> > Puneet
> > 
> > 
> > 
> > __________________________________ 
> > Do you Yahoo!? 
> > The all-new My Yahoo! - What will yours do?
> > http://my.yahoo.com 
> > 
> >
>
---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> commons-dev-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail:
> commons-dev-help@jakarta.apache.org
> > 
> >
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
> commons-dev-help@jakarta.apache.org
> 
> 



		
__________________________________ 
Do you Yahoo!? 
Meet the all-new My Yahoo! - Try it today! 
http://my.yahoo.com 
 


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