xstream

How can I use JAXB from an unsigned applet (without signing it)?

I would like to marshall Java objects into XML and vice-versa from within an Unsigned Applet and I can't change any of the security permission/policy files, or sign the application. I seem to get a Security exception, because JAXB is attempting to access fields or constructors that it can't in the applet sandbox. The browser is runnin...

Xstream/HTTP service

We run multiple websites which use the same rich functional backend running as a library. The backend is comprised of multiple components with a lot of objects shared between them. Now, we need to separate a stateless rule execution component into a different container for security reasons. It would be great if I could have access to a...

XStream private attributes in Java

How does XStream gets my object values since they are private? import com.thoughtworks.xstream.XStream; class Person { private String name; public Person(String n) { name = n; } } public class Main { public static void main(String[] args) { XStream stream = new XStream(); Person p = new Person...

How to create an alias for a private inner class (using XStream)?

I'm creating aliases for long class names... It works perfectly fine, but one of the serialized classes is a private inner class. I can't think of a way to create an alias for it other than making it public. I don't like this solution, because it should not be public in the first place. But since making an alias for it will make it possi...

How to alias java.lang.Integer using XStream?

Hey, I'm tweaking an XStream output, and I get the following: <entry> <string>ahh</string> <java-class>java.lang.Integer</java-class> </entry> So I try to create an alias for java.lang.Integer.class... Doesn't work. I made aliases for many other classes and it works just fine. I also tried to alias int.cla...

Is there an existing XStream HierarchicalStreamDriver for YAML that is current?

I know there is an old question from 2 years ago about this and I am not satisfied with that old answer. I have searched Google extensively and before I go and start writing my own implementation of an YamlHierarchicalStreamDriver I wanted to make sure I am not missing something that is already out there. So the relevant question is, is ...

Xstream : with Child element

Hi, I would like to serialize an object to an XML with Child Element with XStream. Can anyone help me? Thanks! ...

Restlet XML parsing xstream

Hi, I'm new to restlet and quite confused. A rest server returns the following xml response: <posts user="a" dt="2010-01-21T08:00:00Z" tag=""> <post href="http://www.opensatnav.org/" hash="a" description="OpenSatNav" tag="android osm" time="2010-01-21T20:55:54Z" extended=""/> <post href="http://www.openrouteservice.org/" hash="a"...

using RESTlet, XStream annotations seem to have no effect

Using @XStreamOmitField in my POJO seems to have no effect whatsoever. the annotated field still gets exposed in the xml or json representation. @XStreamAlias("Pojo") @Entity public class Pojo { private String name; @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Long key; @XStreamOmitField priv...

XStream: How do I map xml mixed attributes and elements to POJOs?

This must be a newbie question, but I could not get it from http://xstream.codehaus.org. Well, I have the following xml string <cat age="4" > <name>Garfield</name> </cat> which needs to be mapped to: class Cat { int age; String name; } Is there a simple way to do that using XStream? If not, what else could I try? Thanks in...

How can I tweek Xstream to handle XML to Java objects that include attributes and values?

For example, how would form an object from XML written like this? <name length="4">Ryan</name> I would normally alias a class using an annotation to "name" and then have a length and a field for the name. However, this will not work because the second field has no name. *Edit confusing wording ...

XStream JavaBeanConverter not serializing properties

Hello All, Attempting to use XStream's JavaBeanConverter and running into an issue. Most likely I'm missng something simple, or not understanding XStream's converter handling well enough. @XStreamAlias("test") public class TestObject { private String foo; public String getFoo() { //return foo; -- Adjusted for EDIT#...

custom converter in XStream

Hi All, I am using XStream to serialize my Objects to XML format. The formatted xml that I get is as below: node1, node2, node 3 are attributes of pojo,DetailDollars DetailDollars node1 100 /node1 node2 25 /node2 node3 10 /node3 /DetailDollars I have requirement where...

XStream <-> Alternative binary formats (e.g. protocol buffers)

We currently use XStream for encoding our web service inputs/outputs in XML. However we are considering switching to a binary format with code generator for multiple languages (protobuf, Thrift, Hessian, etc) to make supporting new clients easier and less reliant on hand-coding (also to better support our message formats which include bi...

XStream parse attributes and values at the same time

Hi, I have the following XML <search ver="3.0"> <loc id="ARBA0009" type="1">Buenos Aires, Argentina</loc> <loc id="BRXX1283" type="1">Buenos Aires, Brazil</loc> <loc id="ARDF0127" type="1">Aeroparque Buenos Aires, Argentina</loc> <loc id="MXJO0669" type="1">Concepcion De Buenos Aires, Mexico</loc> <loc id="MXPA1785" ...

How do I use xStream to output Java Objects with List properties?

Hello, I am trying to output some Java objects as JSON, they have List properties which I want to be formatted as { "People" : [ { "Name" : "Bob" } , { "Name" : "Jim" } ] } However, I cannot figure out how to do this with XStream. It always outputs as { "Person" : { "Name" : "Bob" }, "Person" : { "Name" : "Bob" } Is there a way to fi...

Problem with XStream Marshalling to return xml and json

When i use new XStream().toXml(someObject); it returns following xml... <response> <status>SUCCESS</status> <isOwnershipVerified class="boolean">false</isOwnershipVerified> </response> and, when i use new XStream(new JsonHierarchicalStreamDriver()).toXml(someObject); it returns following json... {"response": { ...

Is it possible to use XStream with an abstract node?

My client application is making calls to a service that returns a common "root" XML, but a different result node. The "root" XML contains possible error codes. Is it possible to use XStream in this scenario? Example: public class RootNode { ErrorInfo errorInfo; BaseResult result; ... } public class ErrorInfo { String ...

Base64 en/decoding between xstream and iPhone SDK

I am passing a byte array from a java server to an iPad client in XML. The server is using xstream to convert the byte array to XML with the EncodedByteArrayConverter, which should convert the array to Base 64. Using xstream, I can decode the xml back to the proper byte array in a java client, but in the iPad client, I'm getting an inv...

Make XStream ignore one specific private variable

Hi guys, I have a little problem with a class I am currently writing a save function for. I'm using XStream (com.thoughtworks.xstream) to serialize a class to XML using the DOMDriver. The class looks like this: public class World { private Configuration config; public World(Configuration config) { this.config = config; } } ...