• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Conversion of non serializable object to XML

 
Ranch Hand
Posts: 643
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How to convert non serialized object in to XML ?
 
Ranch Hand
Posts: 174
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You take all the attributes and place them in a defined DOM tree. But I'm not really sure what you're asking -> TellTheDetails
 
chetan deol
Ranch Hand
Posts: 643
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Spannable object in the android contains all the properties of the text like bold , italic and even more.
I want to store those properties in the file , to read it later.
Spannable is not serializable , even if you type cast it to CharSequence you cant store it.
 
Sheriff
Posts: 22781
131
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
perhaps XStream is an option.
 
chetan deol
Ranch Hand
Posts: 643
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Rob Prime wrote:perhaps XStream is an option.


I have tried XStream too.

Xstream is not able to convert it into the xml file.
 
Peter Taucher
Ranch Hand
Posts: 174
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Spannable is an interface, not a class. I think you want to serialize objects of a class that implement this interface (like SpannableString). So is there any hint on why XStream would not work? Again -> TellTheDetails
 
Rancher
Posts: 1337
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You have asked this question is so many variants by now that one would assume you'd have checked out the Android source code by now.
 
chetan deol
Ranch Hand
Posts: 643
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Peter Taucher wrote:Spannable is an interface, not a class. I think you want to serialize objects of a class that implement this interface (like SpannableString). So is there any hint on why XStream would not work? Again -> TellTheDetails



Yeah Spannable is interface.But even SpannableString or SpannableStringBuilders are also not serializable.
XStream only works when you have the normal text like CharSequence = "abcd"

But if you perform the following operations then it will not work.
Spannable str (Assume there are some text properties in the this string)
CharSequence chr = (CharSequence)str;

xStream.toXML(chr)

But if you do like this it will work
CharSequence chr = "Simple string"
xStream.toXML(chr)
Because it is a normal charsequence without the text formatting properties.

Do you want anymore information , let me know.

 
What? What, what, what? What what tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic