CodeQL library for JavaScript
Search

Class JsonValue

A JSON-encoded value, which may be a primitive value, an array or an object.

Examples:

null
true
false
42
"a string"
[ 1, 2, 3 ]
{ "value": 0 }

Import path

import javascript

Direct supertypes

Indirect supertypes

Known direct subtypes

Predicates

getAPrimaryQlClass

Gets the primary QL class for the Locatable.

getBooleanValue

If this is a boolean constant, gets its boolean value.

getChild

Gets the ith child value of this value.

getElementValue

If this is an array, gets the value of the ith element.

getIntValue

If this is an integer constant, gets its numeric value.

getJsonFile

Gets the JSON file containing this value.

getLocation

Gets this element’s location.

getParent

Gets the parent value to which this value belongs, if any.

getPropValue

If this is an object, gets the value of property name.

getStringValue

If this is a string constant, gets the value of the string.

isTopLevel

Holds if this JSON value is the top level element in its enclosing file.

toString

Gets a textual representation of this element.

Inherited predicates

getEndLine

Gets the line on which this element ends.

from Locatable
getFile

Gets the file this program element comes from.

from Locatable
getNumLines

Gets the number of lines covered by this element.

from Locatable
getPrimaryQlClasses

Gets a comma-separated list of the names of the primary CodeQL classes to which this element belongs.

from Locatable
getStartLine

Gets the line on which this element starts.

from Locatable