simple-support Mailing List for Simple (Page 17)
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: Simon B. <sim...@if...> - 2012-05-28 18:53:40
|
Hi Miguel,
Sorry, I was a little bit to fast. Didn't realize the Map:
So new try:
public class Courses {
@ElementList(entry=Course,type=com.simpleserializer.model.Course.class,
inline=true)
java.util.Collection<Course> getCourses(){
return courses.values();
}
@ElementList(entry=Course,type=com.simpleserializer.model.Course.class,
inline=true)
void setCourses(java.util.Collection<Course> courses){
for(Course course: courses){
this.put(course);
}
}
private HashMap<String, Course> courses = new
HashMap<String, Course>();
public void put(Course course)
{
this.courses.put(course.getId(), course);
}
}
> Hi Simon!
>
> Thank you for your quick answer.
>
> Unfortunately it did not work. When I try this:
>
> // Retrieving courses from ddbb
> Courses courses = CoursesDAO.get(token, connection);
>
> // Serialization to xml
> String xml = Serializer.toXml(courses);
>
> It raises the following exception:
>
> java.util.HashMap cannot be cast to java.util.Collection
>
> The rest of the code below:
>
> Serializer.java:
>
> package com.simpleserializer.util;
>
> import java.io.StringWriter;
>
> import org.simpleframework.xml.core.Persister;
>
> public class Serializer {
> public static String toXml(Object source) {
> StringWriter response = new StringWriter();
>
> try {
> new Persister().write(source, response);
> } catch (Exception e) {
> e1.printStackTrace();
> }
>
> return response.toString();
> }
> }
>
>
> On Mon, May 28, 2012 at 12:12 PM, Simon Brodt <sim...@if...>
> wrote:
>> Hi Miguel,
>>
>>
>>
>> Try the following:
>>
>>
>>
>> Course.java:
>>
>> package com.simpleserializer.model;
>>
>>
>>
>> import org.simpleframework.xml.Attribute;
>>
>>
>>
>> @Root(name=Course)
>>
>> public class Course {
>>
>> @Attribute private String id;
>>
>> @Attribute private String name;
>>
>>
>>
>> public Course(String id, String name) {
>>
>> this.setId(id);
>>
>> this.setName(name);
>>
>> }
>>
>>
>>
>> public String getId() {
>>
>> return this.id;
>>
>> }
>>
>>
>>
>> public void setId(String id) {
>>
>> this.id = id;
>>
>> }
>>
>>
>>
>> public String getName() {
>>
>> return this.name;
>>
>> }
>>
>>
>>
>> public void setName(String name) {
>>
>> this.name = name;
>>
>> }
>>
>> }
>>
>>
>>
>> Course2.java:
>>
>> package com.simpleserializer.model;
>>
>>
>>
>> import java.util.HashMap;
>>
>>
>>
>> @Root(name=Courses)
>>
>> public class Courses {
>>
>>
>>
>> @ElementList(entry=Course,type=
>> com.simpleserializer.model.Course.class, inline=true)
>>
>> private HashMap<String, Course> courses = new
>> HashMap<String, Course>();
>>
>>
>>
>> public void put(String courseId, Course course)
>>
>> {
>>
>> this.courses.put(courseId, course);
>>
>> }
>>
>> }
>>
>>
>>
>> Von: Miguel Ángel Martínez Fernández [mailto:mig...@gm...]
>> Gesendet: Montag, 28. Mai 2012 01:35
>> An: sim...@li...
>> Betreff: [Simple-support] Custom HashMap serialization/deserialization -
>> Help
>>
>>
>>
>> Hi,
>>
>>
>>
>> I am trying to serialize (and deserialize) two Java clases
>> (Courses.java
>> and Couse.Java) in order to get the following XML:
>>
>>
>>
>> <Courses>
>>
>> <Course id="course01" name="My first course"/>
>>
>> <Course id="course02" name="My second course"/>
>>
>> </Courses>
>>
>>
>>
>> Course.java:
>>
>> package com.simpleserializer.model;
>>
>>
>>
>> import org.simpleframework.xml.Attribute;
>>
>>
>>
>> public class Course {
>>
>> @Attribute private String id;
>>
>> @Attribute private String name;
>>
>>
>>
>> public Course(String id, String name) {
>>
>> this.setId(id);
>>
>> this.setName(name);
>>
>> }
>>
>>
>>
>> public String getId() {
>>
>> return this.id;
>>
>> }
>>
>>
>>
>> public void setId(String id) {
>>
>> this.id = id;
>>
>> }
>>
>>
>>
>> public String getName() {
>>
>> return this.name;
>>
>> }
>>
>>
>>
>> public void setName(String name) {
>>
>> this.name = name;
>>
>> }
>>
>> }
>>
>>
>>
>> Course2.java:
>>
>> package com.simpleserializer.model;
>>
>>
>>
>> import java.util.HashMap;
>>
>>
>>
>> public class Courses {
>>
>> private HashMap<String, Course> courses = new
>> HashMap<String,
>> Course>();
>>
>>
>>
>> public void put(String courseId, Course course)
>>
>> {
>>
>> this.courses.put(courseId, course);
>>
>> }
>>
>> }
>>
>>
>>
>> An example about how these clases are used is:
>>
>>
>>
>> Courses courses = new Courses();
>>
>>
>>
>> Course course1 = new Course("course01", "My first course");
>>
>> Course course2 = new Course("course02", "My second course");
>>
>>
>>
>> courses.put(course1.getId(), course1);
>>
>> courses.put(course2.getId(), course2);
>>
>>
>>
>>
>>
>> Could you please help me? I would really appreciate it!
>>
>>
>>
>> Thanks!
>
|
|
From: Simon B. <sim...@if...> - 2012-05-28 10:12:56
|
Hi Miguel,
Try the following:
Course.java:
package com.simpleserializer.model;
import org.simpleframework.xml.Attribute;
@Root(name=Course)
public class Course {
@Attribute private String id;
@Attribute private String name;
public Course(String id, String name) {
this.setId(id);
this.setName(name);
}
public String getId() {
return this.id;
}
public void setId(String id) {
this.id = id;
}
public String getName() {
return this.name;
}
public void setName(String name) {
this.name = name;
}
}
Course2.java:
package com.simpleserializer.model;
import java.util.HashMap;
@Root(name=Courses)
public class Courses {
@ElementList(entry=Course,type=
com.simpleserializer.model.Course.class, inline=true)
private HashMap<String, Course> courses = new
HashMap<String, Course>();
public void put(String courseId, Course course)
{
this.courses.put(courseId, course);
}
}
Von: Miguel Ángel Martínez Fernández [mailto:mig...@gm...]
Gesendet: Montag, 28. Mai 2012 01:35
An: sim...@li...
Betreff: [Simple-support] Custom HashMap serialization/deserialization -
Help
Hi,
I am trying to serialize (and deserialize) two Java clases (Courses.java
and Couse.Java) in order to get the following XML:
<Courses>
<Course id="course01" name="Carnet de conducir A"/>
<Course id="course02" name="Carnet de conducir A"/>
</Courses>
Course.java:
package com.simpleserializer.model;
import org.simpleframework.xml.Attribute;
public class Course {
@Attribute private String id;
@Attribute private String name;
public Course(String id, String name) {
this.setId(id);
this.setName(name);
}
public String getId() {
return this.id;
}
public void setId(String id) {
this.id = id;
}
public String getName() {
return this.name;
}
public void setName(String name) {
this.name = name;
}
}
Course2.java:
package com.simpleserializer.model;
import java.util.HashMap;
public class Courses {
private HashMap<String, Course> courses = new HashMap<String,
Course>();
public void put(String courseId, Course course)
{
this.courses.put(courseId, course);
}
}
And example about how these clases are used is:
Courses courses = new Courses();
Course course1 = new Course("course01", "My first course");
Course course2 = new Course("course02", "My second course");
courses.put(course1.getId(), course1);
courses.put(course2.getId(), course2);
Could you please help me? I would really appreciate it!
Thanks!
|
|
From: Miguel Á. M. F. <mig...@gm...> - 2012-05-27 23:34:52
|
Hi,
I am trying to serialize (and deserialize) two Java clases (Courses.java
and Couse.Java) in order to get the following XML:
<Courses>
<Course id="course01" name="Carnet de conducir A"/>
<Course id="course02" name="Carnet de conducir A"/>
</Courses>
Course.java:
package com.simpleserializer.model;
import org.simpleframework.xml.Attribute;
public class Course {
@Attribute private String id;
@Attribute private String name;
public Course(String id, String name) {
this.setId(id);
this.setName(name);
}
public String getId() {
return this.id;
}
public void setId(String id) {
this.id = id;
}
public String getName() {
return this.name;
}
public void setName(String name) {
this.name = name;
}
}
Course2.java:
package com.simpleserializer.model;
import java.util.HashMap;
public class Courses {
private HashMap<String, Course> courses = new HashMap<String, Course>();
public void put(String courseId, Course course)
{
this.courses.put(courseId, course);
}
}
And example about how these clases are used is:
Courses courses = new Courses();
Course course1 = new Course("course01", "My first course");
Course course2 = new Course("course02", "My second course");
courses.put(course1.getId(), course1);
courses.put(course2.getId(), course2);
Could you please help me? I would really appreciate it!
Thanks!
|
|
From: Niall G. <gal...@ya...> - 2012-05-26 02:18:12
|
Yes, use the @Path annotaiton like so
@Path("state")@Attribute(name= "code",required=false)private int code;
@Path("state")@Attribute(name="id", required=false)private int id;
--- On Fri, 25/5/12, Simon Brodt <sim...@if...> wrote:
From: Simon Brodt <sim...@if...>
Subject: Re: [Simple-support] Attribute always returning null or 0
To: sim...@li...
Received: Friday, 25 May, 2012, 1:40 PM
Hello Shobhit,
Maybe you should have a look at the tutorial in the beginning. It's quite good and obviously you did not spend much time on it. For example the @Root annotation is absolutely missplaced, it should be at the beginning of the class. And with respect to the "data " attribute look up the @Path annotation.
Use the tutorial to learn about the features of simple-xml step by step. You will find that your problem can easily be solved by adopting examples from the tutorial.
Best Regards,
Simon
Shobhit Sharda <sho...@gm...> hat geschrieben:
Hello,
I am new to Simple Framework and have written a simple program to
deserialize an xml file to java objects using Simple. I am able to do
it partially but the attribute always return null or 0. The code and
the test xml is shown below:
Below is the class
file-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
import java.io.File;
import org.simpleframework.xml.Attribute;
import org.simpleframework.xml.Element;
import org.simpleframework.xml.ElementList;
import org.simpleframework.xml.Root;
import org.simpleframework.xml.Serializer;
import org.simpleframework.xml.core.Persister;
public class Deserialize {
/**
* @param args
*/
//@Attribute(name="code" , required=false)
@Root
private String datadef;
@Element
private String str;
@Element
private String state;
@Attribute(name= "code",required=false)
private int code;
@Attribute(name="id", required=false)
private int id;
public static void main(String[] args) throws Exception {
// TODO Auto-generated method stub
Serializer serializer = new Persister();
File source = new File("importFiles/test.xml");
Deserialize deserialize = serializer.read(Deserialize.class, source);
System.out.println("Str : " + deserialize.str);
System.out.println("State : " + deserialize.state);
System.out.println("Code : " + deserialize.code);
System.out.println("Id : " + deserialize.id);
}
}
Below is the sample xml file I am trying to
deserialize-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
<datadef>
<str>123</str>
<state code="100" id="4">test</state>
</datadef>
I am not able to understand what is the mistake I am doing. Thus
seeking for immediate help.
thanks and regards
--
Shobhit Sharda
MSc in SSE
RWTH Aachen University
Aachen
Germany
blog: http://shobhitsharda.wordpress.com
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Simple-support mailing list
Sim...@li...
https://lists.sourceforge.net/lists/listinfo/simple-support
-----Inline Attachment Follows-----
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
-----Inline Attachment Follows-----
_______________________________________________
Simple-support mailing list
Sim...@li...
https://lists.sourceforge.net/lists/listinfo/simple-support
|
|
From: Simon B. <sim...@if...> - 2012-05-25 20:41:28
|
Hello Shobhit,
Maybe you should have a look at the tutorial in the beginning. It's quite good and obviously you did not spend much time on it. For example the @Root annotation is absolutely missplaced, it should be at the beginning of the class. And with respect to the "data " attribute look up the @Path annotation.
Use the tutorial to learn about the features of simple-xml step by step. You will find that your problem can easily be solved by adopting examples from the tutorial.
Best Regards,
Simon Shobhit Sharda <sho...@gm...> hat geschrieben:Hello,
I am new to Simple Framework and have written a simple program to
deserialize an xml file to java objects using Simple. I am able to do
it partially but the attribute always return null or 0. The code and
the test xml is shown below:
Below is the class
file-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
import java.io.File;
import org.simpleframework.xml.Attribute;
import org.simpleframework.xml.Element;
import org.simpleframework.xml.ElementList;
import org.simpleframework.xml.Root;
import org.simpleframework.xml.Serializer;
import org.simpleframework.xml.core.Persister;
public class Deserialize {
/**
* @param args
*/
//@Attribute(name="code" , required=false)
@Root
private String datadef;
@Element
private String str;
@Element
private String state;
@Attribute(name= "code",required=false)
private int code;
@Attribute(name="id", required=false)
private int id;
public static void main(String[] args) throws Exception {
// TODO Auto-generated method stub
Serializer serializer = new Persister();
File source = new File("importFiles/test.xml");
Deserialize deserialize = serializer.read(Deserialize.class, source);
System.out.println("Str : " + deserialize.str);
System.out.println("State : " + deserialize.state);
System.out.println("Code : " + deserialize.code);
System.out.println("Id : " + deserialize.id);
}
}
Below is the sample xml file I am trying to
deserialize-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
<datadef>
<str>123</str>
<state code="100" id="4">test</state>
</datadef>
I am not able to understand what is the mistake I am doing. Thus
seeking for immediate help.
thanks and regards
--
Shobhit Sharda
MSc in SSE
RWTH Aachen University
Aachen
Germany
blog: http://shobhitsharda.wordpress.com
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Simple-support mailing list
Sim...@li...
https://lists.sourceforge.net/lists/listinfo/simple-support
|
|
From: Shobhit S. <sho...@gm...> - 2012-05-25 20:05:37
|
Hello,
I am new to Simple Framework and have written a simple program to
deserialize an xml file to java objects using Simple. I am able to do
it partially but the attribute always return null or 0. The code and
the test xml is shown below:
Below is the class
file-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
import java.io.File;
import org.simpleframework.xml.Attribute;
import org.simpleframework.xml.Element;
import org.simpleframework.xml.ElementList;
import org.simpleframework.xml.Root;
import org.simpleframework.xml.Serializer;
import org.simpleframework.xml.core.Persister;
public class Deserialize {
/**
* @param args
*/
//@Attribute(name="code" , required=false)
@Root
private String datadef;
@Element
private String str;
@Element
private String state;
@Attribute(name= "code",required=false)
private int code;
@Attribute(name="id", required=false)
private int id;
public static void main(String[] args) throws Exception {
// TODO Auto-generated method stub
Serializer serializer = new Persister();
File source = new File("importFiles/test.xml");
Deserialize deserialize = serializer.read(Deserialize.class, source);
System.out.println("Str : " + deserialize.str);
System.out.println("State : " + deserialize.state);
System.out.println("Code : " + deserialize.code);
System.out.println("Id : " + deserialize.id);
}
}
Below is the sample xml file I am trying to
deserialize-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
<datadef>
<str>123</str>
<state code="100" id="4">test</state>
</datadef>
I am not able to understand what is the mistake I am doing. Thus
seeking for immediate help.
thanks and regards
--
Shobhit Sharda
MSc in SSE
RWTH Aachen University
Aachen
Germany
blog: http://shobhitsharda.wordpress.com
|
|
From: Niall G. <gal...@ya...> - 2012-05-22 11:53:26
|
Declare list as @ElementList(inline=true, entry="Rule") it will work then
--- On Tue, 22/5/12, Thomas Steingruber <tho...@gm...> wrote:
From: Thomas Steingruber <tho...@gm...>
Subject: [Simple-support] Error with ElementList
To: sim...@li...
Received: Tuesday, 22 May, 2012, 1:55 AM
Dear all,
I'm new to Simple and I'm trying to read an XML file but I have a problem with the ElementList.
First of all the XML structure:
<Policy>
<Target>
</Target>
<Rule Effect="Permit" RuleId="#loginPreferences">
</Rule>
<Rule Effect="Permit" RuleId="#emailPreferences">
<Rule>
<Policy>
This is the general structure and obviously Target and Rule contains more nodes, but I think are not important for this question.
To read the file I have created the class Policy in this way:
@Root
public class Policy {
@Element
private Target Target;
@ElementList
private List<Rule> Rule;
public Target getTarget(){
return Target;
}
public List<Rule> getRules(){
return Rule;
}
}
but when I start to read the XML file I will get this error:
org.simpleframework.xml.core.PersistenceException: Element 'Rule' declared twice at line 90
Why do I get this error? Can anyone help me solving it?
Thanks
Thomas
-----Inline Attachment Follows-----
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
-----Inline Attachment Follows-----
_______________________________________________
Simple-support mailing list
Sim...@li...
https://lists.sourceforge.net/lists/listinfo/simple-support
|
|
From: Thomas S. <tho...@gm...> - 2012-05-22 08:56:04
|
Dear all,
I'm new to Simple and I'm trying to read an XML file but I have a problem
with the ElementList.
First of all the XML structure:
<Policy>
<Target>
</Target>
<Rule Effect="Permit" RuleId="#loginPreferences">
</Rule>
<Rule Effect="Permit" RuleId="#emailPreferences">
<Rule>
<Policy>
This is the general structure and obviously Target and Rule contains more
nodes, but I think are not important for this question.
To read the file I have created the class Policy in this way:
@Root
public class Policy {
@Element
private Target Target;
@ElementList
private List<Rule> Rule;
public Target getTarget(){
return Target;
}
public List<Rule> getRules(){
return Rule;
}
}
but when I start to read the XML file I will get this error:
org.simpleframework.xml.core.PersistenceException: Element 'Rule' declared
twice at line 90
Why do I get this error? Can anyone help me solving it?
Thanks
Thomas
|
|
From: Niall G. <gal...@ya...> - 2012-05-21 12:09:21
|
This is possible, however its a little bit tricky as I need to do this for each supported XML reader, which includes StAX, KXML, and DOM. I was going to introduce a new annotation called @Literal to do this. I could just as easily write a toXMlString(). I will try at some point to get this in, you are welcome to attempt to try this yourself by modifying the org.simpleframework.xml.stream package!!
--- On Mon, 21/5/12, Lumsdon, Hugo <Hug...@bl...> wrote:
From: Lumsdon, Hugo <Hug...@bl...>
Subject: [Simple-support] node.getXMLString()
To: "sim...@li..." <sim...@li...>
Received: Monday, 21 May, 2012, 4:41 AM
Hi Niall,
In the mailing lists under a thread called “deserialize xml element as string”
you stated your intention to integrate node.getXMLString() into the product.
We’re really keen for this feature as well, but it doesn’t seem to be there in Simple 2.6.3. Please advise.
Thanks,
Hugo.
THIS MESSAGE AND ANY ATTACHMENTS ARE CONFIDENTIAL, PROPRIETARY, AND MAY BE PRIVILEGED. If this message was misdirected, BlackRock, Inc. and its subsidiaries, ("BlackRock") does not waive any confidentiality or privilege. If you are not the intended recipient, please notify us immediately and destroy the message without disclosing its contents to anyone. Any distribution, use or copying of this e-mail or the information it contains by other than an intended recipient is unauthorized. The views and opinions expressed in this e-mail message are the author's own and may not reflect the views and opinions of BlackRock, unless the author is authorized by BlackRock to express such views or opinions on its behalf. All email sent to or from this address is subject to electronic storage and review by BlackRock. Although BlackRock operates anti-virus programs, it does not accept responsibility for any damage whatsoever caused by viruses being passed.
BlackRock Advisors (UK) Limited is authorized and regulated by The Financial Services Authority. Registered in England. Registered No:796793. Registered Office: Drapers Gardens,
12 Throgmorton Avenue,
London EC2N 2DL.
-----Inline Attachment Follows-----
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
-----Inline Attachment Follows-----
_______________________________________________
Simple-support mailing list
Sim...@li...
https://lists.sourceforge.net/lists/listinfo/simple-support
|
|
From: Lumsdon, H. <Hug...@bl...> - 2012-05-21 12:01:42
|
Hi Niall,
In the mailing lists under a thread called "deserialize xml element as string" you stated your intention to integrate node.getXMLString() into the product.
We're really keen for this feature as well, but it doesn't seem to be there in Simple 2.6.3. Please advise.
Thanks,
Hugo.
THIS MESSAGE AND ANY ATTACHMENTS ARE CONFIDENTIAL, PROPRIETARY, AND MAY BE PRIVILEGED. If this message was misdirected, BlackRock, Inc. and its subsidiaries, ("BlackRock") does not waive any confidentiality or privilege. If you are not the intended recipient, please notify us immediately and destroy the message without disclosing its contents to anyone. Any distribution, use or copying of this e-mail or the information it contains by other than an intended recipient is unauthorized. The views and opinions expressed in this e-mail message are the author's own and may not reflect the views and opinions of BlackRock, unless the author is authorized by BlackRock to express such views or opinions on its behalf. All email sent to or from this address is subject to electronic storage and review by BlackRock. Although BlackRock operates anti-virus programs, it does not accept responsibility for any damage whatsoever caused by viruses being passed.
--
BlackRock Advisors (UK) Limited is authorized and regulated by The Financial Services Authority. Registered in England. Registered No:796793. Registered Office: Drapers Gardens, 12 Throgmorton Avenue, London EC2N 2DL.
|
|
From: Niall G. <gal...@ya...> - 2012-05-15 21:15:15
|
see the @Path annotation, that should do the job for u --- On Tue, 15/5/12, Simon (Zhe) Xu <si...@ho...> wrote: From: Simon (Zhe) Xu <si...@ho...> Subject: [Simple-support] how can I get only data for nested element in xml To: sim...@li... Received: Tuesday, 15 May, 2012, 1:04 PM Hi, I am hoping someone could help, and would really appreciate. I am trying to create elements from an xml and I am not interested in the root, but only some nested elements. I wonder if there is a way for simple xml to get those elements without me creating all the classes starting from root(Response class in this case). I am only interested in getting the Stations class from the xml below. Thank you. <Response xmlns="http://www.sss.com/ws/"> <GroupInfo> <Id>lirr</Id> <Name>Long Island Rail Road</Name><VehicleTypes>R</VehicleTypes> <Category>NYC to LI Regional Rail</Category><IconLarge> <Width>50</Width><Height>50</Height></IconLarge> <Icon><Width>25</Width> <Height>25</Height></Icon> <Stations><Station> <Id>albertson</Id> <Name>Albertson</Name> <X>-73.64169</X> <Y>40.77205</Y> <Radius>100</Radius> </Station><Station> <Id>yaphank</Id> <Name>Yaphank</Name> <X>-72.91588</X> <Y>40.8256</Y> <Radius>100</Radius> </Station></Stations> </GroupInfo><ResponseStatus> <ResultCode>200</ResultCode> <ResultString>Success.</ResultString> </ResponseStatus> </Response> Best wishes, Simon -----Inline Attachment Follows----- ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ -----Inline Attachment Follows----- _______________________________________________ Simple-support mailing list Sim...@li... https://lists.sourceforge.net/lists/listinfo/simple-support |
|
From: Simon (Z. X. <si...@ho...> - 2012-05-15 20:33:54
|
Hi, I am hoping someone could help, and would really appreciate. I am trying to create elements from an xml and I am not interested in the root, but only some nested elements. I wonder if there is a way for simple xml to get those elements without me creating all the classes starting from root(Response class in this case). I am only interested in getting the Stations class from the xml below. Thank you. <Response xmlns="http://www.sss.com/ws/"> <GroupInfo> <Id>lirr</Id> <Name>Long Island Rail Road</Name> <VehicleTypes>R</VehicleTypes> <Category>NYC to LI Regional Rail</Category> <IconLarge> <Width>50</Width> <Height>50</Height> </IconLarge> <Icon> <Width>25</Width> <Height>25</Height> </Icon> <Stations> <Station> <Id>albertson</Id> <Name>Albertson</Name> <X>-73.64169</X> <Y>40.77205</Y> <Radius>100</Radius> </Station> <Station> <Id>yaphank</Id> <Name>Yaphank</Name> <X>-72.91588</X> <Y>40.8256</Y> <Radius>100</Radius> </Station> </Stations> </GroupInfo> <ResponseStatus> <ResultCode>200</ResultCode> <ResultString>Success.</ResultString> </ResponseStatus> </Response> Best wishes, Simon |
|
From: Niall G. <gal...@ya...> - 2012-05-13 11:18:58
|
Hi, I have just released a new version of Simple, it contains many bug fixes and some performance enhancements. It also provides some improvements to constructor injection. Thanks,Niall |
|
From: Niall G. <gal...@ya...> - 2012-05-13 06:46:14
|
Hi,
Thanks again for these tests, I have just released version 2.6.3 which fixes all of these tests, except Test2 which is not actually a bug, this is the expected behaviour. To achieve this you should use the @Path annotation with @Path("elements") then you will get an enclosing XML element as desired.
Thanks,Niall
--- On Fri, 11/5/12, Simon Brodt <sim...@if...> wrote:
From: Simon Brodt <sim...@if...>
Subject: [Simple-support] BUGs collection
To: sim...@li...
Received: Friday, 11 May, 2012, 4:22 AM
Dear Niall,
As you might work on a new release soon, I wrote some further test classes
illustrating other bugs/problems that I frequently observe when using the
framework.
(By the way, I like the simple-xml framework very much)
The files include FIXME comments that point to the problem.
Best Regards and thanks for your work
Simon
-----Inline Attachment Follows-----
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
-----Inline Attachment Follows-----
_______________________________________________
Simple-support mailing list
Sim...@li...
https://lists.sourceforge.net/lists/listinfo/simple-support
|
|
From: Niall G. <gal...@ya...> - 2012-05-11 14:58:30
|
Awesome stuff Simon, its this kind of contribution that makes this project work!!! Thanks, ill make sure all these tests pass on the next release...Cheers. --- On Fri, 11/5/12, Simon Brodt <sim...@if...> wrote: From: Simon Brodt <sim...@if...> Subject: [Simple-support] BUGs collection To: sim...@li... Received: Friday, 11 May, 2012, 4:22 AM Dear Niall, As you might work on a new release soon, I wrote some further test classes illustrating other bugs/problems that I frequently observe when using the framework. (By the way, I like the simple-xml framework very much) The files include FIXME comments that point to the problem. Best Regards and thanks for your work Simon -----Inline Attachment Follows----- ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ -----Inline Attachment Follows----- _______________________________________________ Simple-support mailing list Sim...@li... https://lists.sourceforge.net/lists/listinfo/simple-support |
|
From: Niall G. <gal...@ya...> - 2012-05-11 14:53:15
|
Great, thanks. I appreciate the effort. Sent from Yahoo!7 Mail on Android |
|
From: Simon B. <sim...@if...> - 2012-05-11 11:22:56
|
Dear Niall, As you might work on a new release soon, I wrote some further test classes illustrating other bugs/problems that I frequently observe when using the framework. (By the way, I like the simple-xml framework very much) The files include FIXME comments that point to the problem. Best Regards and thanks for your work Simon |
|
From: Mihael S. <msc...@sg...> - 2012-05-11 10:03:03
|
Thanx. I already found the Transformer class. But I didn't found an
example on how to use a custom Transformer class.
My code looks something like this:
WebResource service = Client.create().resource(url);
String xml =
service.accept(MediaType.APPLICATION_XML).get(String.class);
Serializer serializer = new Persister();
try {
Employee employee = serializer.read(Employee.class, xml);
System.out.println(employee);
}
catch (Exception e) {
// exception handling
}
How/Where to integrate my Transformer?
Thanx
Mihael
Am 11.05.2012 11:14, schrieb Niall Gallagher:
> You need to create your own custom DateTransform to deal with your
> specific format, there are tonnes of examples of
> org.simpleframework.xml.transform.Transform implementations in the
> test cases.
>
> Niall
>
> --- On *Fri, 11/5/12, Mihael Schmidt /<msc...@sg...>/* wrote:
>
>
> From: Mihael Schmidt <msc...@sg...>
> Subject: [Simple-support] DateFormat: unparseable date
> To: sim...@li...
> Received: Friday, 11 May, 2012, 1:15 AM
>
> Hi,
>
> i am getting the message:
>
> java.text.ParseException: Unparseable date:
> "1963-04-24T00:00:00+01:00"
> at java.text.DateFormat.parse(DateFormat.java:354)
> at
> org.simpleframework.xml.transform.DateType$DateFormat.getDate(DateType.java:189)
> at
> org.simpleframework.xml.transform.DateType.getDate(DateType.java:112)
> at
> org.simpleframework.xml.transform.DateTransform.read(DateTransform.java:75)
> at
> org.simpleframework.xml.transform.DateTransform.read(DateTransform.java:44)
> at
> org.simpleframework.xml.transform.Transformer.read(Transformer.java:104)
> at org.simpleframework.xml.core.Support.read(Support.java:185)
> at
> org.simpleframework.xml.core.PrimitiveFactory.getInstance(PrimitiveFactory.java:105)
> at
> org.simpleframework.xml.core.Primitive.readTemplate(Primitive.java:231)
> at org.simpleframework.xml.core.Primitive.read(Primitive.java:171)
>
> How can I specify the date format? Or am I missing something?
>
> Thanx in advance
>
> Mihael
>
> --
> Mihael Schmidt
> Software und System-Entwicklung
> Schulz Gebäudeservice GmbH & Co. KG
> Dr.-Max-Ilgner-Straße 17
> 32339 Espelkamp
>
> Telefon: 05772-9100-00
> Telefax: 05772-9100-11
> Internet: www.sgbs.de
>
> Persönlich haftende Gesellschafterin:
> Gebäudereinigung Joachim Schulz
> Verwaltungsgesellschaft mbH
>
> Geschäftsführer: Joachim Schulz, Dirk Schulz, Norbert Kosica
>
> Handelsregister Bad Oeynhausen:
> HRA 5902, HRB 8591
>
>
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and
> threat landscape has changed and how IT managers can respond.
> Discussions
> will include endpoint security, mobile security and the latest in
> malware
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> _______________________________________________
> Simple-support mailing list
> Sim...@li...
> </mc/compose?to=...@li...>
> https://lists.sourceforge.net/lists/listinfo/simple-support
>
--
Mihael Schmidt
Software und System-Entwicklung
Schulz Gebäudeservice GmbH & Co. KG
Dr.-Max-Ilgner-Straße 17
32339 Espelkamp
Telefon: 05772-9100-00
Telefax: 05772-9100-11
Internet: www.sgbs.de
Persönlich haftende Gesellschafterin:
Gebäudereinigung Joachim Schulz
Verwaltungsgesellschaft mbH
Geschäftsführer: Joachim Schulz, Dirk Schulz, Norbert Kosica
Handelsregister Bad Oeynhausen:
HRA 5902, HRB 8591
|
|
From: Niall G. <gal...@ya...> - 2012-05-11 09:15:00
|
You need to create your own custom DateTransform to deal with your specific format, there are tonnes of examples of org.simpleframework.xml.transform.Transform implementations in the test cases. Niall --- On Fri, 11/5/12, Mihael Schmidt <msc...@sg...> wrote: From: Mihael Schmidt <msc...@sg...> Subject: [Simple-support] DateFormat: unparseable date To: sim...@li... Received: Friday, 11 May, 2012, 1:15 AM Hi, i am getting the message: java.text.ParseException: Unparseable date: "1963-04-24T00:00:00+01:00" at java.text.DateFormat.parse(DateFormat.java:354) at org.simpleframework.xml.transform.DateType$DateFormat.getDate(DateType.java:189) at org.simpleframework.xml.transform.DateType.getDate(DateType.java:112) at org.simpleframework.xml.transform.DateTransform.read(DateTransform.java:75) at org.simpleframework.xml.transform.DateTransform.read(DateTransform.java:44) at org.simpleframework.xml.transform.Transformer.read(Transformer.java:104) at org.simpleframework.xml.core.Support.read(Support.java:185) at org.simpleframework.xml.core.PrimitiveFactory.getInstance(PrimitiveFactory.java:105) at org.simpleframework.xml.core.Primitive.readTemplate(Primitive.java:231) at org.simpleframework.xml.core.Primitive.read(Primitive.java:171) How can I specify the date format? Or am I missing something? Thanx in advance Mihael -- Mihael Schmidt Software und System-Entwicklung Schulz Gebäudeservice GmbH & Co. KG Dr.-Max-Ilgner-Straße 17 32339 Espelkamp Telefon: 05772-9100-00 Telefax: 05772-9100-11 Internet: www.sgbs.de Persönlich haftende Gesellschafterin: Gebäudereinigung Joachim Schulz Verwaltungsgesellschaft mbH Geschäftsführer: Joachim Schulz, Dirk Schulz, Norbert Kosica Handelsregister Bad Oeynhausen: HRA 5902, HRB 8591 ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ Simple-support mailing list Sim...@li... https://lists.sourceforge.net/lists/listinfo/simple-support |
|
From: Mihael S. <msc...@sg...> - 2012-05-11 08:15:25
|
Hi,
i am getting the message:
java.text.ParseException: Unparseable date: "1963-04-24T00:00:00+01:00"
at java.text.DateFormat.parse(DateFormat.java:354)
at
org.simpleframework.xml.transform.DateType$DateFormat.getDate(DateType.java:189)
at org.simpleframework.xml.transform.DateType.getDate(DateType.java:112)
at
org.simpleframework.xml.transform.DateTransform.read(DateTransform.java:75)
at
org.simpleframework.xml.transform.DateTransform.read(DateTransform.java:44)
at
org.simpleframework.xml.transform.Transformer.read(Transformer.java:104)
at org.simpleframework.xml.core.Support.read(Support.java:185)
at
org.simpleframework.xml.core.PrimitiveFactory.getInstance(PrimitiveFactory.java:105)
at
org.simpleframework.xml.core.Primitive.readTemplate(Primitive.java:231)
at org.simpleframework.xml.core.Primitive.read(Primitive.java:171)
How can I specify the date format? Or am I missing something?
Thanx in advance
Mihael
--
Mihael Schmidt
Software und System-Entwicklung
Schulz Gebäudeservice GmbH & Co. KG
Dr.-Max-Ilgner-Straße 17
32339 Espelkamp
Telefon: 05772-9100-00
Telefax: 05772-9100-11
Internet: www.sgbs.de
Persönlich haftende Gesellschafterin:
Gebäudereinigung Joachim Schulz
Verwaltungsgesellschaft mbH
Geschäftsführer: Joachim Schulz, Dirk Schulz, Norbert Kosica
Handelsregister Bad Oeynhausen:
HRA 5902, HRB 8591
|
|
From: Niall G. <gal...@ya...> - 2012-05-09 08:50:11
|
Yep, look at the test cases for the methods annotated with @Commit and @Validate that accept the session Map, this would be the place to do what you mention. --- On Tue, 8/5/12, Jens Wurster <jw...@to...> wrote: From: Jens Wurster <jw...@to...> Subject: Re: [Simple-support] XML file path in deserialized objects To: sim...@li... Received: Tuesday, 8 May, 2012, 9:27 AM Yes, type "File" works automatically, but I don't want to set an absolute path to my files. I want all file paths relative to the specific xml file. Can I store the xml file path in a session object and pass it to the persister? So I can set the full path to my files in the validate or commit method?! Regards ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ Simple-support mailing list Sim...@li... https://lists.sourceforge.net/lists/listinfo/simple-support |
|
From: Jens W. <jw...@to...> - 2012-05-08 16:27:37
|
Yes, type "File" works automatically, but I don't want to set an absolute path to my files. I want all file paths relative to the specific xml file. Can I store the xml file path in a session object and pass it to the persister? So I can set the full path to my files in the validate or commit method?! Regards |
|
From: Niall G. <gal...@ya...> - 2012-05-08 09:44:23
|
The way cycle checking currently works, is that id defines the object, and ref references the definition. In your example, ref appears before id, so the reference has not been defined. If you swap the two it will work.
--- On Tue, 8/5/12, Andreas Limber <and...@gm...> wrote:
From: Andreas Limber <and...@gm...>
Subject: [Simple-support] Invalid reference
To: sim...@li...
Received: Tuesday, 8 May, 2012, 2:34 AM
Hi all,
(Sorry if this is a duplicate now, I tried sending it to the list before I registered.)
I have a problem that I cannot get my head around. I am trying to do references in my xml. Everything else has worked fine, but this is hard to grasp. Here is all the relevant info (edited/stripped for clarity):
Deserializing:CycleStrategy cycleStrategy = new CycleStrategy("id", "ref");Strategy annotationStrategy = new AnnotationStrategy(cycleStrategy);
Serializer serializer = new Persister(annotationStrategy);
Class 1:@Element
public class Unit {
@ElementList(name="special_rules",required=false)
private List<Rule> specialRules = new ArrayList<Rule>();
public Unit() { super();
}
Class 2:@Element
public class Rule {
@Attribute
private String name; @Element(required=false)
private String text;
public Rule() {
super(); }
XML:<?xml version="1.0" encoding="UTF-8"?>
<codex name="Space Marines 5th ed" version="1.0"> <units>
<unit name="Captain" q="1" foc="HQ" type="Infantry" base_cost="100">
<stats> <stat key="WS">6</stat>
<stat key="BS">5</stat> <stat key="S">4</stat>
<stat key="T">4</stat> <stat key="W">3</stat>
<stat key="I">5</stat> <stat key="A">3</stat>
<stat key="Ld">10</stat> <stat key="Sv">3+</stat>
</stats> <wargears>
<wargear name="Power armour" /> <wargear name="Chainsword" />
<wargear name="Bolt pistol" /> <wargear name="Frag and krak grenades" />
<wargear name="Iron Halo" /> </wargears>
<special_rules> <rule ref="atsknf" />
<rule ref="ct" /> <rule ref="ic" />
</special_rules> </unit>
</units> <rules> <rule name="Combat Squads" id="cs">
<text>Divide from 10 to 2x5.</text> </rule> <rule name="Combat Tactics" id="ct">
<text>Choose to fail any morale test.</text> </rule> <rule name="And They Shall Know No Fear" id="atsknf">
<text>Badass...</text> </rule> <rule name="Independent Character" id="ic">
<text>See 40k rules</text> </rule> </rules>
Error:org.simpleframework.xml.strategy.CycleException: Invalid reference 'atsknf' found
at org.simpleframework.xml.strategy.ReadGraph.readReference(ReadGraph.java:155) at org.simpleframework.xml.strategy.ReadGraph.readInstance(ReadGraph.java:123)
at org.simpleframework.xml.strategy.ReadGraph.read(ReadGraph.java:104) at org.simpleframework.xml.strategy.CycleStrategy.read(CycleStrategy.java:153)
at org.simpleframework.xml.convert.AnnotationStrategy.read(AnnotationStrategy.java:100) at org.simpleframework.xml.core.Source.getOverride(Source.java:370)
Thanks in advance for any help on this matter!
BR,
Andreas Limber
-----Inline Attachment Follows-----
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
-----Inline Attachment Follows-----
_______________________________________________
Simple-support mailing list
Sim...@li...
https://lists.sourceforge.net/lists/listinfo/simple-support
|
|
From: Niall G. <gal...@ya...> - 2012-05-08 09:41:38
|
Actually my mistake, this is actually a bug. I should be releasing a new release soon with quite a few enhancements, I will include a fix for this. Thanks. --- On Tue, 8/5/12, Niall Gallagher <gal...@ya...> wrote: From: Niall Gallagher <gal...@ya...> Subject: Re: [Simple-support] BUG: Equal attribute names at different pathes seem to be confused To: sim...@li..., "Simon Brodt" <sim...@if...> Received: Tuesday, 8 May, 2012, 2:30 AM To fix put in the @Path for the constructor also to fully qualify it. --- On Mon, 7/5/12, Simon Brodt <sim...@if...> wrote: From: Simon Brodt <sim...@if...> Subject: [Simple-support] BUG: Equal attribute names at different pathes seem to be confused To: sim...@li... Received: Monday, 7 May, 2012, 5:44 AM Dear all, It seems like there is a bug in the constructor checks. A exception "org.simpleframework.xml.core.ConstructorException: Parameter 'iri' does not have a match in class bugreports.simple_xml.Test1" Is thrown though there is definitely a match. For reproducing the bug, just execute the main method of the Test1.java class. Best Regards Simon -----Inline Attachment Follows----- ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ -----Inline Attachment Follows----- _______________________________________________ Simple-support mailing list Sim...@li... https://lists.sourceforge.net/lists/listinfo/simple-support -----Inline Attachment Follows----- ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ -----Inline Attachment Follows----- _______________________________________________ Simple-support mailing list Sim...@li... https://lists.sourceforge.net/lists/listinfo/simple-support |
|
From: Andreas L. <and...@gm...> - 2012-05-08 09:34:44
|
Hi all,
(Sorry if this is a duplicate now, I tried sending it to the list before I
registered.)
I have a problem that I cannot get my head around. I am trying to do
references in my xml. Everything else has worked fine, but this is hard to
grasp. Here is all the relevant info (edited/stripped for clarity):
*Deserializing:*
CycleStrategy cycleStrategy = new CycleStrategy("id", "ref");
Strategy annotationStrategy = new AnnotationStrategy(cycleStrategy);
Serializer serializer = new Persister(annotationStrategy);
*Class 1:*
@Element
public class Unit {
@ElementList(name="special_rules",required=false)
private List<Rule> specialRules = new ArrayList<Rule>();
public Unit() {
super();
}
*Class 2:*
@Element
public class Rule {
@Attribute
private String name;
@Element(required=false)
private String text;
public Rule() {
super();
}
*XML:*
<?xml version="1.0" encoding="UTF-8"?>
<codex name="Space Marines 5th ed" version="1.0">
<units>
<unit name="Captain" q="1" foc="HQ" type="Infantry" base_cost="100">
<stats>
<stat key="WS">6</stat>
<stat key="BS">5</stat>
<stat key="S">4</stat>
<stat key="T">4</stat>
<stat key="W">3</stat>
<stat key="I">5</stat>
<stat key="A">3</stat>
<stat key="Ld">10</stat>
<stat key="Sv">3+</stat>
</stats>
<wargears>
<wargear name="Power armour" />
<wargear name="Chainsword" />
<wargear name="Bolt pistol" />
<wargear name="Frag and krak grenades" />
<wargear name="Iron Halo" />
</wargears>
<special_rules>
<rule ref="atsknf" />
<rule ref="ct" />
<rule ref="ic" />
</special_rules>
</unit>
</units>
<rules>
<rule name="Combat Squads" id="cs">
<text>Divide from 10 to 2x5.</text>
</rule>
<rule name="Combat Tactics" id="ct">
<text>Choose to fail any morale test.</text>
</rule>
<rule name="And They Shall Know No Fear" id="atsknf">
<text>Badass...</text>
</rule>
<rule name="Independent Character" id="ic">
<text>See 40k rules</text>
</rule>
</rules>
*
*
*Error:*
org.simpleframework.xml.strategy.CycleException: Invalid reference 'atsknf'
found
at
org.simpleframework.xml.strategy.ReadGraph.readReference(ReadGraph.java:155)
at
org.simpleframework.xml.strategy.ReadGraph.readInstance(ReadGraph.java:123)
at org.simpleframework.xml.strategy.ReadGraph.read(ReadGraph.java:104)
at
org.simpleframework.xml.strategy.CycleStrategy.read(CycleStrategy.java:153)
at
org.simpleframework.xml.convert.AnnotationStrategy.read(AnnotationStrategy.java:100)
at org.simpleframework.xml.core.Source.getOverride(Source.java:370)
Thanks in advance for any help on this matter!
BR,
Andreas Limber
|