water.api
Class RequestBuilders.ObjectBuilder

java.lang.Object
  extended by water.api.RequestBuilders.Builder
      extended by water.api.RequestBuilders.ObjectBuilder
Direct Known Subclasses:
RequestBuilders.ArrayRowBuilder, RequestBuilders.NoCaptionObjectBuilder, RFView.ConfusionMatrixBuilder, RFView.TreeListBuilder
Enclosing class:
RequestBuilders

public static class RequestBuilders.ObjectBuilder
extends RequestBuilders.Builder

Object builder. By default objects are displayed as a horizontal dl elements with their heading preceding any of the values. Methods for caption, header, footer as well as element building are provided so that the behavior can easily be customized.


Constructor Summary
RequestBuilders.ObjectBuilder()
           
 
Method Summary
 java.lang.String build(RequestBuilders.Response response, com.google.gson.JsonElement element, java.lang.String contextName)
          The original build method.
 java.lang.String build(RequestBuilders.Response response, com.google.gson.JsonObject object, java.lang.String contextName)
          Creates the HTML of the object.
 java.lang.String caption(com.google.gson.JsonObject object, java.lang.String objectName)
          Displays the caption of the object.
 java.lang.String footer(com.google.gson.JsonObject object, java.lang.String objectName)
          Returns the footer of the object.
 java.lang.String header(com.google.gson.JsonObject object, java.lang.String objectName)
          Returns the header of the object.
 
Methods inherited from class water.api.RequestBuilders.Builder
addToContext, defaultBuilder, elementName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RequestBuilders.ObjectBuilder

public RequestBuilders.ObjectBuilder()
Method Detail

caption

public java.lang.String caption(com.google.gson.JsonObject object,
                                java.lang.String objectName)
Displays the caption of the object.


header

public java.lang.String header(com.google.gson.JsonObject object,
                               java.lang.String objectName)
Returns the header of the object. That is any HTML displayed after caption and before any object's contents.


footer

public java.lang.String footer(com.google.gson.JsonObject object,
                               java.lang.String objectName)
Returns the footer of the object. That is any HTML displayed after any object's contents.


build

public java.lang.String build(RequestBuilders.Response response,
                              com.google.gson.JsonObject object,
                              java.lang.String contextName)
Creates the HTML of the object. That is the caption, header, all its contents in order they were added and then the footer. There should be no need to overload this function, rather override the provided hooks above.


build

public java.lang.String build(RequestBuilders.Response response,
                              com.google.gson.JsonElement element,
                              java.lang.String contextName)
The original build method. Calls build with json object, if not an object, displays an alert box with the JSON contents.

Specified by:
build in class RequestBuilders.Builder