simple-support Mailing List for Simple (Page 37)
Brought to you by:
niallg
You can subscribe to this list here.
| 2007 |
Jan
|
Feb
(2) |
Mar
(2) |
Apr
(13) |
May
(13) |
Jun
(27) |
Jul
(4) |
Aug
(14) |
Sep
(7) |
Oct
|
Nov
(6) |
Dec
(24) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2008 |
Jan
|
Feb
(21) |
Mar
(10) |
Apr
(15) |
May
(24) |
Jun
(24) |
Jul
(30) |
Aug
(5) |
Sep
(19) |
Oct
(27) |
Nov
(16) |
Dec
(24) |
| 2009 |
Jan
(34) |
Feb
(24) |
Mar
(35) |
Apr
(26) |
May
(8) |
Jun
(17) |
Jul
(28) |
Aug
(31) |
Sep
(36) |
Oct
(35) |
Nov
(20) |
Dec
(16) |
| 2010 |
Jan
(40) |
Feb
(21) |
Mar
(47) |
Apr
(45) |
May
(34) |
Jun
(68) |
Jul
(46) |
Aug
(39) |
Sep
(47) |
Oct
(20) |
Nov
(42) |
Dec
(13) |
| 2011 |
Jan
(41) |
Feb
(16) |
Mar
(32) |
Apr
(44) |
May
(28) |
Jun
(35) |
Jul
(37) |
Aug
(33) |
Sep
(60) |
Oct
(20) |
Nov
(35) |
Dec
(23) |
| 2012 |
Jan
(34) |
Feb
(23) |
Mar
(34) |
Apr
(21) |
May
(48) |
Jun
(24) |
Jul
(31) |
Aug
(39) |
Sep
(25) |
Oct
(10) |
Nov
(27) |
Dec
(28) |
| 2013 |
Jan
(32) |
Feb
(24) |
Mar
(24) |
Apr
(9) |
May
(4) |
Jun
(6) |
Jul
(2) |
Aug
(5) |
Sep
|
Oct
(5) |
Nov
(1) |
Dec
(12) |
| 2014 |
Jan
(14) |
Feb
(16) |
Mar
(5) |
Apr
(3) |
May
(2) |
Jun
(8) |
Jul
(2) |
Aug
|
Sep
(6) |
Oct
|
Nov
(6) |
Dec
|
| 2015 |
Jan
(3) |
Feb
(15) |
Mar
(7) |
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
(2) |
Oct
|
Nov
|
Dec
(1) |
| 2016 |
Jan
|
Feb
(6) |
Mar
(2) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2017 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2018 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
|
| 2019 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: Dušan M. <dus...@gm...> - 2011-02-25 14:05:28
|
I share your frustration, I didn't get much support here either. On Fri, Feb 25, 2011 at 14:13, Eduardo Martins <emm...@gm...> wrote: > Hi, is there someone kind to reply? > > -- Eduardo > .............................................. > http://emmartins.blogspot.com > http://redhat.com/solutions/telco > > > > On Thu, Feb 17, 2011 at 12:02 PM, Eduardo Martins <emm...@gm...> > wrote: > > Hi, I'm currently evaluating the replacement of JAXB with Simple, and > > need some information, which I couldn't find in the website: > > > > 1) Is there a tool similar to xjc, which takes xsd as input and > > produces the pojos? > > > > 2) Is Simple able to mix different set of pojos, bound to different > > namespaces? For instance consider a schema which has an element that > > can be extended with another qualified element, such as > > > > <xs:any namespace="##other" processContents="lax" minOccurs="0" > > maxOccurs="unbounded"/> > > > > Now we throw some xml to Simple for deserialization, and in that "any" > > position comes an element bound to another set of Simple pojos, with > > different namespace(s), will the framework deserialize that element > > too into its own pojos? > > > > 3) Regarding serialization, and this is the major reason why I'm > > considering to leave JAXB, when there is a JAXBContext bound to > > multiple namespaces, the serialized xml root element will be "bloated" > > with all possible namespaces, even if there are no children elements > > with these namespaces. How does Simple handles such cases, same > > procedure as jaxb? Includes in root element only the uses namespaces? > > Declares "children" namespaces in all children elements, thus > > introducing multiplies declarations of same namespaces? > > > > Thanks in advance. > > > > -- Eduardo > > .............................................. > > http://emmartins.blogspot.com > > http://redhat.com/solutions/telco > > > > > ------------------------------------------------------------------------------ > Free Software Download: Index, Search & Analyze Logs and other IT data in > Real-Time with Splunk. Collect, index and harness all the fast moving IT > data > generated by your applications, servers and devices whether physical, > virtual > or in the cloud. Deliver compliance at lower cost and gain new business > insights. http://p.sf.net/sfu/splunk-dev2dev > _______________________________________________ > Simple-support mailing list > Sim...@li... > https://lists.sourceforge.net/lists/listinfo/simple-support > -- *+* *Best regards*, Dušan Maliarik // cell: +31646233420 *+* |
|
From: Александр (R. Щ. <ir...@gm...> - 2011-02-25 13:35:40
|
Hello,
I have the following problem with simpleframework.xml
<request>
<categories version="1"/>
<new version="2"/>
</request>
When i use annotations:
@Attribute(name = "version")
@Path("categories")
int newsVersion;
@Attribute(name = "version")
@Path("news")
int newsVersion;
I get the error:
Caused by: org.simpleframework.xml.core.PersistenceException: Annotation of
name 'version' declared twice
at
org.simpleframework.xml.core.StructureBuilder.process(StructureBuilder.java:198)
at
org.simpleframework.xml.core.StructureBuilder.process(StructureBuilder.java:158)
at org.simpleframework.xml.core.Scanner.field(Scanner.java:465)
at org.simpleframework.xml.core.Scanner.scan(Scanner.java:350)
at org.simpleframework.xml.core.Scanner.<init>(Scanner.java:91)
at
org.simpleframework.xml.core.ScannerFactory.getInstance(ScannerFactory.java:65)
at org.simpleframework.xml.core.Support.getScanner(Support.java:170)
at org.simpleframework.xml.core.Source.getScanner(Source.java:281)
at org.simpleframework.xml.core.Source.getSchema(Source.java:327)
at org.simpleframework.xml.core.Composite.read(Composite.java:183)
at org.simpleframework.xml.core.Composite.read(Composite.java:133)
at org.simpleframework.xml.core.Traverser.read(Traverser.java:92)
at org.simpleframework.xml.core.Persister.read(Persister.java:632)
at org.simpleframework.xml.core.Persister.read(Persister.java:613)
at org.simpleframework.xml.core.Persister.read(Persister.java:591)
at org.simpleframework.xml.core.Persister.read(Persister.java:569)
at org.simpleframework.xml.core.Persister.read(Persister.java:506)
at org.simpleframework.xml.core.Persister.read(Persister.java:415)
Seems like it's a bug.
--
Fairly,
Alexander (Ryoka) Shchegolev
|
|
From: Eduardo M. <emm...@gm...> - 2011-02-25 13:13:41
|
Hi, is there someone kind to reply? -- Eduardo .............................................. http://emmartins.blogspot.com http://redhat.com/solutions/telco On Thu, Feb 17, 2011 at 12:02 PM, Eduardo Martins <emm...@gm...> wrote: > Hi, I'm currently evaluating the replacement of JAXB with Simple, and > need some information, which I couldn't find in the website: > > 1) Is there a tool similar to xjc, which takes xsd as input and > produces the pojos? > > 2) Is Simple able to mix different set of pojos, bound to different > namespaces? For instance consider a schema which has an element that > can be extended with another qualified element, such as > > <xs:any namespace="##other" processContents="lax" minOccurs="0" > maxOccurs="unbounded"/> > > Now we throw some xml to Simple for deserialization, and in that "any" > position comes an element bound to another set of Simple pojos, with > different namespace(s), will the framework deserialize that element > too into its own pojos? > > 3) Regarding serialization, and this is the major reason why I'm > considering to leave JAXB, when there is a JAXBContext bound to > multiple namespaces, the serialized xml root element will be "bloated" > with all possible namespaces, even if there are no children elements > with these namespaces. How does Simple handles such cases, same > procedure as jaxb? Includes in root element only the uses namespaces? > Declares "children" namespaces in all children elements, thus > introducing multiplies declarations of same namespaces? > > Thanks in advance. > > -- Eduardo > .............................................. > http://emmartins.blogspot.com > http://redhat.com/solutions/telco > |
|
From: Alexey S. <al...@gm...> - 2011-02-18 23:19:23
|
Thanks to both Aaron and Niall for the detailed answers.
Looks like I have to ignore Android platform then and stick with old Castor
XML, which works OK for "real" Java.
On Fri, Feb 18, 2011 at 2:29 AM, Aaron Digulla <di...@he...> wrote:
> Zitat von Niall Gallagher <gal...@ya...>:
>
> > Hi,
> > There are some options in such cases, for instance you can write
> > your own Converter to perform mappings on specific objects. Another
> > is to accept both like so.
> > @Attribute(required=false)private String name;
> > @Attribute(required=false)private String login;
> > @Validateprivate void commit() throws Exception { if(name != null)
> > { setUserName(name); } else if(login != null) {
> > setUserName(login); }}
>
> His question was: "How can I achieve this *without* annotations?"
>
> Alexey, Simple-XML builds an internal data structure from the
> annotations. Unfortunately, all the code is package private and Niall
> doesn't use factories which you can override (for example
> ScannerFactory is created with new inside the constructor of Support).
>
> That means Simple XML is useless if you can't annotate your classes
> and you're not willing to patch the sources.
>
> Regards,
>
>
> >
> > --- On Thu, 17/2/11, Alexey Skor <al...@gm...> wrote:
> >
> > From: Alexey Skor <al...@gm...>
> > Subject: [Simple-support] using mapping files with Simple XML
> > To: sim...@li...
> > Received: Thursday, 17 February, 2011, 4:13 PM
> >
> > Hi!
> > I'm working on a Java API for Redmine's REST service (www.redmine.org).
> >
> > One of the users has recently submitted a bug that my API does not
> > work under Android OS:
> > https://code.google.com/p/redmine-java-api/issues/detail?id=17
> >
> >
> > I'm using Castor XML now, but unfortunately it does not work
> > under Android so I'm looking for some other solution...I'd like to
> > give SimpleXML a try, but don't want to add SimpleXML-specific
> > annotations to my objects. moreover having annotations is not
> > flexible - unfortunately, objects can be provided by the server in
> > different xml formats depending on how exactly I requested them.
> > so, in one case "user name" can be stored in "name" attribute, and
> > in another XML response from the REST service the same "user name"
> > can be provided in "login" attribute.
> >
> > the way I deal with this in Castor XML is I use different XML
> > mapping files for different requests/responses. e.g. one XML mapping
> > file for getting "users list" and and another mapping for getting
> > "project and its user/owner info".
> >
> >
> > any advice?
> > --
> > Alex
> >
> > -----Inline Attachment Follows-----
> >
> >
> ------------------------------------------------------------------------------
> > The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE:
> > Pinpoint memory and threading errors before they happen.
> > Find and fix more than 250 security defects in the development cycle.
> > Locate bottlenecks in serial and parallel code that limit performance.
> > http://p.sf.net/sfu/intel-dev2devfeb
> > -----Inline Attachment Follows-----
> >
> > _______________________________________________
> > Simple-support mailing list
> > Sim...@li...
> > https://lists.sourceforge.net/lists/listinfo/simple-support
> >
> >
> >
> >
>
>
>
> --
> Aaron "Optimizer" Digulla a.k.a. Philmann Dark
> "It's not the universe that's limited, it's our imagination.
> Follow me and I'll show you something beyond the limits."
> http://www.pdark.de/ http://blog.pdark.de/
>
>
> ------------------------------------------------------------------------------
> The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE:
> Pinpoint memory and threading errors before they happen.
> Find and fix more than 250 security defects in the development cycle.
> Locate bottlenecks in serial and parallel code that limit performance.
> http://p.sf.net/sfu/intel-dev2devfeb
> _______________________________________________
> Simple-support mailing list
> Sim...@li...
> https://lists.sourceforge.net/lists/listinfo/simple-support
>
--
Alex
|
|
From: Aaron D. <di...@he...> - 2011-02-18 10:29:27
|
Zitat von Niall Gallagher <gal...@ya...>:
> Hi,
> There are some options in such cases, for instance you can write
> your own Converter to perform mappings on specific objects. Another
> is to accept both like so.
> @Attribute(required=false)private String name;
> @Attribute(required=false)private String login;
> @Validateprivate void commit() throws Exception { if(name != null)
> { setUserName(name); } else if(login != null) {
> setUserName(login); }}
His question was: "How can I achieve this *without* annotations?"
Alexey, Simple-XML builds an internal data structure from the
annotations. Unfortunately, all the code is package private and Niall
doesn't use factories which you can override (for example
ScannerFactory is created with new inside the constructor of Support).
That means Simple XML is useless if you can't annotate your classes
and you're not willing to patch the sources.
Regards,
>
> --- On Thu, 17/2/11, Alexey Skor <al...@gm...> wrote:
>
> From: Alexey Skor <al...@gm...>
> Subject: [Simple-support] using mapping files with Simple XML
> To: sim...@li...
> Received: Thursday, 17 February, 2011, 4:13 PM
>
> Hi!
> I'm working on a Java API for Redmine's REST service (www.redmine.org).
>
> One of the users has recently submitted a bug that my API does not
> work under Android OS:
> https://code.google.com/p/redmine-java-api/issues/detail?id=17
>
>
> I'm using Castor XML now, but unfortunately it does not work
> under Android so I'm looking for some other solution...I'd like to
> give SimpleXML a try, but don't want to add SimpleXML-specific
> annotations to my objects. moreover having annotations is not
> flexible - unfortunately, objects can be provided by the server in
> different xml formats depending on how exactly I requested them.
> so, in one case "user name" can be stored in "name" attribute, and
> in another XML response from the REST service the same "user name"
> can be provided in "login" attribute.
>
> the way I deal with this in Castor XML is I use different XML
> mapping files for different requests/responses. e.g. one XML mapping
> file for getting "users list" and and another mapping for getting
> "project and its user/owner info".
>
>
> any advice?
> --
> Alex
>
> -----Inline Attachment Follows-----
>
> ------------------------------------------------------------------------------
> The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE:
> Pinpoint memory and threading errors before they happen.
> Find and fix more than 250 security defects in the development cycle.
> Locate bottlenecks in serial and parallel code that limit performance.
> http://p.sf.net/sfu/intel-dev2devfeb
> -----Inline Attachment Follows-----
>
> _______________________________________________
> Simple-support mailing list
> Sim...@li...
> https://lists.sourceforge.net/lists/listinfo/simple-support
>
>
>
>
--
Aaron "Optimizer" Digulla a.k.a. Philmann Dark
"It's not the universe that's limited, it's our imagination.
Follow me and I'll show you something beyond the limits."
http://www.pdark.de/ http://blog.pdark.de/
|
|
From: Dawid G. <daw...@gm...> - 2011-02-18 09:32:12
|
Hi, can we hope for getXMLString in official Simple release? niall.gallagher wrote: > > Hi, > > Thanks, ill take a look at this, looks like it could be a very useful > feature. > > Niall > > -- View this message in context: http://old.nabble.com/Deserialize-xml-element-as-string-tp28309099p30957074.html Sent from the Simple XML Serialization mailing list archive at Nabble.com. |
|
From: Niall G. <gal...@ya...> - 2011-02-18 07:51:26
|
Hi,
There are some options in such cases, for instance you can write your own Converter to perform mappings on specific objects. Another is to accept both like so.
@Attribute(required=false)private String name;
@Attribute(required=false)private String login;
@Validateprivate void commit() throws Exception { if(name != null) { setUserName(name); } else if(login != null) { setUserName(login); }}
Niall
--- On Thu, 17/2/11, Alexey Skor <al...@gm...> wrote:
From: Alexey Skor <al...@gm...>
Subject: [Simple-support] using mapping files with Simple XML
To: sim...@li...
Received: Thursday, 17 February, 2011, 4:13 PM
Hi!
I'm working on a Java API for Redmine's REST service (www.redmine.org).
One of the users has recently submitted a bug that my API does not work under Android OS: https://code.google.com/p/redmine-java-api/issues/detail?id=17
I'm using Castor XML now, but unfortunately it does not work under Android so I'm looking for some other solution...I'd like to give SimpleXML a try, but don't want to add SimpleXML-specific annotations to my objects. moreover having annotations is not flexible - unfortunately, objects can be provided by the server in different xml formats depending on how exactly I requested them. so, in one case "user name" can be stored in "name" attribute, and in another XML response from the REST service the same "user name" can be provided in "login" attribute.
the way I deal with this in Castor XML is I use different XML mapping files for different requests/responses. e.g. one XML mapping file for getting "users list" and and another mapping for getting "project and its user/owner info".
any advice?
--
Alex
-----Inline Attachment Follows-----
------------------------------------------------------------------------------
The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE:
Pinpoint memory and threading errors before they happen.
Find and fix more than 250 security defects in the development cycle.
Locate bottlenecks in serial and parallel code that limit performance.
http://p.sf.net/sfu/intel-dev2devfeb
-----Inline Attachment Follows-----
_______________________________________________
Simple-support mailing list
Sim...@li...
https://lists.sourceforge.net/lists/listinfo/simple-support
|
|
From: Alexey S. <al...@gm...> - 2011-02-18 00:13:47
|
Hi! I'm working on a Java API for Redmine's REST service (www.redmine.org). One of the users has recently submitted a bug that my API does not work under Android OS: https://code.google.com/p/redmine-java-api/issues/detail?id=17 I'm using Castor XML now, but unfortunately it does not work under Android so I'm looking for some other solution... I'd like to give SimpleXML a try, but don't want to add SimpleXML-specific annotations to my objects. moreover having annotations is not flexible - unfortunately, objects can be provided by the server in different xml formats depending on how exactly I requested them. so, in one case "user name" can be stored in "name" attribute, and in another XML response from the REST service the same "user name" can be provided in "login" attribute. the way I deal with this in Castor XML is I use different XML mapping files for different requests/responses. e.g. one XML mapping file for getting "users list" and and another mapping for getting "project and its user/owner info". any advice? -- Alex |
|
From: Eduardo M. <emm...@gm...> - 2011-02-17 12:06:48
|
Hi, I'm currently evaluating the replacement of JAXB with Simple, and
need some information, which I couldn't find in the website:
1) Is there a tool similar to xjc, which takes xsd as input and
produces the pojos?
2) Is Simple able to mix different set of pojos, bound to different
namespaces? For instance consider a schema which has an element that
can be extended with another qualified element, such as
<xs:any namespace="##other" processContents="lax" minOccurs="0"
maxOccurs="unbounded"/>
Now we throw some xml to Simple for deserialization, and in that "any"
position comes an element bound to another set of Simple pojos, with
different namespace(s), will the framework deserialize that element
too into its own pojos?
3) Regarding serialization, and this is the major reason why I'm
considering to leave JAXB, when there is a JAXBContext bound to
multiple namespaces, the serialized xml root element will be "bloated"
with all possible namespaces, even if there are no children elements
with these namespaces. How does Simple handles such cases, same
procedure as jaxb? Includes in root element only the uses namespaces?
Declares "children" namespaces in all children elements, thus
introducing multiplies declarations of same namespaces?
Thanks in advance.
-- Eduardo
..............................................
http://emmartins.blogspot.com
http://redhat.com/solutions/telco
|
|
From: Niall G. <gal...@ya...> - 2011-01-29 12:42:30
|
Hi, There are no real limits other that adhering to the Stategy interface, if there is an attribute that references something then just pick it out and use it. The CycleStrategy is not really much more than an IdentityHashMap, where you come up with the unique key. Niall --- On Sat, 29/1/11, Dušan Maliarik <dus...@gm...> wrote: From: Dušan Maliarik <dus...@gm...> Subject: Re: [Simple-support] Custom Referencing To: sim...@li... Received: Saturday, 29 January, 2011, 4:00 AM It seems that even with heavy copy pasting from org.simpleframework.xml.strategy the job can't be done because attribute can represent only primitive type. Is there a reason why attribute cannot represent Composite to allow referencing through attributes? 2011/1/27 Dušan Maliarik <dus...@gm...> That of course was the first thing I tried, but the problem is deeper. I'd need custom ReadGraph (package private), and it's still not clear where to put anyURI's # prefix. I don't see where the actual lookup is done. And even then, I'd endup with instance_geometry referring to geometry, and I'd loose child elements of instance_geometry. Actually only instance_geometry's url attribute should refer to geometry object, and the rest of it's children would still be accessible. I've done this before with JAXB, and python and ruby XML binding libs. But I have no idea how to implement this with simple (seems to be the only android compatible one). Apparently it's not that straight forward. On Thu, Jan 27, 2011 at 12:23, Niall Gallagher <gal...@ya...> wrote: Not sure exactly what the problem is here. But if the CycleStrategy does not work then just write your own strategy, e.g DusansNewCycleStategy, the implementation of the CycleStrategy can just be cut and pasted with modifications. --- On Thu, 27/1/11, Dušan Maliarik <dus...@gm...> wrote: From: Dušan Maliarik <dus...@gm...> Subject: [Simple-support] Custom Referencing To: sim...@li... Received: Thursday, 27 January, 2011, 3:07 AM Hi all, I chose simple for my android application for parsing COLLADA assets. They use object definition / reference schema, so I attempted to use CycleStrategy to ease the pain of traversing the object graph. I failed because in COLLADA schema, anyURI is used for referencing, which implies using hash (#) character in front of IDs. <geometry id="foo">...</geometry> and then <instance_geometry url="#foo">...</instance> I need to both resolve this reference, and have access to the child elements of instance_geometry. I haven't found a suitable place in simple to extend/override. What would be the most convenient solution to this problem in simple XML? -- +Best regards, Dušan Maliarik // cell: +31646233420+ -----Inline Attachment Follows----- ------------------------------------------------------------------------------ Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)! Finally, a world-class log management solution at an even better price-free! Download using promo code Free_Logger_4_Dev2Dev. Offer expires February 28th, so secure your free ArcSight Logger TODAY! http://p.sf.net/sfu/arcsight-sfd2d -----Inline Attachment Follows----- _______________________________________________ Simple-support mailing list Sim...@li... https://lists.sourceforge.net/lists/listinfo/simple-support -- +Best regards, Dušan Maliarik // cell: +31646233420+ -- +Best regards, Dušan Maliarik // cell: +31646233420+ -----Inline Attachment Follows----- ------------------------------------------------------------------------------ Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)! Finally, a world-class log management solution at an even better price-free! Download using promo code Free_Logger_4_Dev2Dev. Offer expires February 28th, so secure your free ArcSight Logger TODAY! http://p.sf.net/sfu/arcsight-sfd2d -----Inline Attachment Follows----- _______________________________________________ Simple-support mailing list Sim...@li... https://lists.sourceforge.net/lists/listinfo/simple-support |
|
From: Dušan M. <dus...@gm...> - 2011-01-29 12:00:37
|
It seems that even with heavy copy pasting from org.simpleframework.xml.strategy the job can't be done because attribute can represent only primitive type. Is there a reason why attribute cannot represent Composite to allow referencing through attributes? 2011/1/27 Dušan Maliarik <dus...@gm...> > That of course was the first thing I tried, but the problem is deeper. I'd > need custom ReadGraph (package private), and it's still not clear where to > put anyURI's # prefix. I don't see where the actual lookup is done. And even > then, I'd endup with instance_geometry referring to geometry, and I'd loose > child elements of instance_geometry. Actually only instance_geometry's url > attribute should refer to geometry object, and the rest of it's children > would still be accessible. I've done this before with JAXB, and python and > ruby XML binding libs. But I have no idea how to implement this with simple > (seems to be the only android compatible one). Apparently it's not that > straight forward. > > > On Thu, Jan 27, 2011 at 12:23, Niall Gallagher <gal...@ya...>wrote: > >> Not sure exactly what the problem is here. But if the CycleStrategy does >> not work then just write your own strategy, e.g DusansNewCycleStategy, the >> implementation of the CycleStrategy can just be cut and pasted with >> modifications. >> >> --- On *Thu, 27/1/11, Dušan Maliarik <dus...@gm...>* wrote: >> >> >> From: Dušan Maliarik <dus...@gm...> >> Subject: [Simple-support] Custom Referencing >> To: sim...@li... >> Received: Thursday, 27 January, 2011, 3:07 AM >> >> >> Hi all, >> >> I chose simple for my android application for parsing COLLADA assets. They >> use object definition / reference schema, so I attempted to use >> CycleStrategy to ease the pain of traversing the object graph. I failed >> because in COLLADA schema, anyURI is used for referencing, which implies >> using hash (#) character in front of IDs. >> >> <geometry id="foo">...</geometry> >> >> and then >> >> <instance_geometry url="#foo">...</instance> >> >> I need to both resolve this reference, and have access to the child >> elements of instance_geometry. I haven't found a suitable place in simple to >> extend/override. What would be the most convenient solution to this problem >> in simple XML? >> >> -- >> *+* >> *Best regards*, Dušan Maliarik // cell: +31646233420 >> *+* >> >> >> -----Inline Attachment Follows----- >> >> >> ------------------------------------------------------------------------------ >> Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)! >> Finally, a world-class log management solution at an even better >> price-free! >> Download using promo code Free_Logger_4_Dev2Dev. Offer expires >> February 28th, so secure your free ArcSight Logger TODAY! >> http://p.sf.net/sfu/arcsight-sfd2d >> >> -----Inline Attachment Follows----- >> >> _______________________________________________ >> Simple-support mailing list >> Sim...@li...<http://mc/compose?to=...@li...> >> https://lists.sourceforge.net/lists/listinfo/simple-support >> >> >> > > > > > -- > *+* > *Best regards*, Dušan Maliarik // cell: +31646233420 > *+* > > -- *+* *Best regards*, Dušan Maliarik // cell: +31646233420 *+* |
|
From: Niall G. <gal...@ya...> - 2011-01-28 07:54:46
|
Hi, Its possible, but only if you write a custom Converter yourself. The standard @ElementMap annotation does not support this currently. Niall --- On Thu, 27/1/11, Aaron Digulla <di...@he...> wrote: > From: Aaron Digulla <di...@he...> > Subject: [Simple-support] Maven-stype maps > To: sim...@li... > Received: Thursday, 27 January, 2011, 7:42 PM > Hello, > > In Maven, you can create maps like so: > > <map> > <foo>value of > foo</foo> > <bar>value of > bar</bar> > </map> > > i.e. the element name is the key. Is such a mapping > possible with > Simple? Do you have an example? > > Regards, > > -- > Aaron "Optimizer" Digulla a.k.a. Philmann Dark > "It's not the universe that's limited, it's our > imagination. > Follow me and I'll show you something beyond the limits." > http://www.pdark.de/ > http://blog.pdark.de/ > > ------------------------------------------------------------------------------ > Special Offer-- Download ArcSight Logger for FREE (a $49 > USD value)! > Finally, a world-class log management solution at an even > better price-free! > Download using promo code Free_Logger_4_Dev2Dev. Offer > expires > February 28th, so secure your free ArcSight Logger TODAY! > http://p.sf.net/sfu/arcsight-sfd2d > _______________________________________________ > Simple-support mailing list > Sim...@li... > https://lists.sourceforge.net/lists/listinfo/simple-support > |
|
From: Niall G. <gal...@ya...> - 2011-01-28 07:53:12
|
Hi, I think this is indexed on nabble.com. However, what you want is a Matcher implementation to return a Transform for java.util.Date.class. If you look in the test cases you will see many examples of the use of Matcher and Transform, just grab the code and use it (all in the .zip download). Niall --- On Thu, 27/1/11, Kenny MacLeod <Ken...@tr...> wrote: > From: Kenny MacLeod <Ken...@tr...> > Subject: [Simple-support] Handling of ISO 8601 timestamps > To: sim...@li... > Received: Thursday, 27 January, 2011, 9:50 AM > First up, sorry if this is a FAQ on > this list, but the SF mailing list > seems to have no search facility. > > Anyway, I'm looking to use SimpleXml (on Android) to > process XML that > makes extensive use of ISO 8601 timestamps (as used by the > xs:datetime XML > schema type), e.g. 2011-01-27T17:47:14Z > > I would like to bind these to java.util.Date fields in my > model. Now, the > SimpleXml tutorial briefly mentions this concept, and the > existence of > "transformers", but gives no indication if these > transformers are > pluggable or configurable. > > I could, of course, just use Strings, and translate them as > required, but > the schema in question is very complex, with many datetime > fields, so this > would be inelegant at best. > > Is there a suggested solution to this problem? > > P.S. Any chance of this group being migrated somewhere more > useful, such > as Google Groups? The lack of a search facility is > maddening, given how > much useful information is in this list archive. > > ------------------------------------------------------------------------------ > Special Offer-- Download ArcSight Logger for FREE (a $49 > USD value)! > Finally, a world-class log management solution at an even > better price-free! > Download using promo code Free_Logger_4_Dev2Dev. Offer > expires > February 28th, so secure your free ArcSight Logger TODAY! > http://p.sf.net/sfu/arcsight-sfd2d > _______________________________________________ > Simple-support mailing list > Sim...@li... > https://lists.sourceforge.net/lists/listinfo/simple-support > |
|
From: Aaron D. <di...@he...> - 2011-01-28 03:42:36
|
Hello,
In Maven, you can create maps like so:
<map>
<foo>value of foo</foo>
<bar>value of bar</bar>
</map>
i.e. the element name is the key. Is such a mapping possible with
Simple? Do you have an example?
Regards,
--
Aaron "Optimizer" Digulla a.k.a. Philmann Dark
"It's not the universe that's limited, it's our imagination.
Follow me and I'll show you something beyond the limits."
http://www.pdark.de/ http://blog.pdark.de/
|
|
From: Kenny M. <Ken...@tr...> - 2011-01-27 18:19:03
|
First up, sorry if this is a FAQ on this list, but the SF mailing list seems to have no search facility. Anyway, I'm looking to use SimpleXml (on Android) to process XML that makes extensive use of ISO 8601 timestamps (as used by the xs:datetime XML schema type), e.g. 2011-01-27T17:47:14Z I would like to bind these to java.util.Date fields in my model. Now, the SimpleXml tutorial briefly mentions this concept, and the existence of "transformers", but gives no indication if these transformers are pluggable or configurable. I could, of course, just use Strings, and translate them as required, but the schema in question is very complex, with many datetime fields, so this would be inelegant at best. Is there a suggested solution to this problem? P.S. Any chance of this group being migrated somewhere more useful, such as Google Groups? The lack of a search facility is maddening, given how much useful information is in this list archive. |
|
From: Dušan M. <dus...@gm...> - 2011-01-27 11:34:03
|
That of course was the first thing I tried, but the problem is deeper. I'd need custom ReadGraph (package private), and it's still not clear where to put anyURI's # prefix. I don't see where the actual lookup is done. And even then, I'd endup with instance_geometry referring to geometry, and I'd loose child elements of instance_geometry. Actually only instance_geometry's url attribute should refer to geometry object, and the rest of it's children would still be accessible. I've done this before with JAXB, and python and ruby XML binding libs. But I have no idea how to implement this with simple (seems to be the only android compatible one). Apparently it's not that straight forward. On Thu, Jan 27, 2011 at 12:23, Niall Gallagher <gal...@ya...>wrote: > Not sure exactly what the problem is here. But if the CycleStrategy does > not work then just write your own strategy, e.g DusansNewCycleStategy, the > implementation of the CycleStrategy can just be cut and pasted with > modifications. > > --- On *Thu, 27/1/11, Dušan Maliarik <dus...@gm...>* wrote: > > > From: Dušan Maliarik <dus...@gm...> > Subject: [Simple-support] Custom Referencing > To: sim...@li... > Received: Thursday, 27 January, 2011, 3:07 AM > > > Hi all, > > I chose simple for my android application for parsing COLLADA assets. They > use object definition / reference schema, so I attempted to use > CycleStrategy to ease the pain of traversing the object graph. I failed > because in COLLADA schema, anyURI is used for referencing, which implies > using hash (#) character in front of IDs. > > <geometry id="foo">...</geometry> > > and then > > <instance_geometry url="#foo">...</instance> > > I need to both resolve this reference, and have access to the child > elements of instance_geometry. I haven't found a suitable place in simple to > extend/override. What would be the most convenient solution to this problem > in simple XML? > > -- > *+* > *Best regards*, Dušan Maliarik // cell: +31646233420 > *+* > > > -----Inline Attachment Follows----- > > > ------------------------------------------------------------------------------ > Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)! > Finally, a world-class log management solution at an even better > price-free! > Download using promo code Free_Logger_4_Dev2Dev. Offer expires > February 28th, so secure your free ArcSight Logger TODAY! > http://p.sf.net/sfu/arcsight-sfd2d > > -----Inline Attachment Follows----- > > _______________________________________________ > Simple-support mailing list > Sim...@li...<http://mc/compose?to=...@li...> > https://lists.sourceforge.net/lists/listinfo/simple-support > > > -- *+* *Best regards*, Dušan Maliarik // cell: +31646233420 *+* |
|
From: Niall G. <gal...@ya...> - 2011-01-27 11:23:42
|
Not sure exactly what the problem is here. But if the CycleStrategy does not work then just write your own strategy, e.g DusansNewCycleStategy, the implementation of the CycleStrategy can just be cut and pasted with modifications. --- On Thu, 27/1/11, Dušan Maliarik <dus...@gm...> wrote: From: Dušan Maliarik <dus...@gm...> Subject: [Simple-support] Custom Referencing To: sim...@li... Received: Thursday, 27 January, 2011, 3:07 AM Hi all, I chose simple for my android application for parsing COLLADA assets. They use object definition / reference schema, so I attempted to use CycleStrategy to ease the pain of traversing the object graph. I failed because in COLLADA schema, anyURI is used for referencing, which implies using hash (#) character in front of IDs. <geometry id="foo">...</geometry> and then <instance_geometry url="#foo">...</instance> I need to both resolve this reference, and have access to the child elements of instance_geometry. I haven't found a suitable place in simple to extend/override. What would be the most convenient solution to this problem in simple XML? -- +Best regards, Dušan Maliarik // cell: +31646233420+ -----Inline Attachment Follows----- ------------------------------------------------------------------------------ Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)! Finally, a world-class log management solution at an even better price-free! Download using promo code Free_Logger_4_Dev2Dev. Offer expires February 28th, so secure your free ArcSight Logger TODAY! http://p.sf.net/sfu/arcsight-sfd2d -----Inline Attachment Follows----- _______________________________________________ Simple-support mailing list Sim...@li... https://lists.sourceforge.net/lists/listinfo/simple-support |
|
From: Dušan M. <dus...@gm...> - 2011-01-27 11:07:57
|
Hi all, I chose simple for my android application for parsing COLLADA assets. They use object definition / reference schema, so I attempted to use CycleStrategy to ease the pain of traversing the object graph. I failed because in COLLADA schema, anyURI is used for referencing, which implies using hash (#) character in front of IDs. <geometry id="foo">...</geometry> and then <instance_geometry url="#foo">...</instance> I need to both resolve this reference, and have access to the child elements of instance_geometry. I haven't found a suitable place in simple to extend/override. What would be the most convenient solution to this problem in simple XML? -- *+* *Best regards*, Dušan Maliarik // cell: +31646233420 *+* |
|
From: Niall G. <gal...@ya...> - 2011-01-27 08:20:40
|
The class org.alt.knowledgebase.DataBase has no annotations on it. So it needs an implementation of Transform or an @Root annotation. --- On Wed, 26/1/11, Rafael Angarita <ang...@gm...> wrote: From: Rafael Angarita <ang...@gm...> Subject: [Simple-support] Transform of class not supported To: sim...@li... Received: Wednesday, 26 January, 2011, 5:48 AM Hello everybody, I have been using Simple Framework for some time now and I think is greate and very easy to use. I'm working with simple inside a Eclipse plug-in project. However, I had to move the serializable classes to a different plug-in project due to some requirements. The serializable classes are the same, but I get this exception: org.simpleframework.xml.transform.TransformException: Transform of class org.alt.knowledgebase.DataBase not supported at org.simpleframework.xml.transform.Transformer.write(Transformer.java:122) at org.simpleframework.xml.core.Support.write(Support.java:200) at org.simpleframework.xml.core.PrimitiveFactory.getText(PrimitiveFactory.java:112) at org.simpleframework.xml.core.Primitive.write(Primitive.java:282) at org.simpleframework.xml.core.Composite.write(Composite.java:927) at org.simpleframework.xml.core.Traverser.write(Traverser.java:236) at org.simpleframework.xml.core.Traverser.write(Traverser.java:208) at org.simpleframework.xml.core.Traverser.write(Traverser.java:186) at org.simpleframework.xml.core.Persister.write(Persister.java:1187) at org.simpleframework.xml.core.Persister.write(Persister.java:1169) at org.simpleframework.xml.core.Persister.write(Persister.java:1147) at org.simpleframework.xml.core.Persister.write(Persister.java:1266) at org.simpleframework.xml.core.Persister.write(Persister.java:1248) at org.simpleframework.xml.core.Persister.write(Persister.java:1229) at org.alt.codegen.unifier.Unifier.generateDB(Unifier.java:120) at org.alt.plugin.popup.actions.ActionbuttonGenerateDB.run(ActionbuttonGenerateDB.java:34) at org.eclipse.ui.actions.ActionDelegate.runWithEvent(ActionDelegate.java:70) at org.eclipse.ui.internal.PluginAction.runWithEvent(PluginAction.java:241) at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:584) at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:501) at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:411) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1258) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3540) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3161) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2640) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2604) at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2438) at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:671) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:664) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149) at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:115) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:369) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:616) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:619) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:574) at org.eclipse.equinox.launcher.Main.run(Main.java:1407) at org.eclipse.equinox.launcher.Main.main(Main.java:1383) I know maybe this problem goes beyond the scope of this list, but I have no idea of what is wrong. Thank you very much for your help. -----Inline Attachment Follows----- ------------------------------------------------------------------------------ Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)! Finally, a world-class log management solution at an even better price-free! Download using promo code Free_Logger_4_Dev2Dev. Offer expires February 28th, so secure your free ArcSight Logger TODAY! http://p.sf.net/sfu/arcsight-sfd2d -----Inline Attachment Follows----- _______________________________________________ Simple-support mailing list Sim...@li... https://lists.sourceforge.net/lists/listinfo/simple-support |
|
From: Rafael A. <ang...@gm...> - 2011-01-26 13:48:50
|
Hello everybody, I have been using Simple Framework for some time now and I think is greate and very easy to use. I'm working with simple inside a Eclipse plug-in project. However, I had to move the serializable classes to a different plug-in project due to some requirements. The serializable classes are the same, but I get this exception: org.simpleframework.xml.transform.TransformException: Transform of class org.alt.knowledgebase.DataBase not supported at org.simpleframework.xml.transform.Transformer.write(Transformer.java:122) at org.simpleframework.xml.core.Support.write(Support.java:200) at org.simpleframework.xml.core.PrimitiveFactory.getText(PrimitiveFactory.java:112) at org.simpleframework.xml.core.Primitive.write(Primitive.java:282) at org.simpleframework.xml.core.Composite.write(Composite.java:927) at org.simpleframework.xml.core.Traverser.write(Traverser.java:236) at org.simpleframework.xml.core.Traverser.write(Traverser.java:208) at org.simpleframework.xml.core.Traverser.write(Traverser.java:186) at org.simpleframework.xml.core.Persister.write(Persister.java:1187) at org.simpleframework.xml.core.Persister.write(Persister.java:1169) at org.simpleframework.xml.core.Persister.write(Persister.java:1147) at org.simpleframework.xml.core.Persister.write(Persister.java:1266) at org.simpleframework.xml.core.Persister.write(Persister.java:1248) at org.simpleframework.xml.core.Persister.write(Persister.java:1229) at org.alt.codegen.unifier.Unifier.generateDB(Unifier.java:120) at org.alt.plugin.popup.actions.ActionbuttonGenerateDB.run(ActionbuttonGenerateDB.java:34) at org.eclipse.ui.actions.ActionDelegate.runWithEvent(ActionDelegate.java:70) at org.eclipse.ui.internal.PluginAction.runWithEvent(PluginAction.java:241) at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:584) at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:501) at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:411) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1258) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3540) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3161) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2640) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2604) at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2438) at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:671) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:664) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149) at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:115) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:369) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:616) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:619) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:574) at org.eclipse.equinox.launcher.Main.run(Main.java:1407) at org.eclipse.equinox.launcher.Main.main(Main.java:1383) I know maybe this problem goes beyond the scope of this list, but I have no idea of what is wrong. Thank you very much for your help. |
|
From: Niall G. <gal...@ya...> - 2011-01-25 10:39:10
|
See the @Order annotation. --- On Mon, 24/1/11, Atkins, Brian <Bri...@ne...> wrote: From: Atkins, Brian <Bri...@ne...> Subject: [Simple-support] Serialization element ordering To: sim...@li... Received: Monday, 24 January, 2011, 11:10 AM Is there a way to force ordering of elements on serialization? It appears that all field Element tags and processed first, followed by tags on getter/setter pairs.I have a mix because some attributes require processing on de/serialization (unit conversion, mostly). ThanksBrian -----Inline Attachment Follows----- ------------------------------------------------------------------------------ Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)! Finally, a world-class log management solution at an even better price-free! Download using promo code Free_Logger_4_Dev2Dev. Offer expires February 28th, so secure your free ArcSight Logger TODAY! http://p.sf.net/sfu/arcsight-sfd2d -----Inline Attachment Follows----- _______________________________________________ Simple-support mailing list Sim...@li... https://lists.sourceforge.net/lists/listinfo/simple-support |
|
From: Niall G. <gal...@ya...> - 2011-01-25 10:38:46
|
You need to annotate the constuctor arguments.
--- On Mon, 24/1/11, Thalisson Da Rosa <tal...@gm...> wrote:
From: Thalisson Da Rosa <tal...@gm...>
Subject: [Simple-support] PersistenceException: constructor not matched for class error when deserializing XML file
To: sim...@li...
Received: Monday, 24 January, 2011, 10:32 AM
Hi,
I'm using Simple to create an XML file called BackupInfo.xml from this class:
@Root
public class BackupInfo {
@Attribute
private String backupName;
@Element
private int numberOfFiles;
@ElementList
private ArrayList<FileInfo> files;
@Element
private Date date;
}
@Root
class FileInfo{
@Attribute
public String fileName;
@Element
private String path;
@Element
private long fileSize;
public FileInfo(String name, String aPath, long size) {
fileName = name;
path = aPath;
fileSize = size;
}
public String getName(){
return fileName;
}
public String getPath(){
return path;
}
}
When I serialize it I get a XML file that looks like this:
- <backupInfo backupName="1">
<files>
<fileInfo>
<fileName>sms.xml</fileName>
<path>/sdcard/sms.xml</path>
<fileSize>2807</fileSize>
</fileInfo>
<fileInfo>
<fileName>calllog.xml</fileName>
<path>/sdcard/calllog.xml</path>
<fileSize>1611</fileSize>
</fileInfo>
<fileInfo>
<fileName>contacts.xml</fileName>
<path>/sdcard/contacts.xml</path>
<fileSize>1679</fileSize>
</fileInfo>
</files>
<date>2011-01-21 16:55:15.63 GMT+00:00</date>
<numberOfFiles>3</numberOfFiles>
</backupInfo>
Then I try to deserialize using:
serializer = new Persister();
File info = new File ("/sdcard/BackupInfo.xml");
BackupInfo bi = serializer.read(BackupInfo.class, info);
At this point, I get the PersistenceException: Constructor not matched for class com.data.FileInfo
How do I solve this error? I searched everywhere (tutorial, google, this mail list) but couldn't find an answer.
Thx,
Thalisson
-----Inline Attachment Follows-----
------------------------------------------------------------------------------
Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)!
Finally, a world-class log management solution at an even better price-free!
Download using promo code Free_Logger_4_Dev2Dev. Offer expires
February 28th, so secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsight-sfd2d
-----Inline Attachment Follows-----
_______________________________________________
Simple-support mailing list
Sim...@li...
https://lists.sourceforge.net/lists/listinfo/simple-support
|
|
From: Atkins, B. <Bri...@ne...> - 2011-01-24 19:11:05
|
Is there a way to force ordering of elements on serialization? It appears that all field Element tags and processed first, followed by tags on getter/setter pairs. I have a mix because some attributes require processing on de/serialization (unit conversion, mostly). Thanks Brian |
|
From: Thalisson Da R. <tal...@gm...> - 2011-01-24 18:32:18
|
Hi,
I'm using Simple to create an XML file called BackupInfo.xml from this
class:
@Root
public class BackupInfo {
@Attribute
private String backupName;
@Element
private int numberOfFiles;
@ElementList
private ArrayList<FileInfo> files;
@Element
private Date date;
}
@Root
class FileInfo{
@Attribute
public String fileName;
@Element
private String path;
@Element
private long fileSize;
public FileInfo(String name, String aPath, long size) {
fileName = name;
path = aPath;
fileSize = size;
}
public String getName(){
return fileName;
}
public String getPath(){
return path;
}
}
When I serialize it I get a XML file that looks like this:
- <#> <backupInfo backupName="1">
<files>
<fileInfo>
<fileName>sms.xml</fileName>
<path>/sdcard/sms.xml</path>
<fileSize>2807</fileSize>
</fileInfo>
<fileInfo>
<fileName>calllog.xml</fileName>
<path>/sdcard/calllog.xml</path>
<fileSize>1611</fileSize>
</fileInfo>
<fileInfo>
<fileName>contacts.xml</fileName>
<path>/sdcard/contacts.xml</path>
<fileSize>1679</fileSize>
</fileInfo>
</files>
<date>2011-01-21 16:55:15.63 GMT+00:00</date>
<numberOfFiles>3</numberOfFiles>
</backupInfo>
Then I try to deserialize using:
serializer = new Persister();
File info = new File ("/sdcard/BackupInfo.xml");
BackupInfo bi = serializer.read(BackupInfo.class, info);
At this point, I get the PersistenceException: Constructor not matched for
class com.data.FileInfo
How do I solve this error? I searched everywhere (tutorial, google, this
mail list) but couldn't find an answer.
Thx,
Thalisson
|
|
From: Jason R. <jr...@ri...> - 2011-01-21 15:25:51
|
I have an xml file that has this structure:
<Rhs>
<Ads>
<Zone name="default">
<Page name="default">
<Position position="1">
<adUrl>http://ad.server.net/adj/trm.ra/default;pos=RR1;sz=120x207;tile=1</adUrl>
</Position>
<Position position="2">
<adUrl>http://ad.server.net/adj/trm.ra/default;pos=RR2;sz=120x207;tile=2</adUrl>
</Position>
</Page>
</Zone>
</Ads>
</Rhs>
I have classes for Ads, Zones, Page and Position that are working fine for getting me the adUrl data for a particular page name. Now, in my code when I want to render certain code that uses the adUrl, I have the following, which seems to go over every element in the xml file, whereas I was wondering if I could break out of the loop once it finds the page I'm on and get's those values. The issue is that once I generate the code for the current page, it still goes through my else condition and generates all of the code for every other page in my xml file, which I don't want. Here is the code that does the looping:
StringBuffer rhsStringBuffer = new StringBuffer();
//Get the page for which the RHS should be displayed
rhsPage = getRightHandSideValue();
Ads ads = RhsHelperMethods.getRhsDetailsByPageName();
for (Zone zone : ads.getZones()) {
for (Page page : zone.getPages()) {
if (page.name.equalsIgnoreCase(rhsPage)) {
for (Position position : page.getPositions()) {
rhsStringBuffer.append("<script type=\"text/javascript\">\r\n");
rhsStringBuffer.append("ord = window.ord || Math.floor(Math.random()*1E16);\r\n");
rhsStringBuffer.append("document.write('<script type=\"text/javascript\" ");
rhsStringBuffer.append("src=\"");
rhsStringBuffer.append(position.getAdUrl());
rhsStringBuffer.append(";ord=' + ord + '?\">\r\n");
rhsStringBuffer.append("<\\/script>');\r\n");
rhsStringBuffer.append("</script>\r\n");
rhsStringBuffer.append("<noscript>\r\n");
rhsStringBuffer.append("<a href=\"");
rhsStringBuffer.append(position.getAdUrl());
rhsStringBuffer.append(";ord=123456789?\" target=\"_blank\">\r\n");
rhsStringBuffer.append("<img src=\"");
rhsStringBuffer.append(position.getAdUrl());
rhsStringBuffer.append(";ord=123456789?\" alt=\"NEED ALT TEXT HERE\" />\r\n");
rhsStringBuffer.append("</a>\r\n");
rhsStringBuffer.append("</noscript>\r\n");
}
} else {
page.setName("default");
for (Position position : page.getPositions()) {
logger.debug("Missing page name, using default RHS");
rhsStringBuffer.append("<script type=\"text/javascript\">\r\n");
rhsStringBuffer.append("ord = window.ord || Math.floor(Math.random()*1E16);\r\n");
rhsStringBuffer.append("document.write('<script type=\"text/javascript\" ");
rhsStringBuffer.append("src=\"");
rhsStringBuffer.append(position.getAdUrl());
rhsStringBuffer.append(";ord=' + ord + '?\">\r\n");
rhsStringBuffer.append("<\\/script>');\r\n");
rhsStringBuffer.append("</script>\r\n");
rhsStringBuffer.append("<noscript>\r\n");
rhsStringBuffer.append("<a href=\"");
rhsStringBuffer.append(position.getAdUrl());
rhsStringBuffer.append(";ord=123456789?\" target=\"_blank\">\r\n");
rhsStringBuffer.append("<img src=\"");
rhsStringBuffer.append(position.getAdUrl());
rhsStringBuffer.append(";ord=123456789?\" alt=\"NEED ALT TEXT HERE\" />\r\n");
rhsStringBuffer.append("</a>\r\n");
rhsStringBuffer.append("</noscript>\r\n");
}
}
}
}
rhsItem = rhsStringBuffer.toString();
Thanks
________________________________
Disclaimer: This e-mail message is intended only for the personal use of
the recipient(s) named above. If you are not an intended recipient, you
may not review, copy or distribute this message. If you have received this
communication in error, please notify us immediately by e-mail and delete
the original message.
This e-mail expresses views only of the sender, which are not to be
attributed to Rite Aid Corporation and may not be copied or distributed
without this statement.
|