Skip to content

JSONPath Tools / @jsonpath-tools/jsonpath / DataType

Class: abstract DataType

Data type. Refines the JSONPath types.

Extended by

Constructors

new DataType()

ts
new DataType(annotations): DataType

Parameters

annotations

ReadonlySet<DataTypeAnnotation>

Returns

DataType

Properties

annotations

ts
readonly annotations: ReadonlySet<DataTypeAnnotation>;

Methods

addAnnotations()

ts
addAnnotations(annotations): DataType

Parameters

annotations

ReadonlySet<DataTypeAnnotation>

Returns

DataType


changeTypeAtPath()

ts
abstract changeTypeAtPath(path, operation): DataType

Parameters

path

NormalizedPath

operation

(currentType) => DataType

Returns

DataType


coerceMultiline()

ts
protected coerceMultiline(strings, multiline): boolean

Parameters

strings

string[]

multiline

boolean

Returns

boolean


collectAnnotations()

ts
collectAnnotations(): Set<DataTypeAnnotation>

Returns

Set<DataTypeAnnotation>


collectAnnotationsToSet()

ts
collectAnnotationsToSet(annotations): void

Parameters

annotations

Set<DataTypeAnnotation>

Returns

void


collectKnownLiterals()

ts
collectKnownLiterals(): Set<null | string | number | boolean>

Returns

Set<null | string | number | boolean>


collectKnownLiteralsToSet()

ts
abstract collectKnownLiteralsToSet(literals): void

Parameters

literals

Set<null | string | number | boolean>

Returns

void


collectKnownPathSegments()

ts
collectKnownPathSegments(): Set<NormalizedPathSegment>

Returns

Set<NormalizedPathSegment>


collectKnownPathSegmentsToSet()

ts
abstract collectKnownPathSegmentsToSet(pathSegments): void

Parameters

pathSegments

Set<NormalizedPathSegment>

Returns

void


createIndentationString()

ts
protected createIndentationString(level): string

Parameters

level

number

Returns

string


getChildrenType()

ts
abstract getChildrenType(): DataType

Returns

DataType


getDescendantType()

ts
abstract getDescendantType(): DataType

Returns

DataType


getTypeAtPath()

ts
getTypeAtPath(path): DataType

Parameters

path

NormalizedPath

Returns

DataType


getTypeAtPathSegment()

ts
abstract getTypeAtPathSegment(segment): DataType

Parameters

segment

NormalizedPathSegment

Returns

DataType


setPathExistence()

ts
abstract setPathExistence(path): DataType

Parameters

path

NormalizedPath

Returns

DataType


toString()

ts
toString(simplified, multiline): string

Parameters

simplified

boolean = false

multiline

boolean = false

Returns

string


toStringInternal()

ts
abstract toStringInternal(
   simplified, 
   multiline, 
   level): string

Parameters

simplified

boolean

multiline

boolean

level

number

Returns

string


withAnnotations()

ts
abstract withAnnotations(annotations): DataType

Parameters

annotations

ReadonlySet<DataTypeAnnotation>

Returns

DataType