Questions tagged [jettison]

Jettison is a collection of Java APIs (like STaX and DOM) which read and write JSON.

Allows the creation of JSON based web services in frameworks like or XML serialization frameworks like .

There are currently two conventions for mapping JSON to XML.

  • BadgerFish which implements the full XML infoset in JSON using various techniques.
  • Mapped convention which allows you to manually map [tag:XML namespaces] to JSON element prefixes.

Jettison was initially developed for usage in XFire and CXF to enable JSON based services, later it also found its place in Java object serialization with XStream

Jettison Home Page

Jettison User Guide

99 questions
1
vote
3 answers

Create and read tree data structure from json string dynamically

I'm trying to develop a dynamic query builder for days. But I'm having a problem with building it. What I'm reviving is a json like this. {"category":"Case…
Ruwantha
  • 2,603
  • 5
  • 30
  • 44
1
vote
1 answer

marshalling java object to JSON adds empty property using JAX-RS

I'm using jax-rs and adding entity for being marshalled in Jetty by JAXRSOutInterceptor, but JSON output is being modified with additional empty property which looks like this: "$": "" The JSONProvider is created and configured as…
mik80
  • 25
  • 2
  • 8
1
vote
1 answer

JAXB: How to exclude specific field from marshaling in runtime?

I'm using JAXB+Jettison to serve multiformat RESTful (schema-less) service. @XmlTransient annotation served good for those properties that I don't want to serialize at all. But that's not enough. How can I exclude specific field from marshaling in…
forker
  • 2,609
  • 4
  • 23
  • 24
1
vote
2 answers

JSON JAXB Object type serialization

I'm trying to serialize JSON via JAXB using CXF. The problem is when the element to transform is a Object type. @XmlElement(name = "Value") protected Object value; the result in JSON format is "Value":{"@xsi.type":"xs:string","$":"LED"}} Any…
fphilip
  • 159
  • 1
  • 8
0
votes
1 answer

What is the email for the Jettison mailing list?

Sounds like a stupid question, doesn't it? But the page on the Jettison project mentions the Codehaus mailing subscription page, which in turn asks for the mailing list name before you can subscribe.
avernet
  • 30,895
  • 44
  • 126
  • 163
0
votes
1 answer

RestEasy Jettison Single Element Array bug

Issue details: RestEasy + Jettison When array has two elements the format is : {"MyArray" : {"Array" : [{"a" : 1, "b" : 2}, {"a" : 3, "b" : 4}]}} but when the array has single element, the format is : {"MyArray" : {"Array" : {"a" : 1, "b" : 2}}}…
0
votes
0 answers

Deserialization fails for Xstream 1.4.20 and Jettisons 1.5.3

I've below code which deserializes my code and returns a HashMap for Jettisons version 1.2. But when I switched the jettisons to 1.5.3 this code breaks with the exception mentioned below. Can someone please help? --main.class package…
nik2811
  • 41
  • 3
0
votes
0 answers

JobServiceImpl Error while deserializing execution context: Cannot construct type using xstream thoughtworks 1.4.20 and jettison 1.5.3

I was using Spring batch 4.2.7 and I'd custom ExecutionContextSerializer class using jettison 1.2 and thoughtworks xstream 1.4.20. Serializable class is as follow. public class XStreamExecutionContextStringSerializer2 implements…
nik2811
  • 41
  • 3
0
votes
1 answer

Map JSON string or JSON array to String in Java object

I have a JSON created by Elixir class which has a field which can be string or array: field :logs, {:array, :string} If anyone doesn't get this it will be like {"logs" : "some log 1"} or { "logs": ["some log 1", "some log 2"] } I have a Java…
veer7
  • 20,074
  • 9
  • 46
  • 74
0
votes
1 answer

How to convert Nested HashMap to Jettison JSONObject

I have to convert a Map> to Codehaus-Jettison JSONObject. I'm aware that using Gson and other libraries have easier ways of achieving this, but its a requirement hat Jettison be used in this case. What I understand from…
Sidharth Ramesh
  • 646
  • 2
  • 6
  • 21
0
votes
1 answer

package org.codehaus.jettison.json does not exist

In my service I want to use JSONObject class to create a JSON object. For that I imported the package org.codehaus.jettison.json and saved it, but when I run the project I get this error: error: package org.codehaus.jettison.json does not exist …
Shini
  • 51
  • 7
0
votes
1 answer

HTTP Error Code 415 - JSON arrays in JAVA

I am trying to produce and send via JAVA a JSON file and when I am trying to add a nested object with an array in order to fit an application's protocol (which is not important to the question) the java program cannot send the file because of an…
Nik Erra
  • 35
  • 6
0
votes
1 answer

Jaxb (json) unmarshall error, how to unmarshall the data without the name of root element

I have a JSON data that do not have a rootElement's name which is as follow: { name: "Anthony", source: "DS" } I do have a java class which is as follow for the…
user658240
  • 1
  • 1
  • 2
0
votes
1 answer

Multidimensional arrays with Jettison

I'm using Jaxb and Jettison (originally with Resteasy) to serialize an object to json. One of my objects that I'm trying to serialize includes a 2 dimensional array. How can I configure Jettison to produce a multidimensional array in json? Here's…
John Ericksen
  • 10,995
  • 4
  • 45
  • 75
0
votes
0 answers

JSONArray with Jettison weird printout

I am using jettison to generate a json in my webservice. I need to create an array and just for test purpose, I am using this little program below: public static void main(String[] args) throws Exception { JSONObject root = new…
Leandro
  • 51
  • 3