You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@pivot.apache.org by lello <rb...@gmail.com> on 2011/02/17 23:10:21 UTC
Serialization exception
Hi all,
I have some problem with the serialization of a bxml file.
Basically I have a class which is a just a container with some covenience
methods:
public class C implements Bindable {
@BXML private TablePane tablePane;
@BXML private TableView tableView;
//contructor...
public TablePane getPane() {
return tablePane
}
// some other method
}
then I have a bxml file which reads something like.
<mynamespace:C>
<TablePane bxml:id="tablePane" />
<-- and so on-->
</mynamespace:C>
Now, when I try to serialize this file I get a serialization exception that
says "C is not a Sequence".
Is it possible to do what I am doing or is it totaly wrong?
thanks
--
View this message in context: http://apache-pivot-users.399431.n3.nabble.com/Serialization-exception-tp2522820p2522820.html
Sent from the Apache Pivot - Users mailing list archive at Nabble.com.
Re: Serialization exception
Posted by Greg Brown <gk...@verizon.net>.
You can use a BXMLSerializer instance to read more than one BXML file.
G
On Feb 18, 2011, at 3:09 AM, lello wrote:
>
> Thanks,
>
> I have a last doubt, concerning the use of a serializer.
> What is the best approach when I create a new instance of an object from a
> bxml file,
> do I need to create a new serializer each time
> or can I use just one instance of a static serializer and use it to create
> all the object instances I need?
> Sorry for the question, but I am not really familiar with creating instances
> of objects in this way.
> --
> View this message in context: http://apache-pivot-users.399431.n3.nabble.com/Serialization-exception-tp2522820p2525123.html
> Sent from the Apache Pivot - Users mailing list archive at Nabble.com.
Re: Serialization exception
Posted by lello <rb...@gmail.com>.
Thanks,
I have a last doubt, concerning the use of a serializer.
What is the best approach when I create a new instance of an object from a
bxml file,
do I need to create a new serializer each time
or can I use just one instance of a static serializer and use it to create
all the object instances I need?
Sorry for the question, but I am not really familiar with creating instances
of objects in this way.
--
View this message in context: http://apache-pivot-users.399431.n3.nabble.com/Serialization-exception-tp2522820p2525123.html
Sent from the Apache Pivot - Users mailing list archive at Nabble.com.
Re: Serialization exception
Posted by Chris Bartlett <cb...@gmail.com>.
Use one or more define blocks in your BXML. This will create the objects,
but won't attempt to set/add them to the enclosing class (C).
<bxml:define>
<TablePane bxml:id="tablePane" />
<TableView bxml:id="tableView" />
</bxml:define>
http://pivot.apache.org/tutorials/bxml-primer.html
Chris
On 18 February 2011 05:10, lello <rb...@gmail.com> wrote:
>
> Hi all,
> I have some problem with the serialization of a bxml file.
> Basically I have a class which is a just a container with some covenience
> methods:
>
> public class C implements Bindable {
> @BXML private TablePane tablePane;
> @BXML private TableView tableView;
>
> //contructor...
>
> public TablePane getPane() {
> return tablePane
> }
>
> // some other method
> }
>
> then I have a bxml file which reads something like.
>
> <mynamespace:C>
>
> <TablePane bxml:id="tablePane" />
>
> <-- and so on-->
> </mynamespace:C>
>
> Now, when I try to serialize this file I get a serialization exception that
> says "C is not a Sequence".
> Is it possible to do what I am doing or is it totaly wrong?
>
> thanks
> --
> View this message in context:
> http://apache-pivot-users.399431.n3.nabble.com/Serialization-exception-tp2522820p2522820.html
> Sent from the Apache Pivot - Users mailing list archive at Nabble.com.
>