Class JSONCountFormatter
- java.lang.Object
-
- org.intermine.webservice.server.output.Formatter
-
- org.intermine.webservice.server.output.JSONFormatter
-
- org.intermine.webservice.server.output.JSONCountFormatter
-
public class JSONCountFormatter extends JSONFormatter
A formatter that presents count results as JSON.- Author:
- Alex Kalderimis
-
-
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 JSONCountFormatter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
formatResult(java.util.List<java.lang.String> resultRow)
In normal cases a list with a single JSON string item is expected.-
Methods inherited from class org.intermine.webservice.server.output.JSONFormatter
declarePrinted, formatAttributes, formatFooter, formatHeader
-
-
-
-
Method Detail
-
formatResult
public java.lang.String formatResult(java.util.List<java.lang.String> resultRow)
Description copied from class:JSONFormatter
In normal cases a list with a single JSON string item is expected. But just in case, this formatter will simply join any strings it gets given, delimiting with a comma. It is the responsibility of whoever is feeding me these lines to add any necessary commas between them.- Overrides:
formatResult
in classJSONFormatter
- Parameters:
resultRow
- the row as a list of strings- Returns:
- A formatted result line, or the empty string if the row is empty
- See Also:
Formatter.formatResult(java.util.List)
-
-