Package org.apache.tapestry5.json
Class JSONLiteral
- java.lang.Object
-
- org.apache.tapestry5.json.JSONLiteral
-
- All Implemented Interfaces:
Serializable
,JSONString
public class JSONLiteral extends Object implements JSONString, Serializable
A way of including some text (often, text that violates the normal JSON specification) as part of a JSON object or array. This is used in a few places where data is nominally JSON but actually includes some non-conformant elements, such as an inline function definition.- Since:
- 5.1.0.2
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description JSONLiteral(String text)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
toJSONString()
ThetoJSONString
method allows a class to produce its own JSON serialization.String
toString()
Returns the text property; this is also the value placed into the JSON string (unquoted, exactly as is).
-
-
-
Constructor Detail
-
JSONLiteral
public JSONLiteral(String text)
-
-
Method Detail
-
toString
public String toString()
Returns the text property; this is also the value placed into the JSON string (unquoted, exactly as is).
-
toJSONString
public String toJSONString()
Description copied from interface:JSONString
ThetoJSONString
method allows a class to produce its own JSON serialization.- Specified by:
toJSONString
in interfaceJSONString
- Returns:
- A strictly syntactically correct JSON text.
-
-