You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by "Diego H. Mornacco" <dm...@yahoo.com.ar> on 2005/12/26 21:32:24 UTC
List of Strings
Hallo
Excuse my english, but I am from Argentina and my
english sucks =)
I'm having problems trying to read a list of Strings
I'm getting an ArrayList with 4 null Objects
Anyone can help me?
The xml looks like this:
<Transaccion>
<TipoOperaciones>
<Operacion>aString</Operacion>
<Operacion>another</Operacion>
<Operacion>and</Operacion>
<Operacion>another</Operacion>
</TipoOperaciones>
</Transaccion>
The dot-betwixt is this:
<class
name="ar.com.comafi.ebanking.model.comex.TransaccionComexBean">
<element name="Transaccion">
<element name="TipoOperaciones">
<element name="Operacion"
property="tipoOperaciones" class="java.lang.String"
updater="addTipoOperaciones"/>
</element>
</element>
</class>
And the java bean is this:
package ar.com.comafi.ebanking.model.comex;
import java.util.ArrayList;
import java.util.List;
import ar.com.comafi.ebanking.common.model.CuentaBean;
import ar.com.comafi.ebanking.common.model.Empresa;
import ar.com.comafi.ebanking.common.model.Usuario;
public class TransaccionComexBean implements
java.io.Serializable
{
private ArrayList tipoOperaciones = new ArrayList();
//Tipos: CDI, OPI, BOLETO VENTA, BOLETO COMPRA
public TransaccionComexBean()
{
}
public void setTipoOperaciones(ArrayList
tipoOperaciones)
{
this.tipoOperaciones = tipoOperaciones;
}
/**
* @return Returns the tipoOperaciones.
*/
public ArrayList getTipoOperaciones()
{
return tipoOperaciones;
}
public void addTipoOperacion(String tipoOperacion)
{
if (this.tipoOperaciones == null)
{
this.tipoOperaciones = new ArrayList();
}
this.tipoOperaciones.add(tipoOperacion);
}
}
Thank in advanced!!!
___________________________________________________________
1GB gratis, Antivirus y Antispam
Correo Yahoo!, el mejor correo web del mundo
http://correo.yahoo.com.ar
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org
Re: List of Strings
Posted by dh...@yahoo.com.ar.
Hi,
I've worked it out!
I added <addDefaults/> to the mapping and it works
fine
Thanks for your help anyway
Bye!
--- Muhammad Islam <sh...@gmail.com> escribió:
> Hi,
>
> Check the point from where you calling
> addTipoOperacion(...). I guess you
> are using some xml parser. Check your xml parser.
> Hope this helps you.
>
> Regards,
> shagor
>
> On 12/26/05, Diego H. Mornacco
> <dm...@yahoo.com.ar> wrote:
> >
> > Hallo
> >
> > Excuse my english, but I am from Argentina and my
> > english sucks =)
> >
> > I'm having problems trying to read a list of
> Strings
> >
> > I'm getting an ArrayList with 4 null Objects
> >
> > Anyone can help me?
> >
> >
> > The xml looks like this:
> >
> > <Transaccion>
> > <TipoOperaciones>
> > <Operacion>aString</Operacion>
> > <Operacion>another</Operacion>
> > <Operacion>and</Operacion>
> > <Operacion>another</Operacion>
> > </TipoOperaciones>
> > </Transaccion>
> >
> >
> > The dot-betwixt is this:
> >
> > <class
> >
>
name="ar.com.comafi.ebanking.model.comex.TransaccionComexBean">
> > <element name="Transaccion">
> > <element name="TipoOperaciones">
> > <element name="Operacion"
> > property="tipoOperaciones"
> class="java.lang.String"
> > updater="addTipoOperaciones"/>
> > </element>
> > </element>
> > </class>
> >
> > And the java bean is this:
> >
> > package ar.com.comafi.ebanking.model.comex;
> >
> > import java.util.ArrayList;
> > import java.util.List;
> > import
> ar.com.comafi.ebanking.common.model.CuentaBean;
> > import
> ar.com.comafi.ebanking.common.model.Empresa;
> > import
> ar.com.comafi.ebanking.common.model.Usuario;
> >
> > public class TransaccionComexBean implements
> > java.io.Serializable
> > {
> > private ArrayList tipoOperaciones = new
> ArrayList();
> > //Tipos: CDI, OPI, BOLETO VENTA, BOLETO COMPRA
> >
> > public TransaccionComexBean()
> > {
> > }
> >
> >
> > public void setTipoOperaciones(ArrayList
> > tipoOperaciones)
> > {
> > this.tipoOperaciones =
> tipoOperaciones;
> > }
> >
> > /**
> > * @return Returns the tipoOperaciones.
> > */
> > public ArrayList getTipoOperaciones()
> > {
> > return tipoOperaciones;
> > }
> >
> >
> > public void addTipoOperacion(String
> tipoOperacion)
> > {
> > if (this.tipoOperaciones == null)
> > {
> > this.tipoOperaciones = new
> ArrayList();
> > }
> >
> this.tipoOperaciones.add(tipoOperacion);
> > }
> >
> > }
> >
> > Thank in advanced!!!
> >
> >
> >
> >
> >
> >
> >
> >
>
___________________________________________________________
> > 1GB gratis, Antivirus y Antispam
> > Correo Yahoo!, el mejor correo web del mundo
> > http://correo.yahoo.com.ar
> >
> >
> >
>
---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> commons-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail:
> commons-user-help@jakarta.apache.org
> >
> >
>
___________________________________________________________
1GB gratis, Antivirus y Antispam
Correo Yahoo!, el mejor correo web del mundo
http://correo.yahoo.com.ar
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org
Re: List of Strings
Posted by Muhammad Islam <sh...@gmail.com>.
Hi,
Check the point from where you calling addTipoOperacion(...). I guess you
are using some xml parser. Check your xml parser. Hope this helps you.
Regards,
shagor
On 12/26/05, Diego H. Mornacco <dm...@yahoo.com.ar> wrote:
>
> Hallo
>
> Excuse my english, but I am from Argentina and my
> english sucks =)
>
> I'm having problems trying to read a list of Strings
>
> I'm getting an ArrayList with 4 null Objects
>
> Anyone can help me?
>
>
> The xml looks like this:
>
> <Transaccion>
> <TipoOperaciones>
> <Operacion>aString</Operacion>
> <Operacion>another</Operacion>
> <Operacion>and</Operacion>
> <Operacion>another</Operacion>
> </TipoOperaciones>
> </Transaccion>
>
>
> The dot-betwixt is this:
>
> <class
> name="ar.com.comafi.ebanking.model.comex.TransaccionComexBean">
> <element name="Transaccion">
> <element name="TipoOperaciones">
> <element name="Operacion"
> property="tipoOperaciones" class="java.lang.String"
> updater="addTipoOperaciones"/>
> </element>
> </element>
> </class>
>
> And the java bean is this:
>
> package ar.com.comafi.ebanking.model.comex;
>
> import java.util.ArrayList;
> import java.util.List;
> import ar.com.comafi.ebanking.common.model.CuentaBean;
> import ar.com.comafi.ebanking.common.model.Empresa;
> import ar.com.comafi.ebanking.common.model.Usuario;
>
> public class TransaccionComexBean implements
> java.io.Serializable
> {
> private ArrayList tipoOperaciones = new ArrayList();
> //Tipos: CDI, OPI, BOLETO VENTA, BOLETO COMPRA
>
> public TransaccionComexBean()
> {
> }
>
>
> public void setTipoOperaciones(ArrayList
> tipoOperaciones)
> {
> this.tipoOperaciones = tipoOperaciones;
> }
>
> /**
> * @return Returns the tipoOperaciones.
> */
> public ArrayList getTipoOperaciones()
> {
> return tipoOperaciones;
> }
>
>
> public void addTipoOperacion(String tipoOperacion)
> {
> if (this.tipoOperaciones == null)
> {
> this.tipoOperaciones = new ArrayList();
> }
> this.tipoOperaciones.add(tipoOperacion);
> }
>
> }
>
> Thank in advanced!!!
>
>
>
>
>
>
>
> ___________________________________________________________
> 1GB gratis, Antivirus y Antispam
> Correo Yahoo!, el mejor correo web del mundo
> http://correo.yahoo.com.ar
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
>
>