Class ObjectFormatter


  • public class ObjectFormatter
    extends JSONFormatter
    Simpler version of JSONFormatter that doesn't add any extra information, except in case of error.
    Author:
    alex
    • Constructor Detail

      • ObjectFormatter

        public ObjectFormatter()
    • 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 class JSONFormatter
        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 class JSONFormatter
        Parameters:
        errorMessage - The message reporting the problem encountered in processing this request, or null if there was none
        errorCode - The status code for the request (200 on success)
        Returns:
        The formatted footer string.
        See Also:
        org.intermine.webservice.server.output.Formatter#formatFooter()