Class DefaultStatementResult

    • Constructor Detail

      • DefaultStatementResult

        public DefaultStatementResult​(Object oResult)
        Construct a DefaultStatementResult with the specified result value.
        Parameters:
        oResult - the result Object that this DefaultStatementResult contains
      • DefaultStatementResult

        public DefaultStatementResult​(Object oResult,
                                      boolean fShowKeys)
        Construct a DefaultStatementResult with the specified result value.
        Parameters:
        oResult - the result Object that this DefaultStatementResult contains
        fShowKeys - if true and oResult is a Map then the keys of the Map will be printed by the print(java.io.PrintWriter, String) method, if false, no keys will be printed
    • Method Detail

      • getResult

        public Object getResult()
        Description copied from interface: StatementResult
        Return the actual result Object that this StatementResult wraps.
        Specified by:
        getResult in interface StatementResult
        Returns:
        the actual result Object that this StatementResult wraps
      • print

        public void print​(PrintWriter writer,
                          String sTitle)
        Description copied from interface: StatementResult
        Print the result object to the specified PrintWriter.
        Specified by:
        print in interface StatementResult
        Parameters:
        writer - the PrintWriter to print the results to
        sTitle - the title to print before the results
      • printResults

        protected void printResults​(PrintWriter writer,
                                    String sTitle,
                                    Object oResult,
                                    boolean fShowKeys)
        Print the specified result value to the specified PrintWriter.
        Parameters:
        writer - the PrintWriter to print the results to
        sTitle - the optional title to print before the results
        oResult - the result object to print
        fShowKeys - a flag to determine whether to print keys if the result object is a map
      • printObject

        protected void printObject​(PrintWriter writer,
                                   Object oResult,
                                   boolean fPrintNewLine,
                                   boolean fTopObject)
        Print out the given Object on the given PrintWriter.
        Parameters:
        writer - a PrintWriter to print on
        oResult - the object to print
        fPrintNewLine - a flag controlling whether to print a new line
        fTopObject - a flag to tell whether the object is outermost
      • printCommaSeparatedCollection

        protected void printCommaSeparatedCollection​(PrintWriter writer,
                                                     Collection col)
        Print the contents of the given Collection to the specified PrintWriter as a comma separated list.
        Parameters:
        writer - the PrintWriter to print the Collection to
        col - the Collection to print
      • printStringOrObject

        protected void printStringOrObject​(PrintWriter writer,
                                           Object o,
                                           boolean fNewLine)
        If the given Object is a String print it within double quotes around otherwise pass the Object to the printObject(PrintWriter, Object, boolean, boolean) method.
        Parameters:
        writer - a PrintWriter to print on
        o - the object to print
        fNewLine - a flag controlling whether to print a new line
      • printResultsCollection

        protected void printResultsCollection​(PrintWriter writer,
                                              Collection col,
                                              boolean fShowKeys)
        Print the given Collection of Objects on the given PrintWriter.
        Parameters:
        writer - a PrintWriter to print on
        col - the Collection to print
        fShowKeys - true to show keys
      • printResultsMap

        protected void printResultsMap​(PrintWriter writer,
                                       Map map,
                                       boolean fShowKey)
        Print the contents of the specified Map to the specified PrintWriter.
        Parameters:
        writer - a PrintWriter to print on
        map - the Map to print
        fShowKey - a flag controlling whether to print the Maps keys