You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Leonardo Larraquy <ll...@hotmail.com> on 2004/12/10 21:16:59 UTC

Digester doubts...

Hi experts:
    I've got a doubt about digester, it's simple, I need to provide it a Factory to search for my objects.
    Here's a part of my XML.
<Puma_Producto name="SourceKey_1" Datetime="Datetime_1" Action="Action_1">
<Datos CODE="CODIGO_1" DESCR="DESCRIPCION_1"></Datos>

Here's what I'm doing now.

digester.addObjectCreate("Puma_Producto/Datos", "com.jkt.puma.articulos.bm.Articulo");

I tell him that when he finds "Puma_Producto/Datos", to give me a instance of Articulo.

Now I what to tell him to give me an instace of Articulo, but telling a Factory to do so with the value "Puma_Producto/Datos/CODE".

Is that possible??

Thanks in advance.


Re: Digester doubts...

Posted by robert burrell donkin <ro...@blueyonder.co.uk>.
hi Leonardo

the standard rules which ship with digester includes FactoryCreateRule. 
this only supplies the element attributes to the factory (and not the 
path). so, if you really need the path, the easiest way to proceed is 
to create a new custom rule implementation. it should be pretty 
straightforward. take a look at FactoryCreateRule as an example.

- robert

On 10 Dec 2004, at 20:16, Leonardo Larraquy wrote:

> Hi experts:
>     I've got a doubt about digester, it's simple, I need to provide it 
> a Factory to search for my objects.
>     Here's a part of my XML.
> <Puma_Producto name="SourceKey_1" Datetime="Datetime_1" 
> Action="Action_1">
> <Datos CODE="CODIGO_1" DESCR="DESCRIPCION_1"></Datos>
>
> Here's what I'm doing now.
>
> digester.addObjectCreate("Puma_Producto/Datos", 
> "com.jkt.puma.articulos.bm.Articulo");
>
> I tell him that when he finds "Puma_Producto/Datos", to give me a 
> instance of Articulo.
>
> Now I what to tell him to give me an instace of Articulo, but telling 
> a Factory to do so with the value "Puma_Producto/Datos/CODE".
>
> Is that possible??
>
> Thanks in advance.
>


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