simple-support Mailing List for Simple (Page 23)
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: Robert M. <rob...@gm...> - 2012-01-10 13:00:44
|
I just started doing timing tests on my XML and I discovered that on an ASUS Transformer (Original) that a 31 line XML file took 2 seconds to load and a 219 line xml file took around 2.8 seconds to load. Those times are quite large, it is obviously preferably if we could cut them by about a fifth. I suspect that the massive amounts of branching contribute to the delay somewhat but more investigation needs to be done. Niall probably also knows what the cause of the problems are. I will be looking into it soon. I my goal would be to get the entire process down to 0.5 seconds on an Android device for any file that has 1000 lines or less. Maybe the reflection code also causes quite a bit of a slowdown. We shall see. I wonder how much of the reflection calls get cached as the parsing goes along. Robert On Tue, Jan 10, 2012 at 5:00 AM, Rangel Reale <ran...@gm...> wrote: > Hello, > > I am having performance issues in Android parsing a very large XML file. > > Profiling trying to find where the bottleneck is, if I undestood > correctly, the application is 44% of the time in the function > "KXmlParser.getLineNumber", called from PullReader$Start.<init>, but > looking at its source code it seems to only read an instance variable an > nothing more. > > Can someone shed a light on this? > > I don't know it posting images is allowed here, so I uplodaded to an image > sharing site: > > http://imgur.com/C5ocm > > Thanks, > Rangel > > > ------------------------------------------------------------------------------ > Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex > infrastructure or vast IT resources to deliver seamless, secure access to > virtual desktops. With this all-in-one solution, easily deploy virtual > desktops for less than the cost of PCs and save 60% on VDI infrastructure > costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox > _______________________________________________ > Simple-support mailing list > Sim...@li... > https://lists.sourceforge.net/lists/listinfo/simple-support > > |
|
From: Rangel R. <ran...@gm...> - 2012-01-09 18:00:34
|
Hello, I am having performance issues in Android parsing a very large XML file. Profiling trying to find where the bottleneck is, if I undestood correctly, the application is 44% of the time in the function "KXmlParser.getLineNumber", called from PullReader$Start.<init>, but looking at its source code it seems to only read an instance variable an nothing more. Can someone shed a light on this? I don't know it posting images is allowed here, so I uplodaded to an image sharing site: http://imgur.com/C5ocm Thanks, Rangel |
|
From: Jean C. <jlc...@ya...> - 2012-01-05 02:42:03
|
Hi Everyone, I have a XML schema that I would like to serialize using Simple. The schema contains elements whose attributes are part of attribute groups. Several types contain references to multiple attribute groups. Is there an ideal way to serialize this reference in the class I'm creating? I would like to avoid having to specify each attribute every time the attribute group appears in the schema--this would get messy if an update to the schema changes the attributes in a given group. Thanks! |
|
From: Alvin B. <alv...@gm...> - 2012-01-02 00:52:43
|
Hi
I'm trying to serialize an enum that looks like this:
public enum Category {
....
NEWSPAPER(Type.SUBSCRIPTION) {
@Override
public String getPrintable() {
return "Newspaper Subscription Fee";
}
},
MAGAZINE(Type.SUBSCRIPTION) {
@Override
public String getPrintable() {
return "Magazine Subscription Fee";
}
},
MEMBERSHIP(Type.SUBSCRIPTION) {
@Override
public String getPrintable() {
return "Club Membership Fee";
}
},
....
}
But when serializing it throws this exception:
org.simpleframework.xml.transform.TransformException: Transform of class
com.epik.dto.expense.Category$48 not supported
at
org.simpleframework.xml.transform.Transformer.write(Transformer.java:122)
at org.simpleframework.xml.core.Support.write(Support.java:200)
at
org.simpleframework.xml.core.PrimitiveFactory.getText(PrimitiveFactory.java:128)
at org.simpleframework.xml.core.Primitive.write(Primitive.java:288)
at org.simpleframework.xml.core.Composite.writeElement(Composite.java:1331)
at org.simpleframework.xml.core.Composite.writeElement(Composite.java:1314)
at org.simpleframework.xml.core.Composite.writeUnion(Composite.java:1194)
at org.simpleframework.xml.core.Composite.writeElements(Composite.java:1165)
at org.simpleframework.xml.core.Composite.writeSection(Composite.java:1071)
at org.simpleframework.xml.core.Composite.write(Composite.java:1042)
at org.simpleframework.xml.core.Composite.write(Composite.java:1019)
at org.simpleframework.xml.core.Traverser.write(Traverser.java:236)
at org.simpleframework.xml.core.Traverser.write(Traverser.java:208)
at org.simpleframework.xml.core.Traverser.write(Traverser.java:186)
at org.simpleframework.xml.core.Persister.write(Persister.java:1187)
at org.simpleframework.xml.core.Persister.write(Persister.java:1169)
at org.simpleframework.xml.core.Persister.write(Persister.java:1147)
at org.simpleframework.xml.core.Persister.write(Persister.java:1266)
at com.epik.client.AbstractClient.postResource(AbstractClient.java:171)
at com.epik.client.BillClient.addBill(BillClient.java:33)
at com.epik.client.BillClient.<init>(BillClient.java:23)
at com.epik.client.BillClient.main(BillClient.java:74)
The top class of the exception (AbstractClient), and the line that
generates the exception is this:
Serializer s = new Persister(new EpikMatcher());
StringWriter writer = new StringWriter();
s.write(resource, writer); //Exception generated Here
The matcher looks like this:
public class EpikMatcher implements Matcher {
@SuppressWarnings("rawtypes")
@Override
public Transform match(Class clazz) throws Exception {
if (clazz.equals(DateTime.class)) {
return new DateTimeAdapter();
}
return null;
}
}
It serializes when the enum doesn't implement an abstract method (as does
mine), but as I implement an abstract method, it crashes.
Thanks for any help
|
|
From: Fia S. <fi...@sc...> - 2011-12-30 13:38:31
|
Hi, thanks, I can spot som errors I made in the TestdataActivity.UserData... I also tried with the code in the tutorial and it worked although I still get the messages that it will not find some methods. It works and I do hope it will continue to do so,... 12-30 14:24:33.520: W/dalvikvm(2310): VFY: unable to resolve static method 249: Ljavax/xml/stream/XMLInputFactory;.newInstance ()Ljavax/xml/stream/XMLInputFactory; 12-30 14:24:33.520: D/dalvikvm(2310): VFY: replacing opcode 0x71 at 0x0003 12-30 14:24:33.520: W/dalvikvm(2310): VFY: unable to find class referenced in signature (Ljavax/xml/stream/XMLEventReader;) 12-30 14:24:33.520: W/dalvikvm(2310): VFY: unable to find class referenced in signature (Ljavax/xml/stream/XMLEventReader;) 12-30 14:24:33.530: I/dalvikvm(2310): Could not find method javax.xml.stream.XMLInputFactory.createXMLEventReader, referenced from method org.simpleframework.xml.stream.StreamProvider.provide 12-30 14:24:33.530: W/dalvikvm(2310): VFY: unable to resolve virtual method 247: Ljavax/xml/stream/XMLInputFactory;.createXMLEventReader (Ljava/io/InputStream;)Ljavax/xml/stream/XMLEventReader; 12-30 14:24:33.530: D/dalvikvm(2310): VFY: replacing opcode 0x6e at 0x0002 12-30 14:24:33.530: I/dalvikvm(2310): Could not find method javax.xml.stream.XMLInputFactory.createXMLEventReader, referenced from method org.simpleframework.xml.stream.StreamProvider.provide 12-30 14:24:33.530: W/dalvikvm(2310): VFY: unable to resolve virtual method 248: Ljavax/xml/stream/XMLInputFactory;.createXMLEventReader (Ljava/io/Reader;)Ljavax/xml/stream/XMLEventReader; 12-30 14:24:33.530: D/dalvikvm(2310): VFY: replacing opcode 0x6e at 0x0002 12-30 14:24:33.560: D/xmltesting(2310): ok 12-30 14:24:33.570: V/TLINE(2310): new: android.text.TextLine@40834cd8 12-30 14:24:33.690: D/CLIPBOARD(2310): Hide Clipboard dialog at Starting input: finished by someone else... ! 12-30 14:25:38.070: I/ApplicationPackageManager(2310): cscCountry is not German : NSE 12-30 14:25:38.320: D/CLIPBOARD(2310): Hide Clipboard dialog at Starting input: finished by someone else... ! 12-30 14:25:38.790: D/dalvikvm(2310): GC_CONCURRENT freed 286K, 6% free 6426K/6791K, paused 2ms+1ms Den 2011-12-29 21:42:55 skrev Robert Massaioli <rob...@gm...>: > I only have an iPhone here so short message but I don't think that is > the error. I believe that message is part of the Reflection code that > makes Simple work in Android. I think the real problem is the > constructor error that appears a little lower. Probably pointing at a > problem with your annotations. Can you give the example annotations by > chance? It's probably in TestdataActivity.UserData. Because that is > what is failing. > > Robert > > Sent from my iPhone > > On 30/12/2011, at 6:40 AM, "Fia Schütz" <fi...@sc...> wrote: > >> Hi, >> >> Trying to use Simple but it will not write to my file. How will I get it >> to find javax.xml.stream.XMLInputFactory.* ? >> >> thanks >> /fia >> >> >> >> 12-29 14:28:04.290: D/TROG(2301): xmlToFile q 2131296285 >> 12-29 14:28:04.320: I/dalvikvm(2301): Could not find method >> javax.xml.stream.XMLInputFactory.newInstance, referenced from method >> org.simpleframework.xml.stream.StreamProvider.<init> >> 12-29 14:28:04.320: W/dalvikvm(2301): VFY: unable to resolve static >> method >> 1744: Ljavax/xml/stream/XMLInputFactory;.newInstance >> ()Ljavax/xml/stream/XMLInputFactory; >> 12-29 14:28:04.320: D/dalvikvm(2301): VFY: replacing opcode 0x71 at >> 0x0003 >> 12-29 14:28:04.320: W/dalvikvm(2301): VFY: unable to find class >> referenced >> in signature (Ljavax/xml/stream/XMLEventReader;) >> 12-29 14:28:04.320: W/dalvikvm(2301): VFY: unable to find class >> referenced >> in signature (Ljavax/xml/stream/XMLEventReader;) >> 12-29 14:28:04.320: I/dalvikvm(2301): Could not find method >> javax.xml.stream.XMLInputFactory.createXMLEventReader, referenced from >> method org.simpleframework.xml.stream.StreamProvider.provide >> 12-29 14:28:04.320: W/dalvikvm(2301): VFY: unable to resolve virtual >> method 1741: Ljavax/xml/stream/XMLInputFactory;.createXMLEventReader >> (Ljava/io/InputStream;)Ljavax/xml/stream/XMLEventReader; >> 12-29 14:28:04.320: D/dalvikvm(2301): VFY: replacing opcode 0x6e at >> 0x0002 >> 12-29 14:28:04.320: I/dalvikvm(2301): Could not find method >> javax.xml.stream.XMLInputFactory.createXMLEventReader, referenced from >> method org.simpleframework.xml.stream.StreamProvider.provide >> 12-29 14:28:04.320: W/dalvikvm(2301): VFY: unable to resolve virtual >> method 1742: Ljavax/xml/stream/XMLInputFactory;.createXMLEventReader >> (Ljava/io/Reader;)Ljavax/xml/stream/XMLEventReader; >> 12-29 14:28:04.320: D/dalvikvm(2301): VFY: replacing opcode 0x6e at >> 0x0002 >> 12-29 14:28:04.320: D/TROG(2301): skrev inte >> 12-29 14:28:04.320: W/System.err(2301): >> org.simpleframework.xml.core.ConstructorException: Can not construct >> inner >> class se.lth.design.troglu.TestdataActivity$UserData >> 12-29 14:28:04.330: W/System.err(2301): at >> org.simpleframework.xml.core.ConstructorScanner.scan(ConstructorScanner.java:108) >> 12-29 14:28:04.330: W/System.err(2301): at >> org.simpleframework.xml.core.ConstructorScanner.<init>(ConstructorScanner.java:81) >> 12-29 14:28:04.330: W/System.err(2301): at >> org.simpleframework.xml.core.ClassScanner.<init>(ClassScanner.java:112) >> 12-29 14:28:04.330: W/System.err(2301): at >> org.simpleframework.xml.core.Scanner.<init>(Scanner.java:88) >> 12-29 14:28:04.330: W/System.err(2301): at >> org.simpleframework.xml.core.ScannerFactory.getInstance(ScannerFactory.java:66) >> 12-29 14:28:04.330: W/System.err(2301): at >> org.simpleframework.xml.core.Support.getScanner(Support.java:170) >> 12-29 14:28:04.330: W/System.err(2301): at >> org.simpleframework.xml.core.Support.getName(Support.java:232) >> 12-29 14:28:04.330: W/System.err(2301): at >> org.simpleframework.xml.core.Source.getName(Source.java:250) >> 12-29 14:28:04.330: W/System.err(2301): at >> org.simpleframework.xml.core.Traverser.getName(Traverser.java:284) >> 12-29 14:28:04.330: W/System.err(2301): at >> org.simpleframework.xml.core.Traverser.write(Traverser.java:203) >> 12-29 14:28:04.330: W/System.err(2301): at >> org.simpleframework.xml.core.Traverser.write(Traverser.java:186) >> 12-29 14:28:04.330: W/System.err(2301): at >> org.simpleframework.xml.core.Persister.write(Persister.java:1187) >> 12-29 14:28:04.330: W/System.err(2301): at >> org.simpleframework.xml.core.Persister.write(Persister.java:1169) >> 12-29 14:28:04.330: W/System.err(2301): at >> org.simpleframework.xml.core.Persister.write(Persister.java:1147) >> 12-29 14:28:04.330: W/System.err(2301): at >> org.simpleframework.xml.core.Persister.write(Persister.java:1266) >> 12-29 14:28:04.330: W/System.err(2301): at >> org.simpleframework.xml.core.Persister.write(Persister.java:1248) >> 12-29 14:28:04.330: W/System.err(2301): at >> org.simpleframework.xml.core.Persister.write(Persister.java:1229) >> 12-29 14:28:04.330: W/System.err(2301): at >> org.simpleframework.xml.core.Persister.write(Persister.java:1208) >> 12-29 14:28:04.330: W/System.err(2301): at >> se.lth.design.troglu.SDcardMethods.xmlToFile(SDcardMethods.java:90) >> 12-29 14:28:04.330: W/System.err(2301): at >> se.lth.design.troglu.TestdataActivity$1.onClick(TestdataActivity.java:56) >> 12-29 14:28:04.330: W/System.err(2301): at >> android.view.View.performClick(View.java:3122) >> 12-29 14:28:04.330: W/System.err(2301): at >> android.view.View$PerformClick.run(View.java:11942) >> 12-29 14:28:04.330: W/System.err(2301): at >> android.os.Handler.handleCallback(Handler.java:587) >> 12-29 14:28:04.330: W/System.err(2301): at >> android.os.Handler.dispatchMessage(Handler.java:92) >> 12-29 14:28:04.330: W/System.err(2301): at >> android.os.Looper.loop(Looper.java:132) >> 12-29 14:28:04.330: W/System.err(2301): at >> android.app.ActivityThread.main(ActivityThread.java:4028) >> 12-29 14:28:04.330: W/System.err(2301): at >> java.lang.reflect.Method.invokeNative(Native Method) >> 12-29 14:28:04.330: W/System.err(2301): at >> java.lang.reflect.Method.invoke(Method.java:491) >> 12-29 14:28:04.330: W/System.err(2301): at >> com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:844) >> 12-29 14:28:04.330: W/System.err(2301): at >> com.android.internal.os.ZygoteInit.main(ZygoteInit.java:602) >> 12-29 14:28:04.330: W/System.err(2301): at >> dalvik.system.NativeStart.main(Native Method) >> >> -- >> Använder Operas banbrytande e-postklient: http://www.opera.com/mail/ >> >> ------------------------------------------------------------------------------ >> Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a >> complex >> infrastructure or vast IT resources to deliver seamless, secure access >> to >> virtual desktops. With this all-in-one solution, easily deploy virtual >> desktops for less than the cost of PCs and save 60% on VDI >> infrastructure >> costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox >> _______________________________________________ >> Simple-support mailing list >> Sim...@li... >> https://lists.sourceforge.net/lists/listinfo/simple-support -- Använder Operas banbrytande e-postklient: http://www.opera.com/mail/ |
|
From: Fia S. <fi...@sc...> - 2011-12-29 19:38:52
|
Hi, Trying to use Simple but it will not write to my file. How will I get it to find javax.xml.stream.XMLInputFactory.* ? thanks /fia 12-29 14:28:04.290: D/TROG(2301): xmlToFile q 2131296285 12-29 14:28:04.320: I/dalvikvm(2301): Could not find method javax.xml.stream.XMLInputFactory.newInstance, referenced from method org.simpleframework.xml.stream.StreamProvider.<init> 12-29 14:28:04.320: W/dalvikvm(2301): VFY: unable to resolve static method 1744: Ljavax/xml/stream/XMLInputFactory;.newInstance ()Ljavax/xml/stream/XMLInputFactory; 12-29 14:28:04.320: D/dalvikvm(2301): VFY: replacing opcode 0x71 at 0x0003 12-29 14:28:04.320: W/dalvikvm(2301): VFY: unable to find class referenced in signature (Ljavax/xml/stream/XMLEventReader;) 12-29 14:28:04.320: W/dalvikvm(2301): VFY: unable to find class referenced in signature (Ljavax/xml/stream/XMLEventReader;) 12-29 14:28:04.320: I/dalvikvm(2301): Could not find method javax.xml.stream.XMLInputFactory.createXMLEventReader, referenced from method org.simpleframework.xml.stream.StreamProvider.provide 12-29 14:28:04.320: W/dalvikvm(2301): VFY: unable to resolve virtual method 1741: Ljavax/xml/stream/XMLInputFactory;.createXMLEventReader (Ljava/io/InputStream;)Ljavax/xml/stream/XMLEventReader; 12-29 14:28:04.320: D/dalvikvm(2301): VFY: replacing opcode 0x6e at 0x0002 12-29 14:28:04.320: I/dalvikvm(2301): Could not find method javax.xml.stream.XMLInputFactory.createXMLEventReader, referenced from method org.simpleframework.xml.stream.StreamProvider.provide 12-29 14:28:04.320: W/dalvikvm(2301): VFY: unable to resolve virtual method 1742: Ljavax/xml/stream/XMLInputFactory;.createXMLEventReader (Ljava/io/Reader;)Ljavax/xml/stream/XMLEventReader; 12-29 14:28:04.320: D/dalvikvm(2301): VFY: replacing opcode 0x6e at 0x0002 12-29 14:28:04.320: D/TROG(2301): skrev inte 12-29 14:28:04.320: W/System.err(2301): org.simpleframework.xml.core.ConstructorException: Can not construct inner class se.lth.design.troglu.TestdataActivity$UserData 12-29 14:28:04.330: W/System.err(2301): at org.simpleframework.xml.core.ConstructorScanner.scan(ConstructorScanner.java:108) 12-29 14:28:04.330: W/System.err(2301): at org.simpleframework.xml.core.ConstructorScanner.<init>(ConstructorScanner.java:81) 12-29 14:28:04.330: W/System.err(2301): at org.simpleframework.xml.core.ClassScanner.<init>(ClassScanner.java:112) 12-29 14:28:04.330: W/System.err(2301): at org.simpleframework.xml.core.Scanner.<init>(Scanner.java:88) 12-29 14:28:04.330: W/System.err(2301): at org.simpleframework.xml.core.ScannerFactory.getInstance(ScannerFactory.java:66) 12-29 14:28:04.330: W/System.err(2301): at org.simpleframework.xml.core.Support.getScanner(Support.java:170) 12-29 14:28:04.330: W/System.err(2301): at org.simpleframework.xml.core.Support.getName(Support.java:232) 12-29 14:28:04.330: W/System.err(2301): at org.simpleframework.xml.core.Source.getName(Source.java:250) 12-29 14:28:04.330: W/System.err(2301): at org.simpleframework.xml.core.Traverser.getName(Traverser.java:284) 12-29 14:28:04.330: W/System.err(2301): at org.simpleframework.xml.core.Traverser.write(Traverser.java:203) 12-29 14:28:04.330: W/System.err(2301): at org.simpleframework.xml.core.Traverser.write(Traverser.java:186) 12-29 14:28:04.330: W/System.err(2301): at org.simpleframework.xml.core.Persister.write(Persister.java:1187) 12-29 14:28:04.330: W/System.err(2301): at org.simpleframework.xml.core.Persister.write(Persister.java:1169) 12-29 14:28:04.330: W/System.err(2301): at org.simpleframework.xml.core.Persister.write(Persister.java:1147) 12-29 14:28:04.330: W/System.err(2301): at org.simpleframework.xml.core.Persister.write(Persister.java:1266) 12-29 14:28:04.330: W/System.err(2301): at org.simpleframework.xml.core.Persister.write(Persister.java:1248) 12-29 14:28:04.330: W/System.err(2301): at org.simpleframework.xml.core.Persister.write(Persister.java:1229) 12-29 14:28:04.330: W/System.err(2301): at org.simpleframework.xml.core.Persister.write(Persister.java:1208) 12-29 14:28:04.330: W/System.err(2301): at se.lth.design.troglu.SDcardMethods.xmlToFile(SDcardMethods.java:90) 12-29 14:28:04.330: W/System.err(2301): at se.lth.design.troglu.TestdataActivity$1.onClick(TestdataActivity.java:56) 12-29 14:28:04.330: W/System.err(2301): at android.view.View.performClick(View.java:3122) 12-29 14:28:04.330: W/System.err(2301): at android.view.View$PerformClick.run(View.java:11942) 12-29 14:28:04.330: W/System.err(2301): at android.os.Handler.handleCallback(Handler.java:587) 12-29 14:28:04.330: W/System.err(2301): at android.os.Handler.dispatchMessage(Handler.java:92) 12-29 14:28:04.330: W/System.err(2301): at android.os.Looper.loop(Looper.java:132) 12-29 14:28:04.330: W/System.err(2301): at android.app.ActivityThread.main(ActivityThread.java:4028) 12-29 14:28:04.330: W/System.err(2301): at java.lang.reflect.Method.invokeNative(Native Method) 12-29 14:28:04.330: W/System.err(2301): at java.lang.reflect.Method.invoke(Method.java:491) 12-29 14:28:04.330: W/System.err(2301): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:844) 12-29 14:28:04.330: W/System.err(2301): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:602) 12-29 14:28:04.330: W/System.err(2301): at dalvik.system.NativeStart.main(Native Method) -- Använder Operas banbrytande e-postklient: http://www.opera.com/mail/ |
|
From: Leonardo S. <som...@gm...> - 2011-12-20 17:57:14
|
Hello Carlos, I don't know if i understood completely, you need to serialize only certain attributes from Class2, is that right? if yes, you need the annotation to make the atribute transparent to simplexml: http://simple.sourceforge.net/download/stream/doc/tutorial/tutorial.php#default see the @Transient annotation, maybe it is what you need. Em Ter, 2011-12-20 às 16:23 +0100, car...@en... escreveu: > Hi all, > > I'm new with simplexml and I would like to ask how I can do one thing. > > I have a class with an array of classes > > class CLASS1 { > <CLASS2> ArrayList array; > ... > > I want to serialize CLASS1, just use some elements of CLASS2, but > when serialize CLASS2, save all elements, since the function of the > array is simply to keep a basic structure of CLASS2. > > I tried to do with the Converter, but I have problems with the array. > Any idea to do it? > > PD:Sorry for my level oh english > > Thank you very much > |
|
From: <car...@en...> - 2011-12-20 15:52:24
|
Hi all,
I'm new with simplexml and I would like to ask how I can do one thing.
I have a class with an array of classes
class CLASS1 {
<CLASS2> ArrayList array;
...
I want to serialize CLASS1, just use some elements of CLASS2, but
when serialize CLASS2, save all elements, since the function of the
array is simply to keep a basic structure of CLASS2.
I tried to do with the Converter, but I have problems with the array.
Any idea to do it?
PD:Sorry for my level oh english
Thank you very much
--
Carlos Jiménez
ENCOPIM S.L.
C/. del Parc 5 (nau 13), P.I. Els Pinetons
E-08291 RIPOLLET (Barcelona)
Tel: (+34) 935 94 23 47
Fax: (+34) 935 94 64 15
==========================================================
La información contenida en la presente transmisión es confidencial y su
uso únicamente está permitido a su(s) destinatario(s). Si Ud. no es la
persona destinataria de la presente transmisión, rogamos nos lo
comunique de manera inmediata por teléfono (+34 935 942 347) y destruya
cualquier copia de la misma (tanto digitales como en papel).
The information contained in this transmission is confidential and is
intended only for the use of the addressee(s). If you are not the
designated recipient of this transmission, please advise us immediately
by telephone (+34 935 942 347) and destroy any copies (digital and
paper).
==========================================================
|
|
From: -=}\\*/{=- <rui...@gm...> - 2011-12-19 00:40:40
|
solved the problem llike this...
not as i expected but nice...
xml in/output...
<handler>
<Downloader ignoresExplicit="true"
package="abc.kis.handler"/>
<KISRemote package="abc.kis.simple"/>
</handler>
// list declaration...
@Element(name = "handler", required = false) // required is true!!!
private Handler.List handlers;
public interface Handler {
// the base class for all handlers...
public static abstract class Base implements Handler {
@Attribute
private String getPackage() {
return this.getClass().getPackage().getName();
}
@Attribute
private void setPackage(String pack) {
}
}
// Array<Handler> replacement to that it is detected by the converter...
public static class List extends ArrayList<Handler> {
// ... its only member, the converter...
public static class Converter extends SimpleConverter<List> {
public static Registry bind(Registry r) {
return bind(r, List.class, Converter.class);
}
@Override
public List read(InputNode in) throws Exception {
List alh = new List();
for (InputNode next = in.getNext(); next != null; next =
in.getNext())
alh.add((Handler)KeepItSimple.CAMEL_CASE_PERSISTER.read(
Class.forName(next.getAttribute("package").getValue().concat(".").
concat(next.getName())), next));
return alh;
}
@Override
public void write(OutputNode on, List alh) throws Exception {
for (Handler h: alh)
KeepItSimple.CAMEL_CASE_PERSISTER.write(h, on);
}
}
}
|
|
From: Leonardo S. <som...@gm...> - 2011-12-16 02:57:30
|
hello everyone, i'm using simplexml with android and it works quite well, but i have a small question: the service side uses JAXB to render the xml sent to me over rest rpc and JAXB takes my Date field and transforms it in something like this: <c> <data>2011-12-15T11:49:18.888-03:00</data> </c> further reading show that format is in reality the DateTime data type: http://www.w3schools.com/schema/schema_dtypes_date.asp so, is there any way to make my Persister understads and generates it? Thanks in advance. |
|
From: -=}\\*/{=- <rui...@gm...> - 2011-12-15 23:31:01
|
i'm trying to read and write an interface using a Converter that uses the
element name as the simple class name and an attribute "package" for the
package name, and then
it works fine when reading, but not when writing,...
at first i had no "type" in the annotation and was not working but thought
that by adding it would solve it... wrong me.
since the handler is the interface for other people to implement, i would
like to have this style working for class resolving (i know there is the
default "class" attribute, but i rather avoid repeating tags and
attributes), but so that the other people only have to declare annotations
and not have to write some kind of converter.
bellow is code... cheers,
rui
annotation...
@ElementList(name = "handler", type = Handler.class, required = false)
private ArrayList<Handler> handlers;
input xml... WORKS fine :)
<handler>
<Downloader package="abc.kis.handler"/>
<KISRemote package="abc.kis.simple"/>
</handler>
output xml... hoops...
<handler>
<handler class="abc.kis.handler.Downloader"/>
<handler class="abc.kis.simple.KISRemote"/>
</handler>
converter...
@Override
public Handler read(InputNode in) throws Exception {
return (Handler)Class.forName(
in.getAttribute("package").getValue().concat(".").concat(in.getName())).
newInstance();
}
@Override
public void write(OutputNode on, Handler h) throws Exception {
KeepItSimple.PERSISTER.write(h, on);
on.setName(h.getClass().getSimpleName());
on.setAttribute("package", h.getClass().getPackage().getName());
on.commit();
}
example extending class...
@Root
public class KISRemote implements Handler {
@Override
public boolean accepts(Quest quest) {
return quest.getPathInfo().startsWith(Server.class.getName(), 1);
}
@Override
public boolean handle(Quest quest, Sponse sponse) {
String path = quest.getPathInfo().substring(
1 + Server.class.getName().length() +1);
if ("stop".equals(path))
System.err.println("GET THE SERVER HERE AND THIS MESSAGE OUT");
else return false;
return true;
}
}
|
|
From: Alex K. <kra...@gm...> - 2011-12-15 21:53:08
|
Thanks, I'll check. On Dec 15, 2011 4:01 PM, "Niall Gallagher" <gal...@ya...> wrote: > > Do you mean prolog? if so check out the format object. > > Sent from Yahoo!7 Mail on Android > > ------------------------------ > * From: * Alex Kravets <kra...@gm...>; > * To: * <sim...@li...>; > * Subject: * [Simple-support] XML declaration is missing > * Sent: * Wed, Dec 14, 2011 9:52:40 PM > > Hello, > > Using Simple XML is really a pleasure, thanks for great work! > > When I serialize java object the resulting XML does not have declaration. > What am I doing wrong? > > Thanks, > Alex > |
|
From: Niall G. <gal...@ya...> - 2011-12-15 21:01:18
|
Do you mean prolog? if so check out the format object. Sent from Yahoo!7 Mail on Android |
|
From: Alex K. <kra...@gm...> - 2011-12-14 21:53:08
|
Hello, Using Simple XML is really a pleasure, thanks for great work! When I serialize java object the resulting XML does not have declaration. What am I doing wrong? Thanks, Alex |
|
From: -=}\\*/{=- <rui...@gm...> - 2011-12-13 19:32:37
|
for now i'm going with JavaBean workaround...
private Pattern match;
@Attribute
public String getMatch() {return match.pattern();}
@Attribute
public void setMatch(String re) {match = Pattern.compile(re);}
... but this makes me write it every time.
On 13 December 2011 00:36, -=}\*/{=- <rui...@gm...> wrote:
> Exception in thread "main"
> org.simpleframework.xml.core.AttributeException: Cannot use
> @org.simpleframework.xml.Attribute(name=, empty=, required=true) to
> represent field 'match' java.util.regex.Pattern abc.kis.Url.match
> at
> org.simpleframework.xml.core.AttributeLabel.getConverter(AttributeLabel.java:110)
> at
> org.simpleframework.xml.core.CacheLabel.getConverter(CacheLabel.java:312)
> at
> org.simpleframework.xml.core.Composite.readVariable(Composite.java:666)
> at org.simpleframework.xml.core.Composite.readInstance(Composite.java:635)
>
>
> class Url {
> @Attribute
> Pattern match;
>
> @Attribute
> String target;
> }
>
> <url match=".*/" target="index.html"/>
>
> i'm using a RegistryStrategy with a PatternConverter that works fine with
> @Element...
>
> <url target="index.html">
> <match>.*/</match>
> </url>
>
> ... but that match belongs to an attribute not an element...
> i though of converting the Url class instead... or make a pattern wrapper,
> but rather get the pattern working as an @Attribute, since i'll need it
> several times and seams more correct.
>
>
>
> the converter below:
>
> public class PatternConverter extends SimpleConverter<Pattern> {
>
> public static Registry bind(Registry r) {
> return bind(r, Pattern.class, PatternConverter.class);
> }
>
> @Override
> public Pattern read(InputNode in) throws Exception {
> return Pattern.compile(in.getValue());
> }
>
> @Override
> public void write(OutputNode on, Pattern p) {
> on.setValue(p.toString());
> }
>
> }
>
>
|
|
From: -=}\\*/{=- <rui...@gm...> - 2011-12-13 01:15:35
|
sry, not exactly @Convert but similar with RegistryStrategy... |
|
From: -=}\\*/{=- <rui...@gm...> - 2011-12-13 00:37:10
|
Exception in thread "main" org.simpleframework.xml.core.AttributeException:
Cannot use @org.simpleframework.xml.Attribute(name=, empty=, required=true)
to represent field 'match' java.util.regex.Pattern abc.kis.Url.match
at
org.simpleframework.xml.core.AttributeLabel.getConverter(AttributeLabel.java:110)
at org.simpleframework.xml.core.CacheLabel.getConverter(CacheLabel.java:312)
at org.simpleframework.xml.core.Composite.readVariable(Composite.java:666)
at org.simpleframework.xml.core.Composite.readInstance(Composite.java:635)
class Url {
@Attribute
Pattern match;
@Attribute
String target;
}
<url match=".*/" target="index.html"/>
i'm using a RegistryStrategy with a PatternConverter that works fine with
@Element...
<url target="index.html">
<match>.*/</match>
</url>
... but that match belongs to an attribute not an element...
i though of converting the Url class instead... or make a pattern wrapper,
but rather get the pattern working as an @Attribute, since i'll need it
several times and seams more correct.
the converter below:
public class PatternConverter extends SimpleConverter<Pattern> {
public static Registry bind(Registry r) {
return bind(r, Pattern.class, PatternConverter.class);
}
@Override
public Pattern read(InputNode in) throws Exception {
return Pattern.compile(in.getValue());
}
@Override
public void write(OutputNode on, Pattern p) {
on.setValue(p.toString());
}
}
|
|
From: Niall G. <gal...@ya...> - 2011-12-12 10:54:59
|
Annotations will not accept anything other than compile time constants. Object will not work Sent from Yahoo!7 Mail on Android |
|
From: Niall G. <gal...@ya...> - 2011-12-12 10:53:33
|
This is already supported, @Attribute can be used as an array. Also see @Convert. Sent from Yahoo!7 Mail on Android |
|
From: -=}\\*/{=- <rui...@gm...> - 2011-12-12 02:23:38
|
something like... @AttributeList (separator = ":", required = 0) // same as false List<String> classPath; @AttributeArray (separator = ", ", empty="80, 443", required = 2) // required can have 2 uses int[] ports; [] r. |
|
From: -=}\\*/{=- <rui...@gm...> - 2011-12-12 01:10:47
|
my suggestion is that empty accepts an Object instead of String... makes
sense to me :)
tried with Integer but got similar error but with different stack trace...
@Attribute (empty = "0", required = false)
Integer multipartLimit = 0;
Exception in thread "main" java.lang.IllegalArgumentException: Can not set
java.lang.Integer field abc.kis.Context.multipartLimit to java.lang.String
at
sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:164)
at
sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:168)
at
sun.reflect.UnsafeObjectFieldAccessorImpl.set(UnsafeObjectFieldAccessorImpl.java:81)
at java.lang.reflect.Field.set(Field.java:675)
at org.simpleframework.xml.core.FieldContact.set(FieldContact.java:212)
at org.simpleframework.xml.core.Collector.commit(Collector.java:169)
at org.simpleframework.xml.core.Composite.readDefault(Composite.java:263)
at org.simpleframework.xml.core.Composite.read(Composite.java:232)
On 12 December 2011 00:54, -=}\*/{=- <rui...@gm...> wrote:
> @Attribute (empty = "1", required = false)
> int debugLevel = -1;
>
> gives the following error:
>
> Exception in thread "main" java.lang.IllegalArgumentException: Can not set
> int field abc.kis.Context.debugLevel to java.lang.String
> at
> sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:164)
> at
> sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:168)
> at
> sun.reflect.UnsafeIntegerFieldAccessorImpl.set(UnsafeIntegerFieldAccessorImpl.java:98)
> at java.lang.reflect.Field.set(Field.java:675)
> at org.simpleframework.xml.core.FieldContact.set(FieldContact.java:212)
> at org.simpleframework.xml.core.Collector.commit(Collector.java:169)
> at org.simpleframework.xml.core.Composite.readDefault(Composite.java:263)
> at org.simpleframework.xml.core.Composite.read(Composite.java:232)
>
> ....
>
> also tried with positive number.
>
|
|
From: -=}\\*/{=- <rui...@gm...> - 2011-12-12 00:55:04
|
@Attribute (empty = "1", required = false) int debugLevel = -1; gives the following error: Exception in thread "main" java.lang.IllegalArgumentException: Can not set int field abc.kis.Context.debugLevel to java.lang.String at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:164) at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:168) at sun.reflect.UnsafeIntegerFieldAccessorImpl.set(UnsafeIntegerFieldAccessorImpl.java:98) at java.lang.reflect.Field.set(Field.java:675) at org.simpleframework.xml.core.FieldContact.set(FieldContact.java:212) at org.simpleframework.xml.core.Collector.commit(Collector.java:169) at org.simpleframework.xml.core.Composite.readDefault(Composite.java:263) at org.simpleframework.xml.core.Composite.read(Composite.java:232) .... also tried with positive number. |
|
From: Niall G. <gal...@ya...> - 2011-12-10 23:19:36
|
Yes just use a visitor and remove all class attributes for each node visited. Sent from Yahoo!7 Mail on Android |
|
From: Juha M. <juh...@ko...> - 2011-12-10 17:35:01
|
Hi Wondering would it be possible to suppress automatic xml element "typing" when serializing objects into XML (i.e. have xml elements without class attribute). I am using Scala traits which translates to anonymous classes likely overriding default behavior. Best, Juha |
|
From: bubbleguuum <bub...@fr...> - 2011-12-02 09:06:55
|
On 02/12/2011 09:29, Niall Gallagher wrote: > > First time you parse something the class schemas are created. So its > slower, next time round its much faster. Slow annotations are the > union annotations. > > Sent from Yahoo!7 Mail on Android > > Thanks for your response Niall. I'm asking because another app parsing identical XML than my app does the parsing 3x faster. I believe it uses the XML pull parser directly and cuts corners with namespace processing (this particular XML is namespace heavy). |