NotesJSONNavigator (LotusScript)

LotusScript class used to parse JSON data.

Containment

Contained by NotesSession.

Properties

PreferUTF8

Methods

GetElementByName

GetElementByPointer

GetFirstElement

GetNextElement

GetNthElement

Stringify

AppendElement

AppendArray

AppendObject

Creation

To create a new NotesJSONNavigator object, use createNotesJSONNavigator.

Available options are no input, string, or NotesStream:

No input:
dim jsNav as NotesJSONNavigator
 set jsonNav = NotesSession.CreateJSONNavigator()
String as input:
dim jsNav as NotesJSONNavigator
set jsonNav = NotesSession.CreateJSONNavigator("")
NotesStream class as input:
dim jsNav as NotesJSONNavigator
set jsonNav = NotesSession.CreateJSONNavigator(NotesStream)
Note: The NotesStream must be opened when creating the navigator and can be closed as soon as the navigator is created. Only UTF8 data is supported.

Syntax

Given a session, the following example creates a NotesJSONNavigator with the provided JSON string:
Dim jsnav As NotesJSONNavigator 
Set jsnav = session.CreateJSONNavigator(|{"test":"A string"}|)
By default, the NotesJSONNavigator represents a JSON object as the root element. To set the type of the root element to a JSON array, create the NotesJSONNavigator as follows:
Dim jsnav as NotesJSONNavigator 
Set jsnav = session.CreateJSONNavigator("[]")