Fwd: Changing an arraylist's tag name

View: New views
6 Messages — Rating Filter:   Alert me  

Parent Message unknown Fwd: Changing an arraylist's tag name

by Fernandez Pablo :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message



---------- Forwarded message ----------
From: pablo fernandez <fernandezpablo85@...>
Date: Mon, Sep 7, 2009 at 12:36 PM
Subject: Changing an arraylist's tag name
To: user@...


Hi,

When I pass the marshaller a collection of mapped objects (say List<Person>), the result is wrapped in two <array-list> tags...

Is it possible to change it to something like <people><person>....</person></people>?

--
Fernandez, Pablo.



--
Fernandez, Pablo.

Re: Fwd: Changing an arraylist's tag name

by Werner Guttmann-6 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

are you already using mapping file ?

lG.
Werner

pablo fernandez wrote:

> ---------- Forwarded message ----------
> From: pablo fernandez <fernandezpablo85@...>
> Date: Mon, Sep 7, 2009 at 12:36 PM
> Subject: Changing an arraylist's tag name
> To: user@...
>
>
> Hi,
>
> When I pass the marshaller a collection of mapped objects (say
> List<Person>), the result is wrapped in two <array-list> tags...
>
> Is it possible to change it to something like
> <people><person>....</person></people>?
>

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



Re: Fwd: Changing an arraylist's tag name

by Fernandez Pablo :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Werner,

Yes, I'm using a mapping file for the Person object, to map fields to tag names, the problem is that I would need kind of a mapping file for the collection...

I'm wondering if there's a way to define the value of the tag of a collection of objects, something like this on-collection attribute (I made this up):

<mapping>
    <class name="com.model.Person" [on-collection="people"]>
        <field name="userID">
            <bind-xml node="element" name="userID" />
        </field>

On Tue, Sep 8, 2009 at 12:46 PM, Werner Guttmann <wguttmn@...> wrote:
Hi,

are you already using mapping file ?

lG.
Werner

pablo fernandez wrote:
> ---------- Forwarded message ----------
> From: pablo fernandez <fernandezpablo85@...>
> Date: Mon, Sep 7, 2009 at 12:36 PM
> Subject: Changing an arraylist's tag name
> To: user@...
>
>
> Hi,
>
> When I pass the marshaller a collection of mapped objects (say
> List<Person>), the result is wrapped in two <array-list> tags...
>
> Is it possible to change it to something like
> <people><person>....</person></people>?
>

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email





--
Fernandez, Pablo.

Re: Fwd: Changing an arraylist's tag name

by Werner Guttmann-6 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

pablo fernandez wrote:
> Hi Werner,
>
> Yes, I'm using a mapping file for the Person object, to map fields to tag
> names, the problem is that I would need kind of a mapping file for the
> collection...
>
> I'm wondering if there's a way to define the value of the tag of a
> collection of objects, something like this on-collection attribute (I made
> this up):
Not really. But have a look at Marshaller#setRootElement(String) that
allows you to configure the name of the root element upon marshalling.

>
> <mapping>
>     <class name="com.model.Person" [on-collection="people"]>
>         <field name="userID">
>             <bind-xml node="element" name="userID" />
>         </field>
>
> On Tue, Sep 8, 2009 at 12:46 PM, Werner Guttmann <wguttmn@...>wrote:
>
>> Hi,
>>
>> are you already using mapping file ?
>>
>> lG.
>> Werner
>>
>> pablo fernandez wrote:
>>> ---------- Forwarded message ----------
>>> From: pablo fernandez <fernandezpablo85@...>
>>> Date: Mon, Sep 7, 2009 at 12:36 PM
>>> Subject: Changing an arraylist's tag name
>>> To: user@...
>>>
>>>
>>> Hi,
>>>
>>> When I pass the marshaller a collection of mapped objects (say
>>> List<Person>), the result is wrapped in two <array-list> tags...
>>>
>>> Is it possible to change it to something like
>>> <people><person>....</person></people>?
>>>
>> ---------------------------------------------------------------------
>> To unsubscribe from this list, please visit:
>>
>>    http://xircles.codehaus.org/manage_email
>>
>>
>>
>
>

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



Re: Fwd: Changing an arraylist's tag name

by Fernandez Pablo :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thanks man, that really did the trick!


On Tue, Sep 8, 2009 at 1:15 PM, Werner Guttmann <wguttmn@...> wrote:
Hi,

pablo fernandez wrote:
> Hi Werner,
>
> Yes, I'm using a mapping file for the Person object, to map fields to tag
> names, the problem is that I would need kind of a mapping file for the
> collection...
>
> I'm wondering if there's a way to define the value of the tag of a
> collection of objects, something like this on-collection attribute (I made
> this up):
Not really. But have a look at Marshaller#setRootElement(String) that
allows you to configure the name of the root element upon marshalling.

>
> <mapping>
>     <class name="com.model.Person" [on-collection="people"]>
>         <field name="userID">
>             <bind-xml node="element" name="userID" />
>         </field>
>
> On Tue, Sep 8, 2009 at 12:46 PM, Werner Guttmann <wguttmn@...>wrote:
>
>> Hi,
>>
>> are you already using mapping file ?
>>
>> lG.
>> Werner
>>
>> pablo fernandez wrote:
>>> ---------- Forwarded message ----------
>>> From: pablo fernandez <fernandezpablo85@...>
>>> Date: Mon, Sep 7, 2009 at 12:36 PM
>>> Subject: Changing an arraylist's tag name
>>> To: user@...
>>>
>>>
>>> Hi,
>>>
>>> When I pass the marshaller a collection of mapped objects (say
>>> List<Person>), the result is wrapped in two <array-list> tags...
>>>
>>> Is it possible to change it to something like
>>> <people><person>....</person></people>?
>>>
>> ---------------------------------------------------------------------
>> To unsubscribe from this list, please visit:
>>
>>    http://xircles.codehaus.org/manage_email
>>
>>
>>
>
>

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email





--
Fernandez, Pablo.

Re: Fwd: Changing an arraylist's tag name

by Werner Guttmann-6 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

You are welcome.

Werner

pablo fernandez wrote:

> Thanks man, that really did the trick!
>
>
> On Tue, Sep 8, 2009 at 1:15 PM, Werner Guttmann <wguttmn@...>wrote:
>
>> Hi,
>>
>> pablo fernandez wrote:
>>> Hi Werner,
>>>
>>> Yes, I'm using a mapping file for the Person object, to map fields to tag
>>> names, the problem is that I would need kind of a mapping file for the
>>> collection...
>>>
>>> I'm wondering if there's a way to define the value of the tag of a
>>> collection of objects, something like this on-collection attribute (I
>> made
>>> this up):
>> Not really. But have a look at Marshaller#setRootElement(String) that
>> allows you to configure the name of the root element upon marshalling.
>>
>>> <mapping>
>>>     <class name="com.model.Person" [on-collection="people"]>
>>>         <field name="userID">
>>>             <bind-xml node="element" name="userID" />
>>>         </field>
>>>
>>> On Tue, Sep 8, 2009 at 12:46 PM, Werner Guttmann <wguttmn@...
>>> wrote:
>>>
>>>> Hi,
>>>>
>>>> are you already using mapping file ?
>>>>
>>>> lG.
>>>> Werner
>>>>
>>>> pablo fernandez wrote:
>>>>> ---------- Forwarded message ----------
>>>>> From: pablo fernandez <fernandezpablo85@...>
>>>>> Date: Mon, Sep 7, 2009 at 12:36 PM
>>>>> Subject: Changing an arraylist's tag name
>>>>> To: user@...
>>>>>
>>>>>
>>>>> Hi,
>>>>>
>>>>> When I pass the marshaller a collection of mapped objects (say
>>>>> List<Person>), the result is wrapped in two <array-list> tags...
>>>>>
>>>>> Is it possible to change it to something like
>>>>> <people><person>....</person></people>?
>>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe from this list, please visit:
>>>>
>>>>    http://xircles.codehaus.org/manage_email
>>>>
>>>>
>>>>
>>>
>> ---------------------------------------------------------------------
>> To unsubscribe from this list, please visit:
>>
>>    http://xircles.codehaus.org/manage_email
>>
>>
>>
>
>

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email