value

Functions to pass java-types in JSON, typically usage is to type e.g a Geo-point value when creating nodes in node-lib.

Example
var valueLib = require('/lib/xp/value');

Methods

(static) binary(name, stream) → {*}

Creates a BinaryAttachment java-type.

Parameters:
Name Type Description
name string

The binary name

stream

The binary stream

Returns:

BinaryAttachment java-type

Type
*

(static) geoPoint(lat, lon) → {*}

Creates a GeoPoint java-type.

Parameters:
Name Type Description
lat number

Latitude

lon number

Longitude

Returns:

GeoPoint java-type

Type
*

(static) geoPointString(value) → {*}

Creates a GeoPoint java-type.

Parameters:
Name Type Description
value string

comma-separated lat and lon

Returns:

GeoPoint java-type

Type
*

(static) instant(value) → {*}

Creates a Instant java-type.

Parameters:
Name Type Description
value string | Date

An ISO-8601-formatted instant (e.g '2011-12-03T10:15:30Z'), or a Date object.

Returns:

Instant java-type

Type
*

(static) localDate(value) → {*}

Creates a LocalDate java-type.

Parameters:
Name Type Description
value string | Date

A ISO local date-time string (e.g '2011-12-03'), or a Date object.

Returns:

LocalDate java-type

Type
*

(static) localDateTime(value) → {*}

Creates a LocalDateTime java-type.

Parameters:
Name Type Description
value string | Date

A local date-time string (e.g '2007-12-03T10:15:30'), or a Date object.

Returns:

LocalDateTime java-type

Type
*

(static) localTime(value) → {*}

Creates a LocalTime java-type.

Parameters:
Name Type Description
value string | Date

A ISO local date-time string (e.g '10:15:30'), or a Date object.

Returns:

LocalTime java-type

Type
*

(static) reference(value) → {*}

Creates a Reference java-type.

Parameters:
Name Type Description
value string

A nodeId as string (e.g '1234-5678-91011')

Returns:

Reference java-type

Type
*