Class JSONReader
- java.lang.Object
-
- org.springframework.extensions.webscripts.json.JSONReader
-
- All Implemented Interfaces:
FormatReader<java.lang.Object>
public class JSONReader extends java.lang.Object implements FormatReader<java.lang.Object>
Convert application/json to org.json.JSONObject or org.json.JSONArray- Author:
- Roy Wetherall
-
-
Constructor Summary
Constructors Constructor Description JSONReader()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Map<java.lang.String,java.lang.Object>createScriptParameters(WebScriptRequest req, WebScriptResponse res)Create script parameters specific to source mimetypejava.lang.Class<? extends java.lang.Object>getDestinationClass()Gets the Java Class to convert tojava.lang.StringgetSourceMimetype()Gets the source mimetype to convert fromjava.lang.Objectread(WebScriptRequest req)Converts mimetype to Java Object
-
-
-
Method Detail
-
getDestinationClass
public java.lang.Class<? extends java.lang.Object> getDestinationClass()
Description copied from interface:FormatReaderGets the Java Class to convert to- Specified by:
getDestinationClassin interfaceFormatReader<java.lang.Object>- Returns:
- Java Clas
- See Also:
FormatReader.getDestinationClass()
-
getSourceMimetype
public java.lang.String getSourceMimetype()
Description copied from interface:FormatReaderGets the source mimetype to convert from- Specified by:
getSourceMimetypein interfaceFormatReader<java.lang.Object>- Returns:
- mimetype
- See Also:
FormatReader.getSourceMimetype()
-
read
public java.lang.Object read(WebScriptRequest req)
Description copied from interface:FormatReaderConverts mimetype to Java Object- Specified by:
readin interfaceFormatReader<java.lang.Object>- Parameters:
req- web script request- Returns:
- Java Object
- See Also:
FormatReader.read(org.springframework.extensions.webscripts.WebScriptRequest)
-
createScriptParameters
public java.util.Map<java.lang.String,java.lang.Object> createScriptParameters(WebScriptRequest req, WebScriptResponse res)
Description copied from interface:FormatReaderCreate script parameters specific to source mimetype- Specified by:
createScriptParametersin interfaceFormatReader<java.lang.Object>- Parameters:
req- web script requestres- web script response- Returns:
- map of script objects indexed by name
- See Also:
FormatReader.createScriptParameters(org.springframework.extensions.webscripts.WebScriptRequest, org.springframework.extensions.webscripts.WebScriptResponse)
-
-