simple-support Mailing List for Simple (Page 30)
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: Crundy 12 <cru...@gm...> - 2011-07-22 09:03:58
|
On Thu, Jul 21, 2011 at 10:50 AM, Niall Gallagher <gal...@ya...> wrote: > > Hi, > > Your annotations look wrong, @Element does not work with classes, it works only with fields and methods. Instead use @Root for classes. Also, the @ElementList needs to have the name of "enemies" not "enemy". Take a look at the tutorial http://simple.sourceforge.net/download/stream/doc/tutorial/tutorial.php. > > Regards, > Niall Thanks, I did try changing Enemy to use root instead and changed the ElementList annotation to "enemies" but now I get: 07-22 09:04:49.882: WARN/System.err(395): org.simpleframework.xml.core.ElementException: Element 'enemy' does not have a match in class my.package.name.Enemies at line 3 New code: @Root public class Enemies { @ElementList(name="enemies") private List<Enemy> enemyList; public List<Enemy> getEnemies(){return this.enemyList;} } @Root(name="enemy") public class Enemy { @Attribute(name="type") private int type; public int getType(){return this.type;} --etc-- Tried naming the enemies class as well: @Root(name="enemies") Same error. > --- On Wed, 20/7/11, Crundy 12 <cru...@gm...> wrote: > > From: Crundy 12 <cru...@gm...> > Subject: [Simple-support] ValueRequiredException > To: sim...@li... > Received: Wednesday, 20 July, 2011, 6:28 AM > > Hi all, > I'm sure I'm doing something silly, but I can't for the life of me get Simple working. > > I'm trying to read in this XML from my Android assets folder: > > <?xml version="1.0" encoding="utf-8"?> > <enemies> > <enemy type="1" name="Enemy1"> > <spritesheet>sheet2.png</spritesheet> > <viewtilesfront>1</viewtilesfront> > <viewtilesside>0</viewtilesside> > <description> > Description of enemy 1 > </description> > </enemy> > <enemy type="2" name="Enemy2"> > <spritesheet>sheet2.png</spritesheet> > <viewtilesfront>1</viewtilesfront> > <viewtilesside>1</viewtilesside> > <description> > Description of enemy 2 > </description> > </enemy> > </enemies> > > So I have my two classes: > > Enemies.java > package my.package.name; > > import java.util.List; > import org.simpleframework.xml.Root; > import org.simpleframework.xml.ElementList; > > @Root > public class Enemies { > @ElementList(name="enemy") > private List<Enemy> enemies; > public List<Enemy> getEnemies(){return this.enemies;} > }: > > Enemy.java: > package my.package.name; > > import org.simpleframework.xml.Element; > import org.simpleframework.xml.Attribute; > > @Element(name="enemy") > public class Enemy { > @Attribute(name="type") > private int type; > public int getType(){return this.type;} > > @Attribute(name="name") > private String name; > public String getName(){return this.name;} > > @Element(name="spritesheet") > private String spriteSheet; > public String getSpriteSheet(){return this.spriteSheet;} > > @Element(name="viewtilesfront") > private int viewTilesFront; > public int getViewTilesFront(){return this.viewTilesFront;} > > @Element(name="viewtilesside") > private int viewTilesSide; > public int getViewTilesSide(){return this.viewTilesSide;} > > @Element(name="description") > private String description; > public String getDescription(){return this.description;} > } > > But I always end up with: > > 07-20 13:22:54.981: WARN/System.err(338): org.simpleframework.xml.core.ValueRequiredException: Unable to satisfy @org.simpleframework.xml.Attribute(empty=, name=name, required=true) on field 'name' private java.lang.String my.package.name.Enemy.name for class my.package.name.Enemy at line 4 > I've tried playing around with almost everything, using Root instead of element for the Enemy class, removing the name attributes from everything, no joy. I've tried using public class variables without get methods. > > If I just have one enemy entry under enemies and use a single Enemy object instead of the List then it works fine, I just can't seem to get ElementList working. > -----Inline Attachment Follows----- > > ------------------------------------------------------------------------------ > 10 Tips for Better Web Security > Learn 10 ways to better secure your business today. Topics covered include: > Web security, SSL, hacker attacks & Denial of Service (DoS), private keys, > security Microsoft Exchange, secure Instant Messaging, and much more. > http://www.accelacomm.com/jaw/sfnl/114/51426210/ > -----Inline Attachment Follows----- > > _______________________________________________ > Simple-support mailing list > Sim...@li... > https://lists.sourceforge.net/lists/listinfo/simple-support |
|
From: Stefanato F. (K. 2) <fed...@cr...> - 2011-07-21 10:11:31
|
Niall,
good to know that some enhancements on such topic are here to come!
Sorry if I go back on versioning issues...
I'm also facing a problem regarding enums versioning: switching to
future @Version target type would also solve the mismatching of enum
values over different version?
Thanks again.
Regards,
federico
-----Original Message-----
From: Niall Gallagher [mailto:gal...@ya...]
Sent: Thursday, July 21, 2011 11:45 AM
To: sim...@li...; Stefanato Federico (KGRQ 2)
Subject: Re: [Simple-support] Extended @Version
Hi,
Yes, this should be a very easy thing to do. I am planning a release
soon for 2.6.1, I will take a look at addressing the @Version annotation
in such a way.
Thanks for the feedback.
Niall
--- On Tue, 19/7/11, Stefanato Federico (KGRQ 2)
<fed...@cr...> wrote:
> From: Stefanato Federico (KGRQ 2)
<fed...@cr...>
> Subject: [Simple-support] Extended @Version
> To: sim...@li...
> Received: Tuesday, 19 July, 2011, 4:40 AM
> Hi Niall,
>
> the usage of @Version annotation is very powerful where -
> as in my case
> - the overall structure changes quite often.
>
> Unfortunately, the annotation works only at field level and
> I need a
> class - either concrete or abstract - to provide such field
> (in
> interfaces it doesn't work).
>
> It would be of great advantage if I could annotate a super
> interface in
> order to centralize the versioning management.
> Something as:
>
> @Version(name="xml-version", revision="1.7")
> public interface XmlSerializable{}
>
> Do you foresee any kind of extension in versioning
> capabilities?
> Otherwise, could you suggest me an equivalent strategy?
>
> Thanks in advance.
>
> Regards,
>
> federico
>
>
------------------------------------------------------------------------
------
> Magic Quadrant for Content-Aware Data Loss Prevention
> Research study explores the data loss prevention market.
> Includes in-depth
> analysis on the changes within the DLP market, and the
> criteria used to
> evaluate the strengths and weaknesses of these DLP
> solutions.
> http://www.accelacomm.com/jaw/sfnl/114/51385063/
> _______________________________________________
> Simple-support mailing list
> Sim...@li...
> https://lists.sourceforge.net/lists/listinfo/simple-support
>
|
|
From: Niall G. <gal...@ya...> - 2011-07-21 09:50:36
|
Hi, Your annotations look wrong, @Element does not work with classes, it works only with fields and methods. Instead use @Root for classes. Also, the @ElementList needs to have the name of "enemies" not "enemy". Take a look at the tutorial http://simple.sourceforge.net/download/stream/doc/tutorial/tutorial.php. Regards, Niall --- On Wed, 20/7/11, Crundy 12 <cru...@gm...> wrote: From: Crundy 12 <cru...@gm...> Subject: [Simple-support] ValueRequiredException To: sim...@li... Received: Wednesday, 20 July, 2011, 6:28 AM Hi all,I'm sure I'm doing something silly, but I can't for the life of me get Simple working. I'm trying to read in this XML from my Android assets folder: <?xml version="1.0" encoding="utf-8"?> <enemies> <enemy type="1" name="Enemy1"> <spritesheet>sheet2.png</spritesheet> <viewtilesfront>1</viewtilesfront> <viewtilesside>0</viewtilesside> <description> Description of enemy 1 </description> </enemy> <enemy type="2" name="Enemy2"> <spritesheet>sheet2.png</spritesheet> <viewtilesfront>1</viewtilesfront> <viewtilesside>1</viewtilesside> <description> Description of enemy 2 </description> </enemy> </enemies> So I have my two classes: Enemies.javapackage my.package.name; import java.util.List; import org.simpleframework.xml.Root; import org.simpleframework.xml.ElementList; @Root public class Enemies { @ElementList(name="enemy") private List<Enemy> enemies; public List<Enemy> getEnemies(){return this.enemies;} }: Enemy.java:package my.package.name; import org.simpleframework.xml.Element; import org.simpleframework.xml.Attribute; @Element(name="enemy") public class Enemy { @Attribute(name="type") private int type; public int getType(){return this.type;} @Attribute(name="name") private String name; public String getName(){return this.name;} @Element(name="spritesheet") private String spriteSheet; public String getSpriteSheet(){return this.spriteSheet;} @Element(name="viewtilesfront") private int viewTilesFront; public int getViewTilesFront(){return this.viewTilesFront;} @Element(name="viewtilesside") private int viewTilesSide; public int getViewTilesSide(){return this.viewTilesSide;} @Element(name="description") private String description; public String getDescription(){return this.description;}} But I always end up with: 07-20 13:22:54.981: WARN/System.err(338): org.simpleframework.xml.core.ValueRequiredException: Unable to satisfy @org.simpleframework.xml.Attribute(empty=, name=name, required=true) on field 'name' private java.lang.String my.package.name.Enemy.name for class my.package.name.Enemy at line 4 I've tried playing around with almost everything, using Root instead of element for the Enemy class, removing the name attributes from everything, no joy. I've tried using public class variables without get methods. If I just have one enemy entry under enemies and use a single Enemy object instead of the List then it works fine, I just can't seem to get ElementList working. -----Inline Attachment Follows----- ------------------------------------------------------------------------------ 10 Tips for Better Web Security Learn 10 ways to better secure your business today. Topics covered include: Web security, SSL, hacker attacks & Denial of Service (DoS), private keys, security Microsoft Exchange, secure Instant Messaging, and much more. http://www.accelacomm.com/jaw/sfnl/114/51426210/ -----Inline Attachment Follows----- _______________________________________________ Simple-support mailing list Sim...@li... https://lists.sourceforge.net/lists/listinfo/simple-support |
|
From: Niall G. <gal...@ya...> - 2011-07-21 09:44:48
|
Hi,
Yes, this should be a very easy thing to do. I am planning a release soon for 2.6.1, I will take a look at addressing the @Version annotation in such a way.
Thanks for the feedback.
Niall
--- On Tue, 19/7/11, Stefanato Federico (KGRQ 2) <fed...@cr...> wrote:
> From: Stefanato Federico (KGRQ 2) <fed...@cr...>
> Subject: [Simple-support] Extended @Version
> To: sim...@li...
> Received: Tuesday, 19 July, 2011, 4:40 AM
> Hi Niall,
>
> the usage of @Version annotation is very powerful where -
> as in my case
> - the overall structure changes quite often.
>
> Unfortunately, the annotation works only at field level and
> I need a
> class - either concrete or abstract - to provide such field
> (in
> interfaces it doesn't work).
>
> It would be of great advantage if I could annotate a super
> interface in
> order to centralize the versioning management.
> Something as:
>
> @Version(name="xml-version", revision="1.7")
> public interface XmlSerializable{}
>
> Do you foresee any kind of extension in versioning
> capabilities?
> Otherwise, could you suggest me an equivalent strategy?
>
> Thanks in advance.
>
> Regards,
>
> federico
>
> ------------------------------------------------------------------------------
> Magic Quadrant for Content-Aware Data Loss Prevention
> Research study explores the data loss prevention market.
> Includes in-depth
> analysis on the changes within the DLP market, and the
> criteria used to
> evaluate the strengths and weaknesses of these DLP
> solutions.
> http://www.accelacomm.com/jaw/sfnl/114/51385063/
> _______________________________________________
> Simple-support mailing list
> Sim...@li...
> https://lists.sourceforge.net/lists/listinfo/simple-support
>
|
|
From: Crundy 12 <cru...@gm...> - 2011-07-20 13:28:41
|
Hi all,
I'm sure I'm doing something silly, but I can't for the life of me get
Simple working.
I'm trying to read in this XML from my Android assets folder:
<?xml version="1.0" encoding="utf-8"?>
<enemies>
<enemy type="1" name="Enemy1">
<spritesheet>sheet2.png</spritesheet>
<viewtilesfront>1</viewtilesfront>
<viewtilesside>0</viewtilesside>
<description>
Description of enemy 1
</description>
</enemy>
<enemy type="2" name="Enemy2">
<spritesheet>sheet2.png</spritesheet>
<viewtilesfront>1</viewtilesfront>
<viewtilesside>1</viewtilesside>
<description>
Description of enemy 2
</description>
</enemy>
</enemies>
So I have my two classes:
Enemies.java
package my.package.name;
import java.util.List;
import org.simpleframework.xml.Root;
import org.simpleframework.xml.ElementList;
@Root
public class Enemies {
@ElementList(name="enemy")
private List<Enemy> enemies;
public List<Enemy> getEnemies(){return this.enemies;}
}:
Enemy.java:
package my.package.name;
import org.simpleframework.xml.Element;
import org.simpleframework.xml.Attribute;
@Element(name="enemy")
public class Enemy {
@Attribute(name="type")
private int type;
public int getType(){return this.type;}
@Attribute(name="name")
private String name;
public String getName(){return this.name;}
@Element(name="spritesheet")
private String spriteSheet;
public String getSpriteSheet(){return this.spriteSheet;}
@Element(name="viewtilesfront")
private int viewTilesFront;
public int getViewTilesFront(){return this.viewTilesFront;}
@Element(name="viewtilesside")
private int viewTilesSide;
public int getViewTilesSide(){return this.viewTilesSide;}
@Element(name="description")
private String description;
public String getDescription(){return this.description;}
}
But I always end up with:
07-20 13:22:54.981: WARN/System.err(338):
org.simpleframework.xml.core.ValueRequiredException: Unable to satisfy
@org.simpleframework.xml.Attribute(empty=, name=name, required=true) on
field 'name' private java.lang.String my.package.name.Enemy.name for class
my.package.name.Enemy at line 4
I've tried playing around with almost everything, using Root instead of
element for the Enemy class, removing the name attributes from everything,
no joy. I've tried using public class variables without get methods.
If I just have one enemy entry under enemies and use a single Enemy object
instead of the List then it works fine, I just can't seem to get ElementList
working.
|
|
From: Stefanato F. (K. 2) <fed...@cr...> - 2011-07-19 11:53:02
|
Hi Niall,
the usage of @Version annotation is very powerful where - as in my case
- the overall structure changes quite often.
Unfortunately, the annotation works only at field level and I need a
class - either concrete or abstract - to provide such field (in
interfaces it doesn't work).
It would be of great advantage if I could annotate a super interface in
order to centralize the versioning management.
Something as:
@Version(name="xml-version", revision="1.7")
public interface XmlSerializable{}
Do you foresee any kind of extension in versioning capabilities?
Otherwise, could you suggest me an equivalent strategy?
Thanks in advance.
Regards,
federico
|
|
From: Mogens H. <mo...@hv...> - 2011-07-18 18:03:02
|
Missing constructor was exactly the problem - thanks
Niall Gallagher-2 wrote:
>
> Does the type have a no argument constructor? If it does and it still does
> not work can you send me the problem as observed in a JUnit test. I will
> investigate and fix then.
>
> Thanks,
> Niall
>
> --- On Mon, 11/7/11, Mogens Hvidtfeldt <mo...@hv...> wrote:
>
>> From: Mogens Hvidtfeldt <mo...@hv...>
>> Subject: [Simple-support] CycleException: Invalid reference exception
>> that i dont understand
>> To: sim...@li...
>> Received: Monday, 11 July, 2011, 2:01 PM
>>
>> I am hitting the invalid reference exception when i read an
>> xml. The xml was
>> created by Simple framework using the CycleStrategy but is
>> fails when I try
>> to deserialize file.
>>
>> // This is how I read the file
>> Strategy cycleStrategry = new CycleStrategy("id", "ref");
>> Strategy annotationStrategy = new
>> AnnotationStrategy(cycleStrategry);
>> Serializer s = new Persister(annotationStrategy);
>> s.read(Project.class, file, false);
>>
>> // This is the xml I am trying to read
>> <project id="0">
>> <uuid
>> id="1">09611242-348c-4224-bdeb-008d4499c09e</uuid>
>> <createdDate id="2">2011-07-11
>> 22:34:41.326 GMT+02:00</createdDate>
>> <name
>> id="3">undefined</name>
>> <plates class="java.util.ArrayList"
>> id="4">
>> <plate id="5">
>> <project
>> ref="0"/>
>> <images
>> class="java.util.ArrayList" id="6">
>> <image
>> id="7">
>>
>> <createdDate id="8">2011-07-11
>> 22:34:46.502
>> GMT+02:00</createdDate>
>>
>> <id
>> id="9">d56bfad7-ed89-4c65-ba7f-35bfce7e115f</id>
>>
>> <plate ref="5"/>
>> </image>
>> </images>
>> <name
>> id="10">Plate A</name>
>> <id
>> id="11">-1</id>
>>
>> <referenceLayerIndex
>> id="12">0</referenceLayerIndex>
>> </plate>
>> </plates>
>> <results class="java.util.ArrayList"
>> id="13">
>> <result
>> class="com.ToolboxFactory.ColonyCount.Result.SampleConcentrationResult"
>> id="14">
>> <transfers
>> class="java.util.ArrayList" id="15"/>
>> </result>
>> <result
>> class="com.ToolboxFactory.ColonyCount.Result.TagRatioResult"
>> id="16">
>> <project
>> ref="0"/>
>> </result>
>> </results>
>> <autoSave
>> id="17">false</autoSave>
>> </project>
>>
>> // This is the exception i get
>> org.simpleframework.xml.strategy.CycleException: Invalid
>> reference '5' found
>>
>> But reference 5 should be valid and the type of the
>> <plate id="5"> class is
>> the same as the one defined in the property <plate
>> ref="5"/> (otherwise the
>> serialization would not have defined the reference).
>>
>> Any ideas would be appreciated
>>
>> --
>> View this message in context:
>> http://old.nabble.com/CycleException%3A-Invalid-reference-exception-that-i-dont-understand-tp32041293p32041293.html
>> Sent from the Simple XML Serialization mailing list archive
>> at Nabble.com.
>>
>>
>> ------------------------------------------------------------------------------
>> AppSumo Presents a FREE Video for the SourceForge Community
>> by Eric
>> Ries, the creator of the Lean Startup Methodology on "Lean
>> Startup
>> Secrets Revealed." This video shows you how to validate
>> your ideas,
>> optimize your ideas and identify your business strategy.
>> http://p.sf.net/sfu/appsumosfdev2dev
>> _______________________________________________
>> Simple-support mailing list
>> Sim...@li...
>> https://lists.sourceforge.net/lists/listinfo/simple-support
>>
>
> ------------------------------------------------------------------------------
> AppSumo Presents a FREE Video for the SourceForge Community by Eric
> Ries, the creator of the Lean Startup Methodology on "Lean Startup
> Secrets Revealed." This video shows you how to validate your ideas,
> optimize your ideas and identify your business strategy.
> http://p.sf.net/sfu/appsumosfdev2dev
> _______________________________________________
> Simple-support mailing list
> Sim...@li...
> https://lists.sourceforge.net/lists/listinfo/simple-support
>
>
--
View this message in context: http://old.nabble.com/CycleException%3A-Invalid-reference-exception-that-i-dont-understand-tp32041293p32085206.html
Sent from the Simple XML Serialization mailing list archive at Nabble.com.
|
|
From: joh sar..... <eh...@gm...> - 2011-07-18 09:51:46
|
Thanks Niall, you're right!
I have forgotten to annotate my setter in my class.
ridiculous error !
Solved !
2011/7/3, Niall Gallagher <gal...@ya...>:
> Hi,
>
> I think you are missing some code here. You are likely missing a no-arg
> constructor, or you are trying to deserialize a non-static inner class. Or
> you have either a final field annotated or a getter method annotated without
> a setter method annotated.
>
> Provide a complete listing of your source and I can answer here.
>
> Niall
>
> --- On Fri, 10/6/11, joh sar..... <eh...@gm...> wrote:
>
>
> From: joh sar..... <eh...@gm...>
> Subject: [Simple-support] Problem during deserializing
> To: sim...@li...
> Received: Friday, 10 June, 2011, 6:35 AM
>
>
> Hi all,
>
> Thanks for the library, it's very helpful and very efficient.
>
> I am writing to you because I have a deserializing problem.
> I try to deserializing a xml that i have serialized with your library and i
> don't find my bug.
>
> May be someone could help me or give me a clue;
>
> The log is : ERROR/erreur(15302):
> org.simpleframework.xml.core.PersistenceException: Constructor not matched
> for class construction_Xml_Data.IDE
> where IDE is one of my class that i have implemented. I don't know why it
> did not find my class !
>
> Thanks !
> Johan
>
> This is my code :
>
> /-----------------------
> @Root(strict = false)
> public class Utilisateurs {
> @ElementList(type = Medecin.class)
> private ArrayList<Medecin> medecins;
> @ElementList(type = IDE.class)
> private ArrayList<IDE> ides;
>
> ... constructors and getters
> ------------------------------/
>
> /---------------------------------
> @Root
> public class Medecin {
> @Element
> private String nom;
> @Element
> private String prenom;
> @Element
> private String specialite;
> @Element
> private int encours;
>
> .... constructors and getters
> -------------------------------------/
>
> /---------------------------------------
> @Root
> public class IDE {
> @Element
> private String nom;
> @Element
> private String prenom;
> @Element
> private String specialite;
> @Element
> private int encours;
>
> ... constructor and getters
> -------------------------------------------/
>
> And that is the read code:
> try {
> Serializer serializer = new Persister();
> File file = new File(path);
> Utilisateurs util = serializer.read(Utilisateurs.class,
> file,false); <--- the problem and i'm sure that my path is good
>
> } catch (Exception e) {
> // TODO Auto-generated catch block
> Log.e("erreur", "pas d'ecriture xml", e);
> }
>
> -----Inline Attachment Follows-----
>
>
> ------------------------------------------------------------------------------
> All of the data generated in your IT infrastructure is seriously valuable.
> Why? It contains a definitive record of application performance, security
> threats, fraudulent activity, and more. Splunk takes this data and makes
> sense of it. IT sense. And common sense.
> http://p.sf.net/sfu/splunk-d2d-c2
> -----Inline Attachment Follows-----
>
>
> _______________________________________________
> Simple-support mailing list
> Sim...@li...
> https://lists.sourceforge.net/lists/listinfo/simple-support
>
|
|
From: Jan L. <jle...@gm...> - 2011-07-17 15:25:01
|
Hi everybody We would like to use Simple to map XML structures from a BPM tool to Java beans. The BPM tool passes all attributes within XML elements, so I'd like to know if there is a way to change Simple's defaults for mapping class members to XML. The default is - of course - attribute rather than element, so we had to annotate every single Java class member with @Element. Is there a way to make this the default? Regards, Jan Lessner |
|
From: Niall G. <gal...@ya...> - 2011-07-17 02:59:45
|
Use the required=false attribute for the @Element annotation. this is described in the tutorial. --- On Sat, 16/7/11, Beyer, Doug <dou...@tr...> wrote: From: Beyer, Doug <dou...@tr...> Subject: [Simple-support] What should I do to handle null elements? To: "sim...@li..." <sim...@li...> Received: Saturday, 16 July, 2011, 7:42 AM I’m serializing a simple class and one of its data members is marked with the “@Element” attribute. In this particular case, the instance’s element value happens to be null. I get the following exception while trying to serialize the instance. org.simpleframework.xml.core.ElementException: Value for @org.simpleframework.xml.Element(name=, data=false, required=true, type=void) on field 'Payload' private java.lang.String com.troppus.data.POMRequest.Payload is null in class com.troppus.data.POMRequest. Is there a proper way to handle such cases? -----Inline Attachment Follows----- ------------------------------------------------------------------------------ AppSumo Presents a FREE Video for the SourceForge Community by Eric Ries, the creator of the Lean Startup Methodology on "Lean Startup Secrets Revealed." This video shows you how to validate your ideas, optimize your ideas and identify your business strategy. http://p.sf.net/sfu/appsumosfdev2dev -----Inline Attachment Follows----- _______________________________________________ Simple-support mailing list Sim...@li... https://lists.sourceforge.net/lists/listinfo/simple-support |
|
From: Patacchiola, A. <ada...@tr...> - 2011-07-16 15:29:13
|
I the @optional attribute or similar might be what you need. There's good documentation on the source forge site. Sent from my HTC smartphone on the Now Network from Sprint! ----- Reply message ----- From: "Beyer, Doug" <dou...@tr...> To: "sim...@li..." <sim...@li...> Subject: [Simple-support] What should I do to handle null elements? Date: Sat, Jul 16, 2011 8:44 am I’m serializing a simple class and one of its data members is marked with the “@Element” attribute. In this particular case, the instance’s element value happens to be null. I get the following exception while trying to serialize the instance. org.simpleframework.xml.core.ElementException: Value for @org.simpleframework.xml.Element(name=, data=false, required=true, type=void) on field 'Payload' private java.lang.String com.troppus.data.POMRequest.Payload is null in class com.troppus.data.POMRequest. Is there a proper way to handle such cases? |
|
From: Beyer, D. <dou...@tr...> - 2011-07-16 14:43:23
|
I'm serializing a simple class and one of its data members is marked with the "@Element" attribute. In this particular case, the instance's element value happens to be null. I get the following exception while trying to serialize the instance. org.simpleframework.xml.core.ElementException: Value for @org.simpleframework.xml.Element(name=, data=false, required=true, type=void) on field 'Payload' private java.lang.String com.troppus.data.POMRequest.Payload is null in class com.troppus.data.POMRequest. Is there a proper way to handle such cases? |
|
From: Niall G. <gal...@ya...> - 2011-07-16 01:08:10
|
Hi, Currently there is no tool to do this, you will have to do it by hand I am afraid. Niall --- On Wed, 13/7/11, kiran v <kir...@gm...> wrote: > From: kiran v <kir...@gm...> > Subject: [Simple-support] generating xsd to simple api java classes > To: sim...@li... > Received: Wednesday, 13 July, 2011, 2:20 AM > HI > > i am kiran working with android to perform serialization > and > de-serialization using simple api 2.6. > > In my requirement i have to generate java classes from xsd > and perform > serialization and de-serialization on it. previously i used > to do with > jaxb, but to work with simple api 2.6 is there any way to > convert xsd > to simple api java classes. > > regards > kiran v > > ------------------------------------------------------------------------------ > AppSumo Presents a FREE Video for the SourceForge Community > by Eric > Ries, the creator of the Lean Startup Methodology on "Lean > Startup > Secrets Revealed." This video shows you how to validate > your ideas, > optimize your ideas and identify your business strategy. > http://p.sf.net/sfu/appsumosfdev2dev > _______________________________________________ > Simple-support mailing list > Sim...@li... > https://lists.sourceforge.net/lists/listinfo/simple-support > |
|
From: Niall G. <gal...@ya...> - 2011-07-16 01:06:08
|
Does the type have a no argument constructor? If it does and it still does not work can you send me the problem as observed in a JUnit test. I will investigate and fix then.
Thanks,
Niall
--- On Mon, 11/7/11, Mogens Hvidtfeldt <mo...@hv...> wrote:
> From: Mogens Hvidtfeldt <mo...@hv...>
> Subject: [Simple-support] CycleException: Invalid reference exception that i dont understand
> To: sim...@li...
> Received: Monday, 11 July, 2011, 2:01 PM
>
> I am hitting the invalid reference exception when i read an
> xml. The xml was
> created by Simple framework using the CycleStrategy but is
> fails when I try
> to deserialize file.
>
> // This is how I read the file
> Strategy cycleStrategry = new CycleStrategy("id", "ref");
> Strategy annotationStrategy = new
> AnnotationStrategy(cycleStrategry);
> Serializer s = new Persister(annotationStrategy);
> s.read(Project.class, file, false);
>
> // This is the xml I am trying to read
> <project id="0">
> <uuid
> id="1">09611242-348c-4224-bdeb-008d4499c09e</uuid>
> <createdDate id="2">2011-07-11
> 22:34:41.326 GMT+02:00</createdDate>
> <name
> id="3">undefined</name>
> <plates class="java.util.ArrayList"
> id="4">
> <plate id="5">
> <project
> ref="0"/>
> <images
> class="java.util.ArrayList" id="6">
> <image
> id="7">
>
> <createdDate id="8">2011-07-11
> 22:34:46.502
> GMT+02:00</createdDate>
>
> <id
> id="9">d56bfad7-ed89-4c65-ba7f-35bfce7e115f</id>
>
> <plate ref="5"/>
> </image>
> </images>
> <name
> id="10">Plate A</name>
> <id
> id="11">-1</id>
>
> <referenceLayerIndex
> id="12">0</referenceLayerIndex>
> </plate>
> </plates>
> <results class="java.util.ArrayList"
> id="13">
> <result
> class="com.ToolboxFactory.ColonyCount.Result.SampleConcentrationResult"
> id="14">
> <transfers
> class="java.util.ArrayList" id="15"/>
> </result>
> <result
> class="com.ToolboxFactory.ColonyCount.Result.TagRatioResult"
> id="16">
> <project
> ref="0"/>
> </result>
> </results>
> <autoSave
> id="17">false</autoSave>
> </project>
>
> // This is the exception i get
> org.simpleframework.xml.strategy.CycleException: Invalid
> reference '5' found
>
> But reference 5 should be valid and the type of the
> <plate id="5"> class is
> the same as the one defined in the property <plate
> ref="5"/> (otherwise the
> serialization would not have defined the reference).
>
> Any ideas would be appreciated
>
> --
> View this message in context: http://old.nabble.com/CycleException%3A-Invalid-reference-exception-that-i-dont-understand-tp32041293p32041293.html
> Sent from the Simple XML Serialization mailing list archive
> at Nabble.com.
>
>
> ------------------------------------------------------------------------------
> AppSumo Presents a FREE Video for the SourceForge Community
> by Eric
> Ries, the creator of the Lean Startup Methodology on "Lean
> Startup
> Secrets Revealed." This video shows you how to validate
> your ideas,
> optimize your ideas and identify your business strategy.
> http://p.sf.net/sfu/appsumosfdev2dev
> _______________________________________________
> Simple-support mailing list
> Sim...@li...
> https://lists.sourceforge.net/lists/listinfo/simple-support
>
|
|
From: Niall G. <gal...@ya...> - 2011-07-15 09:07:17
|
You don't add anything to the classpath, it works out of the box with both DOM and KXML. Both are on Android by default. --- On Tue, 12/7/11, Francois D. Barnard <fba...@gm...> wrote: > From: Francois D. Barnard <fba...@gm...> > Subject: [Simple-support] Android Stax > To: sim...@li... > Received: Tuesday, 12 July, 2011, 7:48 AM > Hi > > Is there anything specific other than adding > "stax-1.2.0.jar" to > classpath for android. > > thanks > > -- > Francois D. Barnard > 083 380 6645 > > ------------------------------------------------------------------------------ > All of the data generated in your IT infrastructure is > seriously valuable. > Why? It contains a definitive record of application > performance, security > threats, fraudulent activity, and more. Splunk takes this > data and makes > sense of it. IT sense. And common sense. > http://p.sf.net/sfu/splunk-d2d-c2 > _______________________________________________ > Simple-support mailing list > Sim...@li... > https://lists.sourceforge.net/lists/listinfo/simple-support > |
|
From: kiran v <kir...@gm...> - 2011-07-13 09:20:48
|
HI i am kiran working with android to perform serialization and de-serialization using simple api 2.6. In my requirement i have to generate java classes from xsd and perform serialization and de-serialization on it. previously i used to do with jaxb, but to work with simple api 2.6 is there any way to convert xsd to simple api java classes. regards kiran v |
|
From: Francois D. B. <fba...@gm...> - 2011-07-12 14:48:56
|
Hi Is there anything specific other than adding "stax-1.2.0.jar" to classpath for android. thanks -- Francois D. Barnard 083 380 6645 |
|
From: Mogens H. <mo...@hv...> - 2011-07-11 21:01:16
|
I am hitting the invalid reference exception when i read an xml. The xml was
created by Simple framework using the CycleStrategy but is fails when I try
to deserialize file.
// This is how I read the file
Strategy cycleStrategry = new CycleStrategy("id", "ref");
Strategy annotationStrategy = new AnnotationStrategy(cycleStrategry);
Serializer s = new Persister(annotationStrategy);
s.read(Project.class, file, false);
// This is the xml I am trying to read
<project id="0">
<uuid id="1">09611242-348c-4224-bdeb-008d4499c09e</uuid>
<createdDate id="2">2011-07-11 22:34:41.326 GMT+02:00</createdDate>
<name id="3">undefined</name>
<plates class="java.util.ArrayList" id="4">
<plate id="5">
<project ref="0"/>
<images class="java.util.ArrayList" id="6">
<image id="7">
<createdDate id="8">2011-07-11 22:34:46.502
GMT+02:00</createdDate>
<id id="9">d56bfad7-ed89-4c65-ba7f-35bfce7e115f</id>
<plate ref="5"/>
</image>
</images>
<name id="10">Plate A</name>
<id id="11">-1</id>
<referenceLayerIndex id="12">0</referenceLayerIndex>
</plate>
</plates>
<results class="java.util.ArrayList" id="13">
<result
class="com.ToolboxFactory.ColonyCount.Result.SampleConcentrationResult"
id="14">
<transfers class="java.util.ArrayList" id="15"/>
</result>
<result class="com.ToolboxFactory.ColonyCount.Result.TagRatioResult"
id="16">
<project ref="0"/>
</result>
</results>
<autoSave id="17">false</autoSave>
</project>
// This is the exception i get
org.simpleframework.xml.strategy.CycleException: Invalid reference '5' found
But reference 5 should be valid and the type of the <plate id="5"> class is
the same as the one defined in the property <plate ref="5"/> (otherwise the
serialization would not have defined the reference).
Any ideas would be appreciated
--
View this message in context: http://old.nabble.com/CycleException%3A-Invalid-reference-exception-that-i-dont-understand-tp32041293p32041293.html
Sent from the Simple XML Serialization mailing list archive at Nabble.com.
|
|
From: Niall G. <gal...@ya...> - 2011-07-10 11:36:13
|
Hi, I have released Simple 2.6 which contains some slight bug fixes and some refactoring of the union annotations. For the next couple of releases I would like to address any bug fixes. If anyone has encountered any bugs using Simple, particularly on the Android platform. I would be interested to know about them. Please send any details to this mailing list. Thanks, Niall |
|
From: Niall G. <gal...@ya...> - 2011-07-09 08:37:18
|
Hi,
It is possible, but it does not sound like a good idea. Here is how to do it. You need to implement Strategy interface, this is passed in a "session" Map object, which you can use to collect object instances. Take a look in the test cases for examples of how to use it, its actually very simple, every element read gets a "read" callback to the strategy, every object to write gets a "write" callback to the strategy. At all times, you can set things in to the Map object passed to both the "read" and "write" methods.
Niall
--- On Thu, 7/7/11, Przemysław Kruglej <pk....@gm...> wrote:
From: Przemysław Kruglej <pk....@gm...>
Subject: [Simple-support] Loaded element used in Converter for next element
To: sim...@li...
Received: Thursday, 7 July, 2011, 2:53 PM
Hello,
I have the following problem: assume we have a class:
class Profile {
@Element
ComplexType first;
@Element
DIfferentComplexType second;
}
Now, we have a Converter for DifferentComplexType. However, for deserialization process, this converter needs an object of class ComplexType, and it should be the one loaded for Profile object instance:
public class DIfferentComplexTypeConverter implements Converter<DIfferentComplexType> {
private ComplexType complexType;
public DIfferentComplexTypeConverter(ComplexType complexType) {
this.complexType= complexType;
}
public DIfferentComplexType read(InputNode inputNode) throws Exception {
// some operations which need a ComplexType object to be done
}
public void write(OutputNode outputNode, Texture texture) throws Exception {
// some operations
}
}
Does any of you has any idea how something like this could be achieved? I. e. how to pass just deserialized "first" field of type ComplexType to converter that will be used to deserialize the next field (named "second")? The problem is, that the Registry object is created before deserializing, and so adding DIfferentComplexTypeConverter to it is impossible, because we don't have the ComplexType object yet. I'm starting wondering if this is even possible, and if this is a good idea.
I know I could load these fields separately - have separate serializers, and create each when I have the needed objects for converters. However, I would have to store object's definitions in different XML files and serializing process would not be as nice as with the above approach. Anyways, any ideas?
Take care,
Iskar
-----Inline Attachment Follows-----
------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security
threats, fraudulent activity, and more. Splunk takes this data and makes
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
-----Inline Attachment Follows-----
_______________________________________________
Simple-support mailing list
Sim...@li...
https://lists.sourceforge.net/lists/listinfo/simple-support
|
|
From: Niall G. <gal...@ya...> - 2011-07-08 11:43:40
|
Hi, Yes, @Convert is used for elements, Transform is used for attributes. Niall --- On Tue, 5/7/11, Owen Mathews <ow...@bi...> wrote: From: Owen Mathews <ow...@bi...> Subject: [Simple-support] @Convert for attributes? To: sim...@li... Received: Tuesday, 5 July, 2011, 1:55 PM Can you only use Converter<T> implementations for @Element annotations and not for @Attributes? I'm trying to do some customization in the serialization process but that's giving me errors. Owen -----Inline Attachment Follows----- ------------------------------------------------------------------------------ All of the data generated in your IT infrastructure is seriously valuable. Why? It contains a definitive record of application performance, security threats, fraudulent activity, and more. Splunk takes this data and makes sense of it. IT sense. And common sense. http://p.sf.net/sfu/splunk-d2d-c2 -----Inline Attachment Follows----- _______________________________________________ Simple-support mailing list Sim...@li... https://lists.sourceforge.net/lists/listinfo/simple-support |
|
From: Przemysław K. <pk....@gm...> - 2011-07-07 21:53:44
|
Hello,
I have the following problem: assume we have a class:
class Profile {
@Element
ComplexType first;
@Element
DIfferentComplexType second;
}
Now, we have a Converter for DifferentComplexType. However, for
deserialization process, this converter needs an object of class
ComplexType, and it should be the one loaded for Profile object instance:
public class DIfferentComplexTypeConverter implements
Converter<DIfferentComplexType> {
private ComplexType complexType;
public DIfferentComplexTypeConverter(ComplexType complexType) {
this.complexType= complexType;
}
public DIfferentComplexType read(InputNode inputNode) throws Exception {
// some operations which need a ComplexType object to be done
}
public void write(OutputNode outputNode, Texture texture) throws
Exception {
// some operations
}
}
Does any of you has any idea how something like this could be achieved? I.
e. how to pass just deserialized "first" field of type ComplexType to
converter that will be used to deserialize the next field (named "second")?
The problem is, that the Registry object is created before deserializing,
and so adding DIfferentComplexTypeConverter to it is impossible, because we
don't have the ComplexType object yet. I'm starting wondering if this is
even possible, and if this is a good idea.
I know I could load these fields separately - have separate serializers, and
create each when I have the needed objects for converters. However, I would
have to store object's definitions in different XML files and serializing
process would not be as nice as with the above approach. Anyways, any ideas?
Take care,
Iskar
|
|
From: Owen M. <ow...@bi...> - 2011-07-05 20:55:56
|
Can you only use Converter<T> implementations for @Element annotations and not for @Attributes? I'm trying to do some customization in the serialization process but that's giving me errors. Owen |
|
From: Niall G. <gal...@ya...> - 2011-07-03 05:46:23
|
Yes, there are several ways. You could write a Visitor implenmentation to strip the class attribute. Or you could instantiate a TreeStrategy and provide a string like "type" which will use "type=" attributes instead of "class=" attributes. The test cases have many examples of this situation being handled. --- On Wed, 8/6/11, Mattis Stordalen <sto...@gm...> wrote: From: Mattis Stordalen <sto...@gm...> Subject: [Simple-support] Problem consuming external XML that contains attribute with name "class" To: sim...@li... Received: Wednesday, 8 June, 2011, 3:13 PM Hi, I get a ClassNotFoundException since Simple tries to create a class with the same class name as the value of the "class" attribute. Is there a way to tell Simple to ignore the class attribute? I am using Simple 2.5.3. Kind regards, Mattis -----Inline Attachment Follows----- ------------------------------------------------------------------------------ All of the data generated in your IT infrastructure is seriously valuable. Why? It contains a definitive record of application performance, security threats, fraudulent activity, and more. Splunk takes this data and makes sense of it. IT sense. And common sense. http://p.sf.net/sfu/splunk-d2d-c2 -----Inline Attachment Follows----- _______________________________________________ Simple-support mailing list Sim...@li... https://lists.sourceforge.net/lists/listinfo/simple-support |
|
From: Niall G. <gal...@ya...> - 2011-07-03 05:44:24
|
Use this method Persister.read(MyClass.class, myXmlSource, false). This says ignore attributes and elements it does not understand. See documentation for more. --- On Tue, 14/6/11, Justin Morris <jm...@me...> wrote: From: Justin Morris <jm...@me...> Subject: [Simple-support] how to handle changing XML To: sim...@li... Received: Tuesday, 14 June, 2011, 7:28 AM I'm am using simple-xml to parse multiple feed sources. All have a very similar format but occasionally a feed provider will add a new node and that will break my parsing. Currently I just keep expanding my model to account for new nodes but this isn't sustainable. How can I tell simple xml to ignore nodes it doesn't recognize so that I stop getting "org.simpleframework.xml.core.ElementException: Element '?' does not have a match in class" errors? Any advice is appreciated. -----Inline Attachment Follows----- ------------------------------------------------------------------------------ All of the data generated in your IT infrastructure is seriously valuable. Why? It contains a definitive record of application performance, security threats, fraudulent activity, and more. Splunk takes this data and makes sense of it. IT sense. And common sense. http://p.sf.net/sfu/splunk-d2d-c2 -----Inline Attachment Follows----- _______________________________________________ Simple-support mailing list Sim...@li... https://lists.sourceforge.net/lists/listinfo/simple-support |