How to return a long property as JSON string value with JAXB
===

**Hello World!**

I have a Java class annotated with **@XmlRootElement**. This Java class has a long property (**private long id**) that I want to return to a JavaScript-client.

I create the JSON as follows:

    MyEntity myInstance = new MyEntity("Benny Neugebauer", 2517564202727464120);
    StringWriter writer = new StringWriter();
    JSONConfiguration config = JSONConfiguration.natural().build();
    Class[] types = {MyEntity.class};
    JSONJAXBContext context = new JSONJAXBContext(config, types);
    JSONMarshaller marshaller = context.createJSONMarshaller();
    marshaller.marshallToJSON(myInstance, writer);
    json = writer.toString();
    System.out.println(writer.toString());

This will be generated:

    {"name":"Benny Neugebauer","id":2517564202727464120}

But the problem is that the long value is too large for the JavaScript client. Therefore, I would like to return this value as a string (without making the long a string in Java).

Is there an annotation (or something similar) that can generate the following?

    {"name":"Benny Neugebauer","id":"2517564202727464120"}