Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Type | Name and description |
---|---|
static String |
prettyPrint(String jsonPayload) Pretty print a JSON payload. |
static String |
toJson(Boolean bool) @return "true" or "false" for a boolean value |
static String |
toJson(Number n) @return a string representation for a number |
static String |
toJson(Character c) @return a JSON string representation of the character |
static String |
toJson(String s) @return a properly encoded string with escape sequences |
static String |
toJson(Date date) Format a date that is parseable from JavaScript, according to ISO-8601. |
static String |
toJson(Calendar cal) Format a calendar instance that is parseable from JavaScript, according to ISO-8601. |
static String |
toJson(UUID uuid) @return the string representation of an uuid |
static String |
toJson(URL url) @return the string representation of the URL |
static String |
toJson(Closure closure) @return an object representation of a closure |
static String |
toJson(Expando expando) @return an object representation of an Expando |
static String |
toJson(Object object) @return "null" for a null value, or a JSON array representation for a collection, array, iterator or enumeration, or representation for other object. |
static String |
toJson(Map m) @return a JSON object representation for a map |
Pretty print a JSON payload.
Format a date that is parseable from JavaScript, according to ISO-8601.
date
- the date to format to a JSON stringFormat a calendar instance that is parseable from JavaScript, according to ISO-8601.
cal
- the calendar to format to a JSON string