commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From José Antonio Pérez Testa <japte...@indra.es>
Subject Re: [Digester] Question on CallMethodRule
Date Wed, 19 Nov 2003 18:33:59 GMT
Sorry,

digester.addSetNext("a/b", "addB");

Explanation: calls objectA.addB(objectB) , 
 how?
  - calls the method indicated ("addB") in the stack's top object


Shapira, Yoav wrote:

>Hi again,
>I've read the article -- excellent reference, thank you.
>I also read your suggestion with the SetNextRule, and it
>makes perfect sense.
>
>But now I'm getting a NullPointerException with the stack empty warning.
>
>My XML is:
><a>
>  <b className="package.class"
>     attributeName="attributeValue" />
></a>
>
>My code is:
>digester.addObjectCreate("a", A.class);
>digester.addObjectCreate("a/b", null, "className");
>digester.addSetProperties("a/b");
>digester.addSetNext("a", "addB");
>
>But I get:
>org.apache.commons.digester.Digester peek
>WARNING: Empty stack (returning null)
>org.apache.commons.digester.Digester endElement
>SEVERV: End event threw exception
>java.lang.NullPointerException
>  at org.apache.commons.beanutils.MethodUtils.invokeMethod
>  at org.apache.commons.digester.SetNextRule.end
>  ...
>
>Is the A element gone when the SetNextRule ends?  How come?
>
>Thanks a bunch!
>
>Yoav Shapira
>Millennium ChemInformatics
>
>
>  
>
>>-----Original Message-----
>>From: José Antonio Pérez Testa [mailto:japtesta@indra.es]
>>Sent: Wednesday, November 19, 2003 12:58 PM
>>To: Jakarta Commons Users List
>>Subject: Re: [Digester] Question on CallMethodRule
>>
>>By the way, you coud read the following article, before posting to the
>>list ( just a suggestion :) )
>>http://www.onjava.com/lpt/a/2746
>>
>>Shapira, Yoav wrote:
>>
>>    
>>
>>>Hi,
>>>I have this XML:
>>><a>
>>> <b> ... </b>
>>> <b> ... </b>
>>> <b> ... </b>
>>></a>
>>>
>>>Class A has a public no-args constructor and a method
>>>public void addB(B b).
>>>
>>>I have the following:
>>>digester.addObjectCreate("a", A.class);
>>>digester.addObjectCreate("a/b", B.class);
>>>digester.addSetProperties("a/b");
>>>
>>>Now I want to add a CallMethodRule (or something else?) to call the addB
>>>method of class A.  How would I do this?
>>>
>>>Thanks,
>>>
>>>Yoav Shapira
>>>Millennium ChemInformatics
>>>
>>>
>>>
>>>
>>>
>>>This e-mail, including any attachments, is a confidential business
>>>      
>>>
>>communication, and may contain information that is confidential,
>>proprietary and/or privileged.  This e-mail is intended only for the
>>individual(s) to whom it is addressed, and may not be saved, copied,
>>printed, disclosed or used by anyone else.  If you are not the(an) intended
>>recipient, please immediately delete this e-mail from your computer system
>>and notify the sender.  Thank you.
>>    
>>
>>>---------------------------------------------------------------------
>>>To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
>>>For additional commands, e-mail: commons-user-help@jakarta.apache.org
>>>
>>>
>>>
>>>      
>>>
>>---------------------------------------------------------------------------
>>----------------------------------------
>>Este correo electrónico y, en su caso, cualquier fichero anexo al mismo,
>>contiene información de carácter confidencial exclusivamente dirigida a su
>>destinatario o destinatarios. Queda prohibida su divulgación, copia o
>>distribución a terceros sin la previa autorización escrita de Indra. En el
>>caso de haber recibido este correo electrónico por error, se ruega
>>notificar inmediatamente esta circunstancia mediante reenvío a la dirección
>>electrónica del remitente.
>>
>>The information in this e-mail and in any attachments is confidential and
>>solely for the attention and use of the named addressee(s). You are hereby
>>notified that any dissemination, distribution or copy of this communication
>>is prohibited without the prior written consent of Indra. If you have
>>received this communication in error, please, notify the sender by reply e-
>>mail
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: commons-user-help@jakarta.apache.org
>>    
>>
>
>
>
>
>This e-mail, including any attachments, is a confidential business communication, and
may contain information that is confidential, proprietary and/or privileged.  This e-mail
is intended only for the individual(s) to whom it is addressed, and may not be saved, copied,
printed, disclosed or used by anyone else.  If you are not the(an) intended recipient, please
immediately delete this e-mail from your computer system and notify the sender.  Thank you.
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: commons-user-help@jakarta.apache.org
>
>  
>


-------------------------------------------------------------------------------------------------------------------
Este correo electrónico y, en su caso, cualquier fichero anexo al mismo, contiene información
de carácter confidencial exclusivamente dirigida a su destinatario o destinatarios. Queda
prohibida su divulgación, copia o distribución a terceros sin la previa autorización escrita
de Indra. En el caso de haber recibido este correo electrónico por error, se ruega notificar
inmediatamente esta circunstancia mediante reenvío a la dirección electrónica del remitente.

The information in this e-mail and in any attachments is confidential and solely for the attention
and use of the named addressee(s). You are hereby notified that any dissemination, distribution
or copy of this communication is prohibited without the prior written consent of Indra. If
you have received this communication in error, please, notify the sender by reply e-mail

---------------------------------------------------------------------
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