public class ItemJsonHelper
extends java.lang.Object
Helper class to convert Items from a Domino document into their value suitable for inclusion in JSON
Modifier and Type | Method and Description |
---|---|
static io.vertx.core.json.JsonArray |
fromList(com.hcl.domino.data.Item item)
Converts TYPE_TEXT_LIST and TYPE_NUMBER_RANGE to a JsonArray
|
static java.lang.String |
fromRichText(com.hcl.domino.DominoClient client,
com.hcl.domino.data.Document doc,
java.lang.String itemName)
Converts a RichText Item into HTML or errors with null when item doesn’t exist or is not RichText
|
static java.lang.Object |
fromTextOrJson(com.hcl.domino.data.Item item)
Converts a TYPE_TEXT item into text or when it looks like JSON into a JSON Object or array
|
static java.lang.String |
fromTime(com.hcl.domino.data.Item item)
Converts item into a ISO date-time string
|
static io.vertx.core.json.JsonArray |
fromTimeRange(com.hcl.domino.data.Item item)
Converts a time range into a Json Array A time range can contain discrete values or ranges again
|
static java.lang.Object |
fromUnknown(com.hcl.domino.data.Item item)
Converts unknown Domino data on a best effort basis
|
static java.lang.Object |
itemDataTypeMapper(java.lang.Object incoming)
Boils down the item data type to those that are supported by JsonObject
|
public static io.vertx.core.json.JsonArray fromList(com.hcl.domino.data.Item item)
Converts TYPE_TEXT_LIST and TYPE_NUMBER_RANGE to a JsonArray
item
- Domino Item to convertpublic static java.lang.String fromRichText(com.hcl.domino.DominoClient client, com.hcl.domino.data.Document doc, java.lang.String itemName)
Converts a RichText Item into HTML or errors with null when item doesn’t exist or is not RichText
client
- Domino client to run the conversiondoc
- Domino document containing the itemitemName
- itemName (conversion doesn’t need item itself)public static java.lang.Object fromTextOrJson(com.hcl.domino.data.Item item)
Converts a TYPE_TEXT item into text or when it looks like JSON into a JSON Object or array
item
- Domino Itempublic static java.lang.String fromTime(com.hcl.domino.data.Item item)
Converts item into a ISO date-time string
item
- Domino item containing datepublic static io.vertx.core.json.JsonArray fromTimeRange(com.hcl.domino.data.Item item)
Converts a time range into a Json Array A time range can contain discrete values or ranges again
item
- TimeRange itempublic static java.lang.Object fromUnknown(com.hcl.domino.data.Item item)
Converts unknown Domino data on a best effort basis
item
- Domino Itempublic static java.lang.Object itemDataTypeMapper(java.lang.Object incoming)
Boils down the item data type to those that are supported by JsonObject
incoming
- original object