Package org.eclipse.jetty.util.ajax
Class JSON.Literal
- java.lang.Object
-
- org.eclipse.jetty.util.ajax.JSON.Literal
-
- All Implemented Interfaces:
JSON.Generator
- Enclosing class:
- JSON
public static class JSON.Literal extends java.lang.Object implements JSON.Generator
A Literal JSON generator A utility instance ofJSON.Generator
that holds a pre-generated string on JSON text.
-
-
Constructor Summary
Constructors Constructor Description Literal(java.lang.String json)
Construct a literal JSON instance for use byJSON.toString(Object)
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addJSON(java.lang.Appendable buffer)
java.lang.String
toString()
-
-
-
Constructor Detail
-
Literal
public Literal(java.lang.String json)
Construct a literal JSON instance for use byJSON.toString(Object)
. IfLogger.isDebugEnabled()
is true, the JSON will be parsed to check validity- Parameters:
json
- A literal JSON string.
-
-
Method Detail
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
addJSON
public void addJSON(java.lang.Appendable buffer)
- Specified by:
addJSON
in interfaceJSON.Generator
-
-