Package google.registry.security
Class JsonResponseHelper
java.lang.Object
google.registry.security.JsonResponseHelper
Helper class for JSON API servlets to send response messages.
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
Possible results of an RPC operation. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncreate
(JsonResponseHelper.Status status, String message) Same ascreate(Status, String, Iterable)
but with zero results.Creates a JSON response message securely to the browser client with a parser breaker.create
(JsonResponseHelper.Status status, String message, Map<String, ?> result) Same ascreate(Status, String, Iterable)
but with only one results.createFormFieldError
(String message, String formFieldName) Creates a JSON response message when a submitted form field is invalid.
-
Constructor Details
-
JsonResponseHelper
public JsonResponseHelper()
-
-
Method Details
-
create
public static com.google.common.collect.ImmutableMap<String,Object> create(JsonResponseHelper.Status status, String message, Iterable<? extends Map<String, ?>> results) Creates a JSON response message securely to the browser client with a parser breaker. -
create
public static com.google.common.collect.ImmutableMap<String,Object> create(JsonResponseHelper.Status status, String message) Same ascreate(Status, String, Iterable)
but with zero results. -
create
public static com.google.common.collect.ImmutableMap<String,Object> create(JsonResponseHelper.Status status, String message, Map<String, ?> result) Same ascreate(Status, String, Iterable)
but with only one results. -
createFormFieldError
public static com.google.common.collect.ImmutableMap<String,Object> createFormFieldError(String message, String formFieldName) Creates a JSON response message when a submitted form field is invalid.
-