Class Json.DefaultFactory
java.lang.Object
org.infinispan.commons.dataconversion.internal.Json.DefaultFactory
- All Implemented Interfaces:
- Json.Factory
- Enclosing class:
- Json
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionarray()Construct and return a JSON object.bool(boolean x) Construct and return a JSON boolean.Construct and return a JSON object.nil()Construct and return an object representing JSONnull.Construct and return a JSON number.object()Construct and return a JSON object.Construct and return a JSON string.
- 
Constructor Details- 
DefaultFactorypublic DefaultFactory()
 
- 
- 
Method Details- 
nilDescription copied from interface:Json.FactoryConstruct and return an object representing JSONnull. Implementations are free to cache a return the same instance. The resulting value must returntruefromisNull()andnullfromgetValue().- Specified by:
- nilin interface- Json.Factory
- Returns:
- The representation of a JSON nullvalue.
 
- 
boolDescription copied from interface:Json.FactoryConstruct and return a JSON boolean. The resulting value must returntruefromisBoolean()and the passed in parameter fromgetValue().- Specified by:
- boolin interface- Json.Factory
- Parameters:
- x- The boolean value.
- Returns:
- A JSON with isBoolean() == true. Implementations are free to cache and return the same instance for true and false.
 
- 
stringDescription copied from interface:Json.FactoryConstruct and return a JSON string. The resulting value must returntruefromisString()and the passed in parameter fromgetValue().- Specified by:
- stringin interface- Json.Factory
- Parameters:
- x- The string to wrap as a JSON value.
- Returns:
- A JSON element with the given string as a value.
 
- 
raw- Specified by:
- rawin interface- Json.Factory
 
- 
numberDescription copied from interface:Json.FactoryConstruct and return a JSON number. The resulting value must returntruefromisNumber()and the passed in parameter fromgetValue().- Specified by:
- numberin interface- Json.Factory
- Parameters:
- x- The numeric value.
- Returns:
- Json instance representing that value.
 
- 
arrayDescription copied from interface:Json.FactoryConstruct and return a JSON object. The resulting value must returntruefromisArray()and an implementation ofjava.util.ListfromgetValue().- Specified by:
- arrayin interface- Json.Factory
- Returns:
- An empty JSON array.
 
- 
objectDescription copied from interface:Json.FactoryConstruct and return a JSON object. The resulting value must returntruefromisObject()and an implementation ofjava.util.MapfromgetValue().- Specified by:
- objectin interface- Json.Factory
- Returns:
- An empty JSON object.
 
- 
makeDescription copied from interface:Json.FactoryConstruct and return a JSON object. The resulting value can be of any JSON type. The method is responsible for examining the type of its argument and performing an appropriate mapping to aJsoninstance.- Specified by:
- makein interface- Json.Factory
- Parameters:
- anything- An arbitray Java object from which to construct a- Jsonelement.
- Returns:
- The newly constructed Jsoninstance.
 
 
-