water.api
Class RequestBuilders

java.lang.Object
  extended by water.Iced
      extended by water.api.Constants
          extended by water.api.RequestStatics
              extended by water.api.RequestArguments
                  extended by water.api.RequestQueries
                      extended by water.api.RequestBuilders
All Implemented Interfaces:
java.lang.Cloneable, Freezable
Direct Known Subclasses:
Request

public class RequestBuilders
extends RequestQueries

Builders & response object. It just has a stuff of simple builders that walk through the JSON response and format the stuff into basic html. Understands simplest form of tables, objects and elements. Also defines the response object that contains the response JSON, response state, other response related automatic variables (timing, etc) and the custom builders. TODO work in progress.


Nested Class Summary
static class RequestBuilders.ArrayBuilder
          Builds the HTML for an array.
static class RequestBuilders.ArrayHeaderRowBuilder
           
static class RequestBuilders.ArrayRowBuilder
          A row in the array table.
static class RequestBuilders.ArrayRowElementBuilder
          Default array row element.
static class RequestBuilders.ArrayRowSingleColBuilder
          Array row for primitives.
static class RequestBuilders.BooleanStringBuilder
           
static class RequestBuilders.Builder
          An abstract class to build the HTML page automatically from JSON.
static class RequestBuilders.ElementBuilder
          A basic element builder.
static class RequestBuilders.HideBuilder
           
 class RequestBuilders.KeyCellBuilder
           
static class RequestBuilders.KeyElementBuilder
           
static class RequestBuilders.KeyLinkElementBuilder
           
 class RequestBuilders.KeyMinAvgMaxBuilder
           
static class RequestBuilders.NoCaptionObjectBuilder
           
static class RequestBuilders.ObjectBuilder
          Object builder.
static class RequestBuilders.PaginatedTable
          A table with pagination controls.
static class RequestBuilders.PreFormattedBuilder
           
static class RequestBuilders.Response
          This is a response class for the JSON.
 class RequestBuilders.WarningCellBuilder
           
 
Nested classes/interfaces inherited from class water.api.RequestArguments
RequestArguments.Argument<T>, RequestArguments.Bool, RequestArguments.CaseModeSelect, RequestArguments.CaseSelect, RequestArguments.ClassifyBool, RequestArguments.EnumArgument<T extends java.lang.Enum<T>>, RequestArguments.ExistingFile, RequestArguments.FrameClassVec, RequestArguments.FrameKeyMultiVec, RequestArguments.FrameKeyVec, RequestArguments.H2OCategoryStrata, RequestArguments.H2OCategoryWeights, RequestArguments.H2OExistingKey, RequestArguments.H2OGLMModelKey, RequestArguments.H2OHexKey, RequestArguments.H2OHexKeyCol, RequestArguments.H2OKey, RequestArguments.H2OKey2, RequestArguments.H2OKMeansModelKey, RequestArguments.H2OModelKey<TM extends OldModel,TK extends TypeaheadKeysRequest>, RequestArguments.H2OPCAModelKey, RequestArguments.HexAllColumnSelect, RequestArguments.HexColumnSelect, RequestArguments.HexKeyClassCol, RequestArguments.HexNonClassColumnSelect, RequestArguments.HexNonConstantColumnSelect, RequestArguments.HexPCAColumnSelect, RequestArguments.InputCheckBox, RequestArguments.InputSelect<T>, RequestArguments.InputText<T>, RequestArguments.Int, RequestArguments.LongInt, RequestArguments.MultipleSelect<T>, RequestArguments.MultipleText<T>, RequestArguments.NTree, RequestArguments.NumberSequence, RequestArguments.Real, RequestArguments.Record<T>, RequestArguments.RFModelKey, RequestArguments.RSeq, RequestArguments.Str, RequestArguments.StringList, RequestArguments.TypeaheadInputText<T>
 
Nested classes/interfaces inherited from class water.api.RequestStatics
RequestStatics.RequestType
 
Nested classes/interfaces inherited from class water.api.Constants
Constants.Extensions, Constants.Schemes, Constants.Suffixes
 
Field Summary
static RequestBuilders.Builder ARRAY_BUILDER
          Basic builder for arrays.
static RequestBuilders.Builder ARRAY_HEADER_ROW_BUILDER
          Basic build for shaded array rows.
static RequestBuilders.Builder ARRAY_ROW_BUILDER
          Basic builder for array rows.
static RequestBuilders.Builder ARRAY_ROW_ELEMENT_BUILDER
          Basic builder for elements in array row objects.
static RequestBuilders.Builder ARRAY_ROW_SINGLECOL_BUILDER
          Basic builder for elements in array rows single col.
static RequestBuilders.ElementBuilder ELEMENT_BUILDER
          Basic builder for elements inside objects.
static com.google.gson.Gson GSON_BUILDER
           
static RequestBuilders.Builder OBJECT_BUILDER
          Basic builder for objects.
static java.lang.String ROOT_OBJECT
           
 
Fields inherited from class water.api.RequestQueries
_queryHtml
 
Fields inherited from class water.api.RequestArguments
_arguments
 
Fields inherited from class water.api.Constants
ALPHA, ARGUMENTS, AUC, BASE, BEST_THRESHOLD, BETA_EPS, BIN_LIMIT, BROWSE, BUCKET, BUILT_IN_KEY_JOBS, CANCELLED, CASE, CASE_MODE, CHUNK, CLASS, CLOUD_NAME, CLOUD_SIZE, CLUSTERS, COEFFICIENTS, COLS, COLUMNS_DISPLAY, CONSENSUS, CONTENTS, COUNT, DATA_KEY, DEPTH, DESCRIPTION, DEST_KEY, DTHRESHOLDS, END_TIME, ENUM_DOMAIN_SIZE, ERROR, ESCAPE_NAN, EXCLUSIVE_SPLIT_LIMIT, EXPRESSION, FAILED, FAMILY, FEATURES, FILE, FILES, FILTER, FIRST_CHUNK, FJ_QUEUE_HI, FJ_QUEUE_LO, FJ_THREADS_HI, FJ_THREADS_LO, FREE_DISK, FREE_MEM, HEADER, HEIGHT, HELP, IGNORE, ITEMS, ITERATIVE_CM, JOB, JOB_KEY, JOBS, JSON_H2O, KEY, KEYS, LAMBDA, LAST_CONTACT, LIMIT, LINK, LOCKED, MAX, MAX_DISK, MAX_ITER, MAX_MEM, MAX_ROWS, MEAN, MIN, MODEL_KEY, MODELS, MORE, MTRY, MTRY_NODES, NAME, NEG_X, NO_CM, NODE, NODE_NAME, NODES, NORMALIZE, NUM_COLS, NUM_CPUS, NUM_FAILED, NUM_KEYS, NUM_MISSING_VALUES, NUM_ROWS, NUM_SUCCEEDED, NUM_TREES, OBJECT, OFFSET, OOBEE, PARALLEL, PARSER_TYPE, PATH, PREVIEW, PREVIOUS_MODEL_KEY, PROGRESS, PROGRESS_KEY, PROGRESS_TOTAL, REDIRECT, REDIRECT_ARGS, REPLICATION_FACTOR, REQUEST_TIME, RESPONSE, RHO, ROW, ROW_SIZE, ROWS, RPCS, SAMPLE, SAMPLING_STRATEGY, SCALE, SEED, SENT_ROWS, SEPARATOR, SIZE, SOURCE_KEY, STACK_TRACES, START_TIME, STAT_TYPE, STATUS, STEP, STRATA_SAMPLES, SUCCEEDED, SYSTEM_LOAD, TASK_KEY, TCPS_ACTIVE, TCPS_DUTY, TIME, TOT_MEM, TREE_COUNT, TREE_DEPTH, TREE_LEAVES, TREE_NUM, TREES, TWEEDIE_POWER, TYPE, URL, USE_NON_LOCAL_DATA, VALUE, VALUE_SIZE, VALUE_TYPE, VARIANCE, VERSION, VIEW, WARNINGS, WEIGHT, WEIGHTS, WIDTH, X, XVAL, Y
 
Constructor Summary
RequestBuilders()
           
 
Method Summary
protected  java.lang.String build(RequestBuilders.Response response)
          Builds the HTML for the given response.
protected  java.lang.String buildJSONResponseBox(RequestBuilders.Response response)
           
protected  java.lang.String buildResponseHeader(RequestBuilders.Response response)
           
protected  java.lang.String name()
           
 
Methods inherited from class water.api.RequestQueries
buildQuery, checkArguments, queryArgumentValueSet
 
Methods inherited from class water.api.RequestArguments
arguments, argumentsToJson, frameColumnNameToIndex, vaCategoryNames, vaCategoryNames, vaColumnNameToIndex
 
Methods inherited from class water.api.RequestStatics
checkJsonName, encodeRedirectArgs, JSON2HTML, jsonError, requestName, Str2JSON
 
Methods inherited from class water.Iced
clone, frozenType, init, newInstance, read, toDocField, write, writeJSON, writeJSONFields
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ROOT_OBJECT

public static final java.lang.String ROOT_OBJECT
See Also:
Constant Field Values

GSON_BUILDER

public static final com.google.gson.Gson GSON_BUILDER

OBJECT_BUILDER

public static final RequestBuilders.Builder OBJECT_BUILDER
Basic builder for objects. ()


ARRAY_BUILDER

public static final RequestBuilders.Builder ARRAY_BUILDER
Basic builder for arrays. (table)


ARRAY_ROW_BUILDER

public static final RequestBuilders.Builder ARRAY_ROW_BUILDER
Basic builder for array rows. (tr)


ARRAY_HEADER_ROW_BUILDER

public static final RequestBuilders.Builder ARRAY_HEADER_ROW_BUILDER
Basic build for shaded array rows. (tr class='..')


ELEMENT_BUILDER

public static final RequestBuilders.ElementBuilder ELEMENT_BUILDER
Basic builder for elements inside objects. (dl,dt,dd)


ARRAY_ROW_ELEMENT_BUILDER

public static final RequestBuilders.Builder ARRAY_ROW_ELEMENT_BUILDER
Basic builder for elements in array row objects. (td)


ARRAY_ROW_SINGLECOL_BUILDER

public static final RequestBuilders.Builder ARRAY_ROW_SINGLECOL_BUILDER
Basic builder for elements in array rows single col. (tr & td)

Constructor Detail

RequestBuilders

public RequestBuilders()
Method Detail

build

protected java.lang.String build(RequestBuilders.Response response)
Builds the HTML for the given response. This is the root of the HTML. Should display all what is needed, including the status, timing, etc. Then call the recursive builders for the response's JSON.


name

protected java.lang.String name()

buildJSONResponseBox

protected java.lang.String buildJSONResponseBox(RequestBuilders.Response response)

buildResponseHeader

protected java.lang.String buildResponseHeader(RequestBuilders.Response response)