| Constructor and Description |
|---|
ManBindingsExt() |
| Modifier and Type | Method and Description |
|---|---|
static Bindings |
getJsonContent(Bindings thiz,
String url)
|
static Bindings |
getYamlContent(Bindings thiz,
String url)
|
static String |
listToJson(List list)
Serializes a JSON-compatible List into a JSON formatted StringBuilder with the specified indent of spaces.
|
static void |
listToJson(StringBuilder target,
int indent,
List value)
|
static String |
makeArguments(Bindings arguments)
Convert this Json
Bindings to an arguments String suitable for a JSON-compatible URL. |
static URL |
makeUrl(Bindings thiz,
String url)
Make a JSON-compatible URL with the arguments from this
Bindings. |
static String |
makeValue(Object value)
Convert
value to a String suitable for a JSON URL argument. |
static Bindings |
postForJsonContent(Bindings thiz,
String url)
Use HTTP POST to pass JSON bindings to
this URL and get the full response as a JSON object.
|
static Bindings |
postForYamlContent(Bindings thiz,
String url)
Use HTTP POST to pass JSON bindings to
this URL and get the full response as a YAML object.
|
static String |
toJson(Bindings thiz)
Serializes this
Bindings instance to a JSON formatted String |
static void |
toJson(Bindings thiz,
StringBuilder target,
int margin)
Serializes this
Bindings instance into a JSON formatted StringBuilder target
with the specified indent of spaces. |
static String |
toXml(Bindings thiz)
Serializes this
Bindings instance to XML nested in a root element named "object" |
static String |
toXml(Bindings thiz,
String name)
Serializes this
Bindings instance to XML with in a root element with the specified name |
static void |
toXml(Bindings thiz,
String name,
StringBuilder target,
int indent)
Serializes this
Bindings instance into an XML formatted StringBuilder target
with the specified indent of spaces. |
static String |
toYaml(Bindings thiz)
Serializes this
Bindings instance to a YAML formatted String |
static void |
toYaml(Bindings thiz,
StringBuilder target)
Serializes this
Bindings instance into a YAML 1.2 formatted StringBuilder target
with the specified indent of spaces. |
public static String toJson(Bindings thiz)
Bindings instance to a JSON formatted StringBindings instance serialized to a JSON formatted Stringpublic static String toYaml(Bindings thiz)
Bindings instance to a YAML formatted StringBindings instance serialized to a YAML formatted Stringpublic static void toJson(Bindings thiz, StringBuilder target, int margin)
Bindings instance into a JSON formatted StringBuilder target
with the specified indent of spaces.target - A StringBuilder to write the JSON inmargin - The margin of spaces to indent the resulting block of JSONpublic static void toYaml(Bindings thiz, StringBuilder target)
Bindings instance into a YAML 1.2 formatted StringBuilder target
with the specified indent of spaces.target - A StringBuilder to write the YAML inpublic static void listToJson(StringBuilder target, int indent, List value)
List composed of JSON values, where a JSON value is one of:
target - A StringBuilder to write the JSON inindent - The margin of spaces to indent the JSONvalue - A List composed of JSON values to serializepublic static String listToJson(List list)
listToJson(StringBuilder, int, List) with no indentation and returns a String.public static String toXml(Bindings thiz)
Bindings instance to XML nested in a root element named "object"public static String toXml(Bindings thiz, String name)
Bindings instance to XML with in a root element with the specified namename - The name of the root element to nest the Bindings XMLtoXml(Bindings, String, StringBuilder, int)public static void toXml(Bindings thiz, String name, StringBuilder target, int indent)
Bindings instance into an XML formatted StringBuilder target
with the specified indent of spaces.name - The name of the root element to nest the Bindings XMLtarget - A StringBuilder to write the XML inindent - The margin of spaces to indent the XMLpublic static Bindings postForJsonContent(Bindings thiz, String url)
ManUrlExt.postForTextContent(URL, Bindings)public static Bindings postForYamlContent(Bindings thiz, String url)
ManUrlExt.postForTextContent(URL, Bindings)public static Bindings getJsonContent(Bindings thiz, String url)
url using this Bindings as JSON-formatted arguments.
Encodes the arguments in UTF-8 and appends them to the list using standard HTTP GET format.
This Bindings instance must be composed of property names mapped to JSON values. A JSON value is one of:
Bindings of property names to JSON values List composed of JSON values Bindings or a List, it is transformed to JSON. Otherwise, the argument is
coerced to a String and URL encoded.RuntimeException results.postForJsonContent(Bindings, String),
Json.fromJson(String)public static Bindings getYamlContent(Bindings thiz, String url)
url using this Bindings as YAML-formatted arguments.
Encodes the arguments in UTF-8 and appends them to the list using standard HTTP GET format.
This Bindings instance must be composed of property names mapped to YAML values. A YAML value is one of:
Bindings of property names to YAML values List composed of YAML values Bindings or a List, it is transformed to YAML. Otherwise, the argument is
coerced to a String and URL encoded.RuntimeException results.postForYamlContent(Bindings, String),
Yaml.fromYaml(String)public static String makeArguments(Bindings arguments)
Bindings to an arguments String suitable for a JSON-compatible URL.Copyright © 2019. All rights reserved.