Class ObjectFormatter
- java.lang.Object
-
- org.intermine.webservice.server.output.Formatter
-
- org.intermine.webservice.server.output.JSONFormatter
-
- org.intermine.webservice.server.jbrowse.util.ObjectFormatter
-
public class ObjectFormatter extends JSONFormatter
Simpler version of JSONFormatter that doesn't add any extra information, except in case of error.- Author:
- alex
-
-
Field Summary
-
Fields inherited from class org.intermine.webservice.server.output.JSONFormatter
KEY_CALLBACK, KEY_HEADER_OBJS, KEY_INTRO, KEY_KV_PAIRS, KEY_OUTRO, KEY_QUOTE, KEY_TIME, RESERVED_KEYS
-
-
Constructor Summary
Constructors Constructor Description ObjectFormatter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
formatFooter(java.lang.String errorMessage, int errorCode)
Put on the final brace, and close the call-back bracket if needed.java.lang.String
formatHeader(java.util.Map<java.lang.String,java.lang.Object> attributes)
Add the opening brace, and a call-back if any-
Methods inherited from class org.intermine.webservice.server.output.JSONFormatter
declarePrinted, formatAttributes, formatResult
-
-
-
-
Method Detail
-
formatHeader
public java.lang.String formatHeader(java.util.Map<java.lang.String,java.lang.Object> attributes)
Description copied from class:JSONFormatter
Add the opening brace, and a call-back if any- Overrides:
formatHeader
in classJSONFormatter
- Parameters:
attributes
- the attributes passed in from the containing output- Returns:
- the header
- See Also:
Formatter.formatHeader(java.util.Map)
-
formatFooter
public java.lang.String formatFooter(java.lang.String errorMessage, int errorCode)
Description copied from class:JSONFormatter
Put on the final brace, and close the call-back bracket if needed. If an error has been reported, format that nicely, escaping problematic JavaScript characters appropriately in the message portion.- Overrides:
formatFooter
in classJSONFormatter
- Parameters:
errorMessage
- The message reporting the problem encountered in processing this request, or null if there was noneerrorCode
- The status code for the request (200 on success)- Returns:
- The formatted footer string.
- See Also:
org.intermine.webservice.server.output.Formatter#formatFooter()
-
-