Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

added a note on hwo to parse jsonString and about JsonProperty to cus…

…tomize names
  • Loading branch information...
commit 5646b9384a1a4e969c09ba4b4c287f1c6e9efa92 1 parent 6355439
Christian Meier mkristian authored
Showing with 11 additions and 0 deletions.
  1. +11 −0 restygwt-website/src/documentation/restygwt-user-guide.md
11 restygwt-website/src/documentation/restygwt-user-guide.md
View
@@ -237,6 +237,10 @@ Then you use it as follows
// decoding an object to from json
PizzaOrder other = codec.decode(json);
+In case you need to parse the JSON from a String use
+
+ JSONValue json = JSONParser.parseStrict( jsonString );
+
### Customizing the JSON Property Names
If you want to map a field name to a different json property name, you
@@ -247,6 +251,13 @@ can use the `@Json` annotation to configure the desired name. Example:
public String messageId;
}
+or with the jackson annotation
+
+ public class Message {
+ @JSONProperty("message-id")
+ public String messageId;
+ }
+
### Using readonly objects
If you want to declare final fields and initialize an object through its constructor,
Please sign in to comment.
Something went wrong with that request. Please try again.