simple-support Mailing List for Simple (Page 21)
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: Gareth M. <gar...@gm...> - 2012-02-29 13:14:39
|
Hi guys,
Been trying all day to parse some XML, but im getting errors I cant
solve, my error is:
Error Occured Unable to satisfy
@org.simpleframework.xml.Element(data=false, name=, required=true,
type=void) on field 'horse_name' public
badminton.horsetrials.app.downloaded.results.xml.firstinspection.urlsetobjects.HorseName
badminton.horsetrials.app.downloaded.results.xml.firstinspection.urlsetobjects.FirstInspectionObject.horse_name
for class badminton.horsetrials.app.downloaded.results.xml.firstinspection.urlsetobjects.FirstInspectionObject
at line 7
XML is:
<badminton_results>
<first_inspection>
<rider_number>130</rider_number>
<horse_name>NZB LAND VISION</horse_name>
<rider_name>Mark Todd (NZL)</rider_name>
<status>Passed</status>
</first_inspection>
<first_inspection>
<rider_number>129</rider_number>
<horse_name>REDESIGNED</horse_name>
<rider_name>Pippa Funnell</rider_name>
<status>Passed</status>
</first_inspection>
<first_inspection>
<rider_number>127</rider_number>
<horse_name>NEREO</horse_name>
<rider_name>Andrew Nicholson (NZL)</rider_name>
<status>Passed</status>
</first_inspection>
</badminton_results>
My classes are as follows:
public class badminton_results {
// THIS CLASS HOLDS ALL OF THE INFO FROM THE INITIAL FEED DOWNLOAD.
// WE USE SIMPLE XML TO PARSE IT IN AND CREATE OBJECTS FOR US
//ALL var names MUST equal whats in xml identically.
@ElementList
public List<FirstInspectionObject> first_inspection;
}
@Element(name="first_inspection")
public class FirstInspectionObject {
@Element(required=true)
public RiderNumber rider_number;
@Element(required=true)
public HorseName horse_name;
@Element(required=true)
public RiderName rider_name;
@Element(required=true)
public Status status;
}
@Element(name="horse_name")
public class HorseName {
@Text(required=true)
public String horse_name;
}
@Element(name="rider_name")
public class RiderName {
@Text(required=true)
public String rider_name;
}
@Element(name="rider_number")
public class RiderNumber {
@Text(required=true)
public String rider_number;
}
@Element(name="status")
public class Status {
@Text(required=true)
public String status;
}
If anyone can shine any light on this Id be very grateful!!
Gaz.
|
|
From: Gareth M. <gar...@gm...> - 2012-02-22 16:13:59
|
Thank you very much that worked great!! :-)
On 23 February 2012 00:05, Adam Brown <ada...@gm...> wrote:
> You want to use the @Text annotation:
> @Element(name="youtube_feed")
> public class YoutubeFeed {
>
> @Text(required=true)
> public String youtube_feed;
> }
>
>
>
> On Wed, Feb 22, 2012 at 10:49 AM, Gareth Murfin <gar...@gm...>wrote:
>
>>
>> Hi,
>>
>> Awesome tool, its working well apart from one issue,
>>
>> in my xml I have
>>
>> <youtube_feed>
>> http://gdata.youtube.com/feeds/api/playlists/CD1BZX438AFEAF2CCE68
>> </youtube_feed>
>>
>> How do I get at this?
>>
>> If I make my class like this
>>
>> import org.simpleframework.xml.Element;
>>
>> @Element(name="youtube_feed")
>> public class YoutubeFeed {
>>
>> @Element(required=true)
>> public String youtube_feed;
>>
>>
>> }
>>
>> It complains of Error Occured Unable to satisfy
>> @org.simpleframework.xml.Element(data=false, name=, required=true,
>> type=void) on field 'youtube_feed'
>>
>> I can successfully get ones with more than one attribute within their own
>> tags, for example:
>>
>>
>> <rider_profiles>
>> <rider_profiles_feed>
>> http://www.blah.net
>> </rider_profiles_feed>
>> <rider_profiles_web>
>> http://www.blah.net
>> </rider_profiles_web>
>> <rider_profile_pdf>
>> http://www.blah.net
>> </rider_profile_pdf>
>> </rider_profiles>
>>
>> This works fine with my corresponding class:
>>
>> import org.simpleframework.xml.Element;
>>
>> @Element(name="rider_profiles")
>> public class RiderProfiles {
>>
>> @Element(required=true)
>> public String rider_profiles_feed;
>>
>> @Element(required=true)
>> public String rider_profiles_web;
>>
>> @Element(required=true)
>> public String rider_profile_pdf;
>>
>> }
>>
>>
>>
>> Any ideas? This looks like a real time saving lib and so I really love it
>> so far :-)
>> Gaz.
>>
>>
>>
>> ------------------------------------------------------------------------------
>> Virtualization & Cloud Management Using Capacity Planning
>> Cloud computing makes use of virtualization - but cloud computing
>> also focuses on allowing computing to be delivered as a service.
>> http://www.accelacomm.com/jaw/sfnl/114/51521223/
>> _______________________________________________
>> Simple-support mailing list
>> Sim...@li...
>> https://lists.sourceforge.net/lists/listinfo/simple-support
>>
>>
>
--
Gareth Murfin
Freelance Mobile Developer: J2ME, Blackberry, Android, WinPho 7
www.garethmurfin.co.uk
www.radiantsilverlabs.com/gaz
|
|
From: Warren G. <war...@so...> - 2012-02-22 16:04:39
|
Does it have anything to do with the element name being the same as the attribute name (youtube_feed) On Wed, Feb 22, 2012 at 9:49 AM, Gareth Murfin <gar...@gm...>wrote: > > Hi, > > Awesome tool, its working well apart from one issue, > > in my xml I have > > <youtube_feed> > http://gdata.youtube.com/feeds/api/playlists/CD1BZX438AFEAF2CCE68 > </youtube_feed> > > How do I get at this? > > If I make my class like this > > import org.simpleframework.xml.Element; > > @Element(name="youtube_feed") > public class YoutubeFeed { > > @Element(required=true) > public String youtube_feed; > > > } > > It complains of Error Occured Unable to satisfy > @org.simpleframework.xml.Element(data=false, name=, required=true, > type=void) on field 'youtube_feed' > > I can successfully get ones with more than one attribute within their own > tags, for example: > > > <rider_profiles> > <rider_profiles_feed> > http://www.blah.net > </rider_profiles_feed> > <rider_profiles_web> > http://www.blah.net > </rider_profiles_web> > <rider_profile_pdf> > http://www.blah.net > </rider_profile_pdf> > </rider_profiles> > > This works fine with my corresponding class: > > import org.simpleframework.xml.Element; > > @Element(name="rider_profiles") > public class RiderProfiles { > > @Element(required=true) > public String rider_profiles_feed; > > @Element(required=true) > public String rider_profiles_web; > > @Element(required=true) > public String rider_profile_pdf; > > } > > > > Any ideas? This looks like a real time saving lib and so I really love it > so far :-) > Gaz. > > > > ------------------------------------------------------------------------------ > Virtualization & Cloud Management Using Capacity Planning > Cloud computing makes use of virtualization - but cloud computing > also focuses on allowing computing to be delivered as a service. > http://www.accelacomm.com/jaw/sfnl/114/51521223/ > _______________________________________________ > Simple-support mailing list > Sim...@li... > https://lists.sourceforge.net/lists/listinfo/simple-support > > -- *Warren Goldman* Consultant | Solution Design Group (SDG) | 10275 Wayzata Blvd. Suite 300 | Minnetonka, MN 55305 952.454.2154 (mobile) | 763.5956346 (office) | www.solutiondesign.com Minneapolis/St. Paul Business Journal's Best Places to Work and Fast 50 |
|
From: Gareth M. <gar...@gm...> - 2012-02-22 15:49:23
|
Hi, Awesome tool, its working well apart from one issue, in my xml I have <youtube_feed> http://gdata.youtube.com/feeds/api/playlists/CD1BZX438AFEAF2CCE68 </youtube_feed> How do I get at this? If I make my class like this import org.simpleframework.xml.Element; @Element(name="youtube_feed") public class YoutubeFeed { @Element(required=true) public String youtube_feed; } It complains of Error Occured Unable to satisfy @org.simpleframework.xml.Element(data=false, name=, required=true, type=void) on field 'youtube_feed' I can successfully get ones with more than one attribute within their own tags, for example: <rider_profiles> <rider_profiles_feed> http://www.blah.net </rider_profiles_feed> <rider_profiles_web> http://www.blah.net </rider_profiles_web> <rider_profile_pdf> http://www.blah.net </rider_profile_pdf> </rider_profiles> This works fine with my corresponding class: import org.simpleframework.xml.Element; @Element(name="rider_profiles") public class RiderProfiles { @Element(required=true) public String rider_profiles_feed; @Element(required=true) public String rider_profiles_web; @Element(required=true) public String rider_profile_pdf; } Any ideas? This looks like a real time saving lib and so I really love it so far :-) Gaz. |
|
From: Lee R. <le...@rh...> - 2012-02-21 04:04:35
|
Solved! It occurred to me that due to Simple's extensive use of reflection that it may be requiring a default no-arg constructor! Once I added those it ran perfectly. Arrrrrgh! Yes, maybe I should have thought of that, but it would have been helpful if that had been made clear in tutorial step 2. Lee. |
|
From: Lee R. <le...@rh...> - 2012-02-20 22:21:24
|
Hi,
I am a newbie so I started implementing & testing the examples from the
tutorial right from the top.
When I got to #3 "Nested object serialization", the forward serialization
worked like a charm. However, the attempting the reverse deserialization
fails:
org.simpleframework.xml.core.PersistenceException: Constructor not matched
for class Security
at
org.simpleframework.xml.core.ClassCreator.getInstance(ClassCreator.java:109)
at
org.simpleframework.xml.core.Composite.readConstructor(Composite.java:288)
at org.simpleframework.xml.core.Composite.read(Composite.java:236)
at org.simpleframework.xml.core.Composite.read(Composite.java:202)
at org.simpleframework.xml.core.Composite.read(Composite.java:150)
at org.simpleframework.xml.core.Composite.readVariable(Composite.java:687)
at org.simpleframework.xml.core.Composite.readInstance(Composite.java:635)
at org.simpleframework.xml.core.Composite.readUnion(Composite.java:610)
at org.simpleframework.xml.core.Composite.readElement(Composite.java:593)
at org.simpleframework.xml.core.Composite.readElements(Composite.java:506)
at org.simpleframework.xml.core.Composite.readSection(Composite.java:388)
at org.simpleframework.xml.core.Composite.read(Composite.java:367)
at org.simpleframework.xml.core.Composite.read(Composite.java:234)
at org.simpleframework.xml.core.Composite.read(Composite.java:202)
at org.simpleframework.xml.core.Composite.read(Composite.java:150)
at org.simpleframework.xml.core.Composite.readVariable(Composite.java:687)
at org.simpleframework.xml.core.Composite.readInstance(Composite.java:635)
at org.simpleframework.xml.core.Composite.readUnion(Composite.java:610)
at org.simpleframework.xml.core.Composite.readElement(Composite.java:593)
at org.simpleframework.xml.core.Composite.readElements(Composite.java:506)
at org.simpleframework.xml.core.Composite.readSection(Composite.java:388)
at org.simpleframework.xml.core.Composite.read(Composite.java:367)
at org.simpleframework.xml.core.Composite.read(Composite.java:234)
at org.simpleframework.xml.core.Composite.read(Composite.java:202)
at org.simpleframework.xml.core.Composite.read(Composite.java:150)
at org.simpleframework.xml.core.Traverser.read(Traverser.java:92)
at org.simpleframework.xml.core.Persister.read(Persister.java:632)
at org.simpleframework.xml.core.Persister.read(Persister.java:613)
at org.simpleframework.xml.core.Persister.read(Persister.java:591)
at org.simpleframework.xml.core.Persister.read(Persister.java:550)
at org.simpleframework.xml.core.Persister.read(Persister.java:528)
at org.simpleframework.xml.core.Persister.read(Persister.java:433)
at
com.yahoo.monarch.SimpleTutorial.deserializeConfiguration(SimpleTutorial.jav
a:72)
at com.yahoo.monarch.SimpleTutorial.main(SimpleTutorial.java:98)
The ClassCreator.getInstance(context, criteria) is getting a null back from
the getInitializer(context, criteria) method and throws the exception.
In order to load data into the classes for the forward serialization I added
simple constructors to the code shown in the tutorial (see below).
I presume those were omitted to reduce clutter.
Nonetheless, I'm stuck. Any help would be appreciated.
Thanks!
Lee.
The concatenated code (minus imports):
<pre>
@Root
public class Configuration {
@Element
private Server server;
@Attribute
private int id;
public Configuration(Server server, int id) {
this.server = server;
this.id = id;
}
public int getIdentity() { return id; }
public Server getServer() { return server; }
}
//***
public class Server {
@Attribute
private int port;
@Element
private String host;
@Element
private Security security;
public Server(Security sec, String host, int port) {
this.security = sec;
this.host = host;
this.port = port;
}
public int getPort() { return port; }
public String getHost() { return host; }
public Security getSecurity() { return security; }
}
//***
public class Security {
@Attribute
private boolean ssl;
@Element
private String keyStore;
public Security(boolean ssl, String keyStore) {
this.ssl = ssl;
this.keyStore = keyStore;
}
public boolean isSSL() { return ssl; }
public String getKeyStore() { return keyStore; }
}
//***
public static void serializeConfiguration() { //This works
//create hierarchy
Security sec = new Security(true, "KeyStoreURL");
Server server = new Server(sec, "myHost.yahoo.com", 8080);
Configuration config = new Configuration(server, 101);
//serialize to XML
Serializer serializer = new Persister();
File result = new File("configuration.xml");
try {
serializer.write(config, result);
} catch (Exception e) {
e.printStackTrace();
}
}
public static void deserializeConfiguration() { //This fails
Serializer serializer = new Persister();
File source = new File("configuration.xml");
Configuration config = null;
try {
config = serializer.read(Configuration.class, source); //Throws above
exception
} catch (Exception e) {
e.printStackTrace();
}
println("Class: Configuration");
if (config != null) {
Server svr = config.getServer();
if (svr != null) {
Security sec = svr.getSecurity();
if (sec != null) {
println("Security.ssl: "+sec.isSSL());
println("Security.keyStore: "+sec.getKeyStore());
}
println("Server.host: "+svr.getHost());
println("Server.port: "+svr.getPort());
}
println("Configuraiton.id: "+config.getIdentity());
}
}
</pre>
|
|
From: Niall G. <gal...@ya...> - 2012-02-20 09:16:23
|
the outputnode contains the name, see getName()
--- On Sun, 19/2/12, James Brawn, Jr. <de...@gm...> wrote:
From: James Brawn, Jr. <de...@gm...>
Subject: [Simple-support] How do you access field annotations from a custom Converter?
To: sim...@li...
Received: Sunday, 19 February, 2012, 4:52 PM
For some of my more complex data structures, I need to write my own Converters. For instance, say I have a List<List<String>> that I need to marshall. I've written the following:
class WorldObject {
@Element(name="vector-names")
@Convert(ListListConverter.class)
private List<List<String>> vectorNames;
/** Constructor and other details elided... **/
}
Along with the ListListConverter (I've left out the unmarshaller for the moment):
class ListListConverter implements Converter<List<List<String>>> {
@Override
public List<List<String>> read(InputNode node) throws Exception {
// stub
return null;
}
@Override
public void write(OutputNode node, List<List<String>> value)
throws Exception {
node.setName("list-list-string");
for (List<String> list : value) {
OutputNode subList = node.getChild("list-string");
for (String str : list) {
OutputNode stringNode = subList.getChild("string");
stringNode.setValue(str);
}
subList.commit();
}
node.commit();
}
}
This setup works fine, and produces the XML I want. I would, however, like to have access to the `@Element` annotation's `name` field so that I can give the tags the specified name (in this case, `"vector-names"`) rather than the default name (`"list-list-string"`). This is how marshalling works for all the types that Simple handles out of the box, so there must be a way to access that data from a custom Converter.
How can I accomplish this?
Thank you very much,
--James
-----Inline Attachment Follows-----
------------------------------------------------------------------------------
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
-----Inline Attachment Follows-----
_______________________________________________
Simple-support mailing list
Sim...@li...
https://lists.sourceforge.net/lists/listinfo/simple-support
|
|
From: James B. Jr. <de...@gm...> - 2012-02-20 00:52:14
|
For some of my more complex data structures, I need to write my own
Converters. For instance, say I have a List<List<String>> that I need to
marshall. I've written the following:
class WorldObject {
@Element(name="vector-names")
@Convert(ListListConverter.class)
private List<List<String>> vectorNames;
/** Constructor and other details elided... **/
}
Along with the ListListConverter (I've left out the unmarshaller for the
moment):
class ListListConverter implements Converter<List<List<String>>> {
@Override
public List<List<String>> read(InputNode node) throws Exception {
// stub
return null;
}
@Override
public void write(OutputNode node, List<List<String>> value)
throws Exception {
node.setName("list-list-string");
for (List<String> list : value) {
OutputNode subList = node.getChild("list-string");
for (String str : list) {
OutputNode stringNode = subList.getChild("string");
stringNode.setValue(str);
}
subList.commit();
}
node.commit();
}
}
This setup works fine, and produces the XML I want. I would, however, like
to have access to the `@Element` annotation's `name` field so that I can
give the tags the specified name (in this case, `"vector-names"`) rather
than the default name (`"list-list-string"`). This is how marshalling works
for all the types that Simple handles out of the box, so there must be a
way to access that data from a custom Converter.
How can I accomplish this?
Thank you very much,
--James
|
|
From: -=}\\*/{=- <rui...@gm...> - 2012-02-20 00:05:57
|
hi, i'm implementing a Converter and in the "read(InputNode in)" implementation i would like to test "in" for the presence of attributes. the NodeMap returned does not have a "int size()" or "boolean isEmpty()"... i can go and test the iterator but not much sense... what am i missing? thank you, rui |
|
From: Nugroho S. <nug...@gm...> - 2012-02-16 05:51:53
|
Please ignore my previous email. I just read the Javadoc and found @Convert
can be applied to class level.
Thank you.
Regards,
Nugroho
On Thu, Feb 16, 2012 at 12:44 PM, Nugroho Saputro <nug...@gm...
> wrote:
> Hi Niall,
>
> In which part I should use @Converter? In my case, I don't have @Element
> annotation.
>
> Can @Converter be applied to @ElementList ?
>
> Thank you.
>
> Regards,
> Nugroho
>
>
> On Wed, Feb 15, 2012 at 4:09 PM, Niall Gallagher <
> gal...@ya...> wrote:
>
>> You will have to use a Converter, @Text can not be used with any element
>> annotation.
>>
>> --- On *Tue, 14/2/12, Nugroho Saputro <nug...@gm...>* wrote:
>>
>>
>> From: Nugroho Saputro <nug...@gm...>
>> Subject: [Simple-support] Read text or elements for the same element tag
>> To: sim...@li...
>> Received: Tuesday, 14 February, 2012, 10:24 PM
>>
>>
>> Hi,
>>
>> I have the following XML. custom_field element can contains a Text or a
>> set of elements.
>>
>> <record>
>> <custom_field id="2">
>> *Value 1*
>> </custom_field>
>> <custom_field id="2">
>> * <option selected="true">option 1</option>*
>> * <option>option 2</option>*
>> </custom_field>
>> </record>
>>
>> I tried the following annotation
>>
>> @Root(name="record", strict=false)
>> public class Record {
>>
>> @ElementList(entry="custom_field", inline=true, required=false)
>> public List<CustomField> customFields = new ArrayList<CustomField>();
>> }
>>
>> ------------
>>
>> @Root(name="custom_field", strict=false)
>> public class CustomField {
>>
>> @Text(required=false)
>> public String value; // single value
>>
>> @ElementList(inline=true, entry="option", required=false)
>> public List<FieldOption> options = new ArrayList<FieldOption>(); //
>> options value
>>
>> }
>>
>> I get this error :
>>
>> Unable to read XML. Text annotation
>> @org.simpleframework.xml.Text(data=false, empty=, required=false) on field
>> 'value' public java.lang.String com.test.CustomField.value used with
>> elements in class com.test.CustomField
>>
>> Any idea to solve this problem?
>>
>> I wonder if I can use converter but where should I put it as I don't use
>> @Element here.
>>
>> Thank you.
>>
>> Reagrds,
>> Nugroho
>>
>>
>>
|
|
From: Nugroho S. <nug...@gm...> - 2012-02-16 05:45:09
|
Hi Niall,
In which part I should use @Converter? In my case, I don't have @Element
annotation.
Can @Converter be applied to @ElementList ?
Thank you.
Regards,
Nugroho
On Wed, Feb 15, 2012 at 4:09 PM, Niall Gallagher
<gal...@ya...>wrote:
> You will have to use a Converter, @Text can not be used with any element
> annotation.
>
> --- On *Tue, 14/2/12, Nugroho Saputro <nug...@gm...>* wrote:
>
>
> From: Nugroho Saputro <nug...@gm...>
> Subject: [Simple-support] Read text or elements for the same element tag
> To: sim...@li...
> Received: Tuesday, 14 February, 2012, 10:24 PM
>
>
> Hi,
>
> I have the following XML. custom_field element can contains a Text or a
> set of elements.
>
> <record>
> <custom_field id="2">
> *Value 1*
> </custom_field>
> <custom_field id="2">
> * <option selected="true">option 1</option>*
> * <option>option 2</option>*
> </custom_field>
> </record>
>
> I tried the following annotation
>
> @Root(name="record", strict=false)
> public class Record {
>
> @ElementList(entry="custom_field", inline=true, required=false)
> public List<CustomField> customFields = new ArrayList<CustomField>();
> }
>
> ------------
>
> @Root(name="custom_field", strict=false)
> public class CustomField {
>
> @Text(required=false)
> public String value; // single value
>
> @ElementList(inline=true, entry="option", required=false)
> public List<FieldOption> options = new ArrayList<FieldOption>(); //
> options value
>
> }
>
> I get this error :
>
> Unable to read XML. Text annotation
> @org.simpleframework.xml.Text(data=false, empty=, required=false) on field
> 'value' public java.lang.String com.test.CustomField.value used with
> elements in class com.test.CustomField
>
> Any idea to solve this problem?
>
> I wonder if I can use converter but where should I put it as I don't use
> @Element here.
>
> Thank you.
>
> Reagrds,
> Nugroho
>
>
>
|
|
From: Niall G. <gal...@ya...> - 2012-02-15 09:09:52
|
You will have to use a Converter, @Text can not be used with any element annotation.
--- On Tue, 14/2/12, Nugroho Saputro <nug...@gm...> wrote:
From: Nugroho Saputro <nug...@gm...>
Subject: [Simple-support] Read text or elements for the same element tag
To: sim...@li...
Received: Tuesday, 14 February, 2012, 10:24 PM
Hi,
I have the following XML. custom_field element can contains a Text or a set of elements.
<record><custom_field id="2">Value 1
</custom_field><custom_field id="2"> <option selected="true">option 1</option> <option>option 2</option></custom_field>
</record>
I tried the following annotation
@Root(name="record", strict=false)public class Record {
@ElementList(entry="custom_field", inline=true, required=false)
public List<CustomField> customFields = new ArrayList<CustomField>();
}
------------
@Root(name="custom_field", strict=false)public class CustomField {
@Text(required=false)
public String value; // single value
@ElementList(inline=true, entry="option", required=false)
public List<FieldOption> options = new ArrayList<FieldOption>(); // options value
}I get this error :
Unable to read XML. Text annotation @org.simpleframework.xml.Text(data=false, empty=, required=false) on field 'value' public java.lang.String com.test.CustomField.value used with elements in class com.test.CustomField
Any idea to solve this problem?I wonder if I can use converter but where should I put it as I don't use @Element here.Thank you.Reagrds,
Nugroho
-----Inline Attachment Follows-----
------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
-----Inline Attachment Follows-----
_______________________________________________
Simple-support mailing list
Sim...@li...
https://lists.sourceforge.net/lists/listinfo/simple-support
|
|
From: Nugroho S. <nug...@gm...> - 2012-02-15 06:25:12
|
Hi,
I have the following XML. custom_field element can contains a Text or a set
of elements.
<record>
<custom_field id="2">
*Value 1*
</custom_field>
<custom_field id="2">
* <option selected="true">option 1</option>*
* <option>option 2</option>*
</custom_field>
</record>
I tried the following annotation
@Root(name="record", strict=false)
public class Record {
@ElementList(entry="custom_field", inline=true, required=false)
public List<CustomField> customFields = new ArrayList<CustomField>();
}
------------
@Root(name="custom_field", strict=false)
public class CustomField {
@Text(required=false)
public String value; // single value
@ElementList(inline=true, entry="option", required=false)
public List<FieldOption> options = new ArrayList<FieldOption>(); //
options value
}
I get this error :
Unable to read XML. Text annotation
@org.simpleframework.xml.Text(data=false, empty=, required=false) on field
'value' public java.lang.String com.test.CustomField.value used with
elements in class com.test.CustomField
Any idea to solve this problem?
I wonder if I can use converter but where should I put it as I don't use
@Element here.
Thank you.
Reagrds,
Nugroho
|
|
From: Danny S. <d.s...@gm...> - 2012-02-10 17:01:22
|
Dear Simple Support, We've been using Simple XML 2.6.1 for a year or so now, mainly to deserialize small XML docs to Java objects. On close inspection, we discovered that calls to serializer.read (Class, String) were 10x slower than if we just parsed the string ourselves and assigned values to our Java object. Is there something we're missing in our call to serializer.read ? Regards, Danny |
|
From: Niall G. <gal...@ya...> - 2012-02-08 08:53:35
|
Hi, Yes, this is simply informational, it should not affect anything. I am not sure what your issue is with regards to the activity? Is it causing a problem? Thanks, Niall --- On Tue, 7/2/12, pe...@va... <pe...@va...> wrote: From: pe...@va... <pe...@va...> Subject: [Simple-support] Android weird behaviour while switching parsers To: sim...@li... Received: Tuesday, 7 February, 2012, 6:24 AM Hi there When using Simple 2.6.2 on android 2.3.3 it works most of the time like it should but once in a while I get the following in my LogCat (see below). As I understand this shouldn't be a problem and is just information about Simple not being able to find the javax.xml.stream package and will switch to something else. The weird thing is that it is affecting the current android activity (trying to use Simple) which disappears and the previous activity is shown instead. This behaviour only occurs when the following LogCat stacktrace occurs, about one out of ten, the rest of the times everything behaves as expected. 12-23 23:10:41.319: I/ActivityThread(29347): Pub com.vahlstrup.mobile.android.comicscontainer.gui.datasources.SearchSuggestionsDataSource: com.vahlstrup.mobile.android.comicscontainer.gui.datasources.SearchSuggestionsDataSource 12-23 23:10:42.456: I/dalvikvm(29347): Could not find method javax.xml.stream.XMLInputFactory.newInstance, referenced from method org.simpleframework.xml.stream.StreamProvider.<init> 12-23 23:10:42.456: W/dalvikvm(29347): VFY: unable to resolve static method 3329: Ljavax/xml/stream/XMLInputFactory;.newInstance ()Ljavax/xml/stream/XMLInputFactory; 12-23 23:10:42.456: D/dalvikvm(29347): VFY: replacing opcode 0x71 at 0x0003 12-23 23:10:42.456: D/dalvikvm(29347): VFY: dead code 0x0006-0009 in Lorg/simpleframework/xml/stream/StreamProvider;.<init> ()V 12-23 23:10:42.456: W/dalvikvm(29347): VFY: unable to find class referenced in signature (Ljavax/xml/stream/XMLEventReader;) 12-23 23:10:42.456: W/dalvikvm(29347): VFY: unable to find class referenced in signature (Ljavax/xml/stream/XMLEventReader;) 12-23 23:10:42.456: I/dalvikvm(29347): Could not find method javax.xml.stream.XMLInputFactory.createXMLEventReader, referenced from method org.simpleframework.xml.stream.StreamProvider.provide 12-23 23:10:42.456: W/dalvikvm(29347): VFY: unable to resolve virtual method 3327: Ljavax/xml/stream/XMLInputFactory;.createXMLEventReader (Ljava/io/InputStream;)Ljavax/xml/stream/XMLEventReader; 12-23 23:10:42.456: D/dalvikvm(29347): VFY: replacing opcode 0x6e at 0x0002 12-23 23:10:42.456: D/dalvikvm(29347): VFY: dead code 0x0005-000a in Lorg/simpleframework/xml/stream/StreamProvider;.provide (Ljava/io/InputStream;)Lorg/simpleframework/xml/stream/EventReader; 12-23 23:10:42.456: I/dalvikvm(29347): Could not find method javax.xml.stream.XMLInputFactory.createXMLEventReader, referenced from method org.simpleframework.xml.stream.StreamProvider.provide 12-23 23:10:42.466: W/dalvikvm(29347): VFY: unable to resolve virtual method 3328: Ljavax/xml/stream/XMLInputFactory;.createXMLEventReader (Ljava/io/Reader;)Ljavax/xml/stream/XMLEventReader; 12-23 23:10:42.466: D/dalvikvm(29347): VFY: replacing opcode 0x6e at 0x0002 12-23 23:10:42.466: D/dalvikvm(29347): VFY: dead code 0x0005-000a in Lorg/simpleframework/xml/stream/StreamProvider;.provide (Ljava/io/Reader;)Lorg/simpleframework/xml/stream/EventReader; 12-23 23:10:42.649: D/dalvikvm(29347): GC_CONCURRENT freed 934K, 50% free 3375K/6727K, external 2100K/2137K, paused 2ms+2ms 12-23 23:10:43.609: D/dalvikvm(29347): GC_EXTERNAL_ALLOC freed 877K, 53% free 3207K/6727K, external 2134K/2137K, paused 30ms 12-23 23:10:45.166: D/dalvikvm(29347): GC_CONCURRENT freed 1151K, 55% free 3050K/6727K, external 2323K/2686K, paused 3ms+3ms -----Inline Attachment Follows----- ------------------------------------------------------------------------------ Keep Your Developer Skills Current with LearnDevNow! The most comprehensive online learning library for Microsoft developers is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, Metro Style Apps, more. Free future releases when you subscribe now! http://p.sf.net/sfu/learndevnow-d2d -----Inline Attachment Follows----- _______________________________________________ Simple-support mailing list Sim...@li... https://lists.sourceforge.net/lists/listinfo/simple-support |
|
From: <pe...@va...> - 2012-02-07 14:43:34
|
Hi there When using Simple 2.6.2 on android 2.3.3 it works most of the time like it should but once in a while I get the following in my LogCat (see below). As I understand this shouldn't be a problem and is just information about Simple not being able to find the javax.xml.stream package and will switch to something else. The weird thing is that it is affecting the current android activity (trying to use Simple) which disappears and the previous activity is shown instead. This behaviour only occurs when the following LogCat stacktrace occurs, about one out of ten, the rest of the times everything behaves as expected. 12-23 23:10:41.319: I/ActivityThread(29347): Pub com.vahlstrup.mobile.android.comicscontainer.gui.datasources.SearchSugge stionsDataSource: com.vahlstrup.mobile.android.comicscontainer.gui.datasources.SearchSugge stionsDataSource 12-23 23:10:42.456: I/dalvikvm(29347): Could not find method javax.xml.stream.XMLInputFactory.newInstance, referenced from method org.simpleframework.xml.stream.StreamProvider.<init> 12-23 23:10:42.456: W/dalvikvm(29347): VFY: unable to resolve static method 3329: Ljavax/xml/stream/XMLInputFactory;.newInstance ()Ljavax/xml/stream/XMLInputFactory; 12-23 23:10:42.456: D/dalvikvm(29347): VFY: replacing opcode 0x71 at 0x0003 12-23 23:10:42.456: D/dalvikvm(29347): VFY: dead code 0x0006-0009 in Lorg/simpleframework/xml/stream/StreamProvider;.<init> ()V 12-23 23:10:42.456: W/dalvikvm(29347): VFY: unable to find class referenced in signature (Ljavax/xml/stream/XMLEventReader;) 12-23 23:10:42.456: W/dalvikvm(29347): VFY: unable to find class referenced in signature (Ljavax/xml/stream/XMLEventReader;) 12-23 23:10:42.456: I/dalvikvm(29347): Could not find method javax.xml.stream.XMLInputFactory.createXMLEventReader, referenced from method org.simpleframework.xml.stream.StreamProvider.provide 12-23 23:10:42.456: W/dalvikvm(29347): VFY: unable to resolve virtual method 3327: Ljavax/xml/stream/XMLInputFactory;.createXMLEventReader (Ljava/io/InputStream;)Ljavax/xml/stream/XMLEventReader; 12-23 23:10:42.456: D/dalvikvm(29347): VFY: replacing opcode 0x6e at 0x0002 12-23 23:10:42.456: D/dalvikvm(29347): VFY: dead code 0x0005-000a in Lorg/simpleframework/xml/stream/StreamProvider;.provide (Ljava/io/InputStream;)Lorg/simpleframework/xml/stream/EventReader; 12-23 23:10:42.456: I/dalvikvm(29347): Could not find method javax.xml.stream.XMLInputFactory.createXMLEventReader, referenced from method org.simpleframework.xml.stream.StreamProvider.provide 12-23 23:10:42.466: W/dalvikvm(29347): VFY: unable to resolve virtual method 3328: Ljavax/xml/stream/XMLInputFactory;.createXMLEventReader (Ljava/io/Reader;)Ljavax/xml/stream/XMLEventReader; 12-23 23:10:42.466: D/dalvikvm(29347): VFY: replacing opcode 0x6e at 0x0002 12-23 23:10:42.466: D/dalvikvm(29347): VFY: dead code 0x0005-000a in Lorg/simpleframework/xml/stream/StreamProvider;.provide (Ljava/io/Reader;)Lorg/simpleframework/xml/stream/EventReader; 12-23 23:10:42.649: D/dalvikvm(29347): GC_CONCURRENT freed 934K, 50% free 3375K/6727K, external 2100K/2137K, paused 2ms+2ms 12-23 23:10:43.609: D/dalvikvm(29347): GC_EXTERNAL_ALLOC freed 877K, 53% free 3207K/6727K, external 2134K/2137K, paused 30ms 12-23 23:10:45.166: D/dalvikvm(29347): GC_CONCURRENT freed 1151K, 55% free 3050K/6727K, external 2323K/2686K, paused 3ms+3ms |
|
From: Niall G. <gal...@ya...> - 2012-02-05 02:26:20
|
Pass a Format instance to your Persister. --- On Fri, 3/2/12, Warren Goldman <war...@so...> wrote: From: Warren Goldman <war...@so...> Subject: [Simple-support] How do I get the xml version, encoding line to show as the first line in a file To: sim...@li... Received: Friday, 3 February, 2012, 1:59 PM I am writing to a file and would like the xml to be preceded by <?xml version="1.0" encoding="UTF-8" standalone="yes"?> Presently I am having the serializer.write take in a ByteArrayOutputStream, then writing the above to a file, following by the contents of the byte array. Is there a way to annotate or achieve this so I do not have to have the whole xml stream in a byte array? -- Warren Goldman Consultant | Solution Design Group (SDG) | 10275 Wayzata Blvd. Suite 300 | Minnetonka, MN 55305 952.454.2154 (mobile) | 763.5956346 (office) | www.solutiondesign.com Minneapolis/St. Paul Business Journal's Best Places to Work and Fast 50 -----Inline Attachment Follows----- ------------------------------------------------------------------------------ Try before you buy = See our experts in action! The most comprehensive online learning library for Microsoft developers is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, Metro Style Apps, more. Free future releases when you subscribe now! http://p.sf.net/sfu/learndevnow-dev2 -----Inline Attachment Follows----- _______________________________________________ Simple-support mailing list Sim...@li... https://lists.sourceforge.net/lists/listinfo/simple-support |
|
From: Warren G. <war...@so...> - 2012-02-03 21:59:37
|
I am writing to a file and would like the xml to be preceded by <?xml version="1.0" encoding="UTF-8" standalone="yes"?> Presently I am having the serializer.write take in a ByteArrayOutputStream, then writing the above to a file, following by the contents of the byte array. Is there a way to annotate or achieve this so I do not have to have the whole xml stream in a byte array? -- *Warren Goldman* Consultant | Solution Design Group (SDG) | 10275 Wayzata Blvd. Suite 300 | Minnetonka, MN 55305 952.454.2154 (mobile) | 763.5956346 (office) | www.solutiondesign.com Minneapolis/St. Paul Business Journal's Best Places to Work and Fast 50 |
|
From: -=}\\*/{=- <rui...@gm...> - 2012-02-03 21:51:24
|
declare it like this: public ArrayList<String> myStrings; On 3 February 2012 19:18, Warren Goldman <war...@so...>wrote: > @ElementList(name="My_List") > public List<String> myStrings; > > produces > <MyList class="java.util.ArrayList"> > .... > </MyList> > > I want > <MyList> > .... > </MyList> > > > > -- > > *Warren Goldman* > > Consultant | Solution Design Group (SDG) | 10275 Wayzata Blvd. Suite 300 | > Minnetonka, MN 55305 > 952.454.2154 (mobile) | 763.5956346 (office) | www.solutiondesign.com > > Minneapolis/St. Paul Business Journal's Best Places to Work and Fast 50 > > > ------------------------------------------------------------------------------ > Try before you buy = See our experts in action! > The most comprehensive online learning library for Microsoft developers > is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, > Metro Style Apps, more. Free future releases when you subscribe now! > http://p.sf.net/sfu/learndevnow-dev2 > _______________________________________________ > Simple-support mailing list > Sim...@li... > https://lists.sourceforge.net/lists/listinfo/simple-support > > |
|
From: Warren G. <war...@so...> - 2012-02-03 19:49:41
|
@ElementList(name="My_List")
public List<String> myStrings;
produces
<MyList class="java.util.ArrayList">
....
</MyList>
I want
<MyList>
....
</MyList>
--
*Warren Goldman*
Consultant | Solution Design Group (SDG) | 10275 Wayzata Blvd. Suite 300 |
Minnetonka, MN 55305
952.454.2154 (mobile) | 763.5956346 (office) | www.solutiondesign.com
Minneapolis/St. Paul Business Journal's Best Places to Work and Fast 50
|
|
From: Niall G. <gal...@ya...> - 2012-01-28 02:23:02
|
This is something ill have to take a look at. Thanks, niall. --- On Tue, 24/1/12, Emilio Carlos da Palma <ecd...@gm...> wrote: From: Emilio Carlos da Palma <ecd...@gm...> Subject: Re: [Simple-support] Help with @Replace To: sim...@li... Received: Tuesday, 24 January, 2012, 8:12 AM This thread http://old.nabble.com/Creating-a-%22short%22-serialization-td14220229.html helped me, particularly this message http://old.nabble.com/Creating-a-%22short%22-serialization-td14220229.html#a14263846. But I still wonder why not allow the replacement of the root schema class... On Mon, Jan 23, 2012 at 9:15 PM, Emilio Carlos da Palma <ecd...@gm...> wrote: > I've found that calling the Called#replace method in the > Composite#write solves my problem (or works like I think it should). > Here is the snippet: > > core.Composite.java (around line 1018) > ... > } else { > source = caller.replace(source); > caller.persist(source); > write(node, source, schema); > } > ... > > But I don't know about what can be broken with this change. Maybe > replace should be called after persist, I don't know. In fact I think > I could use the @Persist, but I want to keep the original object. > > Emilio > > > On Mon, Jan 23, 2012 at 7:44 PM, Emilio Carlos da Palma > <ecd...@gm...> wrote: >> I can't get the annotated method to get called when serializing. >> >> Here is the code: >> >> Solution.java: >> >> @Root >> public class Solution >> >> @Element >> private String mId; >> >> @Element(required=false) >> private String name >> >> @ElementList >> private List<Dependent> mDependents; >> ... >> // (Constructors, getters/setters) >> ... >> @Replace >> public Solution replaceSolution() { >> return new Solution(mId, null, mDependents); >> } >> } >> >> Dependent.java: >> @Root >> public class Dependent >> >> @Element >> private String mId; >> >> @Element(required=false) >> private String name >> >> ... >> >> } >> >> What I intend is exclude the Solution#name element from the xml. >> >> Any hint? I tried some trunk versions back to 1200, but no success. >> >> Thanks in advance. >> >> Emilio ------------------------------------------------------------------------------ Keep Your Developer Skills Current with LearnDevNow! The most comprehensive online learning library for Microsoft developers is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, Metro Style Apps, more. Free future releases when you subscribe now! http://p.sf.net/sfu/learndevnow-d2d _______________________________________________ Simple-support mailing list Sim...@li... https://lists.sourceforge.net/lists/listinfo/simple-support |
|
From: Niall G. <gal...@ya...> - 2012-01-28 02:19:01
|
Hi,
Have you taken a look at the @Replace test cases, they should still work. Not sure whats happening here, ill take a look. In the mean time take a look at the test cases for this. The answer to your problem could be there.
Niall
--- On Mon, 23/1/12, Emilio Carlos da Palma <ecd...@gm...> wrote:
From: Emilio Carlos da Palma <ecd...@gm...>
Subject: [Simple-support] Help with @Replace
To: sim...@li...
Received: Monday, 23 January, 2012, 1:44 PM
I can't get the annotated method to get called when serializing.
Here is the code:
Solution.java:
@Root
public class Solution
@Element
private String mId;
@Element(required=false)
private String name
@ElementList
private List<Dependent> mDependents;
...
// (Constructors, getters/setters)
...
@Replace
public Solution replaceSolution() {
return new Solution(mId, null, mDependents);
}
}
Dependent.java:
@Root
public class Dependent
@Element
private String mId;
@Element(required=false)
private String name
...
}
What I intend is exclude the Solution#name element from the xml.
Any hint? I tried some trunk versions back to 1200, but no success.
Thanks in advance.
Emilio
------------------------------------------------------------------------------
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
_______________________________________________
Simple-support mailing list
Sim...@li...
https://lists.sourceforge.net/lists/listinfo/simple-support
|
|
From: Emilio C. da P. <ecd...@gm...> - 2012-01-24 16:13:05
|
This thread http://old.nabble.com/Creating-a-%22short%22-serialization-td14220229.html helped me, particularly this message http://old.nabble.com/Creating-a-%22short%22-serialization-td14220229.html#a14263846. But I still wonder why not allow the replacement of the root schema class... On Mon, Jan 23, 2012 at 9:15 PM, Emilio Carlos da Palma <ecd...@gm...> wrote: > I've found that calling the Called#replace method in the > Composite#write solves my problem (or works like I think it should). > Here is the snippet: > > core.Composite.java (around line 1018) > ... > } else { > source = caller.replace(source); > caller.persist(source); > write(node, source, schema); > } > ... > > But I don't know about what can be broken with this change. Maybe > replace should be called after persist, I don't know. In fact I think > I could use the @Persist, but I want to keep the original object. > > Emilio > > > On Mon, Jan 23, 2012 at 7:44 PM, Emilio Carlos da Palma > <ecd...@gm...> wrote: >> I can't get the annotated method to get called when serializing. >> >> Here is the code: >> >> Solution.java: >> >> @Root >> public class Solution >> >> @Element >> private String mId; >> >> @Element(required=false) >> private String name >> >> @ElementList >> private List<Dependent> mDependents; >> ... >> // (Constructors, getters/setters) >> ... >> @Replace >> public Solution replaceSolution() { >> return new Solution(mId, null, mDependents); >> } >> } >> >> Dependent.java: >> @Root >> public class Dependent >> >> @Element >> private String mId; >> >> @Element(required=false) >> private String name >> >> ... >> >> } >> >> What I intend is exclude the Solution#name element from the xml. >> >> Any hint? I tried some trunk versions back to 1200, but no success. >> >> Thanks in advance. >> >> Emilio |
|
From: Emilio C. da P. <ecd...@gm...> - 2012-01-23 23:15:56
|
I've found that calling the Called#replace method in the
Composite#write solves my problem (or works like I think it should).
Here is the snippet:
core.Composite.java (around line 1018)
...
} else {
source = caller.replace(source);
caller.persist(source);
write(node, source, schema);
}
...
But I don't know about what can be broken with this change. Maybe
replace should be called after persist, I don't know. In fact I think
I could use the @Persist, but I want to keep the original object.
Emilio
On Mon, Jan 23, 2012 at 7:44 PM, Emilio Carlos da Palma
<ecd...@gm...> wrote:
> I can't get the annotated method to get called when serializing.
>
> Here is the code:
>
> Solution.java:
>
> @Root
> public class Solution
>
> @Element
> private String mId;
>
> @Element(required=false)
> private String name
>
> @ElementList
> private List<Dependent> mDependents;
> ...
> // (Constructors, getters/setters)
> ...
> @Replace
> public Solution replaceSolution() {
> return new Solution(mId, null, mDependents);
> }
> }
>
> Dependent.java:
> @Root
> public class Dependent
>
> @Element
> private String mId;
>
> @Element(required=false)
> private String name
>
> ...
>
> }
>
> What I intend is exclude the Solution#name element from the xml.
>
> Any hint? I tried some trunk versions back to 1200, but no success.
>
> Thanks in advance.
>
> Emilio
|
|
From: Emilio C. da P. <ecd...@gm...> - 2012-01-23 21:44:52
|
I can't get the annotated method to get called when serializing.
Here is the code:
Solution.java:
@Root
public class Solution
@Element
private String mId;
@Element(required=false)
private String name
@ElementList
private List<Dependent> mDependents;
...
// (Constructors, getters/setters)
...
@Replace
public Solution replaceSolution() {
return new Solution(mId, null, mDependents);
}
}
Dependent.java:
@Root
public class Dependent
@Element
private String mId;
@Element(required=false)
private String name
...
}
What I intend is exclude the Solution#name element from the xml.
Any hint? I tried some trunk versions back to 1200, but no success.
Thanks in advance.
Emilio
|