Skip to content

JSONPath Tools / @jsonpath-tools/jsonpath / ArrayDataType

Class: ArrayDataType ​

Data type for JSON arrays. Contains all JSON arrays that meet criteria from prefixElementTypes, restElementType and requiredElementCount.

Extends ​

Properties ​

annotations ​

ts
readonly annotations: ReadonlySet<DataTypeAnnotation>;

Inherited from ​

DataType.annotations


prefixElementTypes ​

ts
readonly prefixElementTypes: readonly DataType[];

requiredElementCount ​

ts
readonly requiredElementCount: number;

restElementType ​

ts
readonly restElementType: DataType;

Methods ​

addAnnotations() ​

ts
addAnnotations(annotations): DataType;

Parameters ​

annotations ​

ReadonlySet<DataTypeAnnotation>

Returns ​

DataType

Inherited from ​

DataType.addAnnotations


changeTypeAtPath() ​

ts
changeTypeAtPath(path, operation): DataType;

Parameters ​

path ​

NormalizedPath

operation ​

(currentType) => DataType

Returns ​

DataType

Overrides ​

DataType.changeTypeAtPath


coerceMultiline() ​

ts
protected coerceMultiline(strings, multiline): boolean;

Parameters ​

strings ​

string[]

multiline ​

boolean

Returns ​

boolean

Inherited from ​

DataType.coerceMultiline


collectAnnotations() ​

ts
collectAnnotations(): Set<DataTypeAnnotation>;

Returns ​

Set<DataTypeAnnotation>

Inherited from ​

DataType.collectAnnotations


collectAnnotationsToSet() ​

ts
collectAnnotationsToSet(annotations): void;

Parameters ​

annotations ​

Set<DataTypeAnnotation>

Returns ​

void

Inherited from ​

DataType.collectAnnotationsToSet


collectKnownLiterals() ​

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

Returns ​

Set<string | number | boolean | null>

Inherited from ​

DataType.collectKnownLiterals


collectKnownLiteralsToSet() ​

ts
collectKnownLiteralsToSet(literals): void;

Parameters ​

literals ​

Set<string | number | boolean | null>

Returns ​

void

Overrides ​

DataType.collectKnownLiteralsToSet


collectKnownPathSegments() ​

ts
collectKnownPathSegments(): Set<NormalizedPathSegment>;

Returns ​

Set<NormalizedPathSegment>

Inherited from ​

DataType.collectKnownPathSegments


collectKnownPathSegmentsToSet() ​

ts
collectKnownPathSegmentsToSet(pathSegments): void;

Parameters ​

pathSegments ​

Set<NormalizedPathSegment>

Returns ​

void

Overrides ​

DataType.collectKnownPathSegmentsToSet


createIndentationString() ​

ts
protected createIndentationString(level): string;

Parameters ​

level ​

number

Returns ​

string

Inherited from ​

DataType.createIndentationString


getChildrenType() ​

ts
getChildrenType(): DataType;

Returns ​

DataType

Overrides ​

DataType.getChildrenType


getDescendantType() ​

ts
getDescendantType(): DataType;

Returns ​

DataType

Overrides ​

DataType.getDescendantType


getTypeAtPath() ​

ts
getTypeAtPath(path): DataType;

Parameters ​

path ​

NormalizedPath

Returns ​

DataType

Inherited from ​

DataType.getTypeAtPath


getTypeAtPathSegment() ​

ts
getTypeAtPathSegment(segment): DataType;

Parameters ​

segment ​

NormalizedPathSegment

Returns ​

DataType

Overrides ​

DataType.getTypeAtPathSegment


setPathExistence() ​

ts
setPathExistence(path): DataType;

Parameters ​

path ​

NormalizedPath

Returns ​

DataType

Overrides ​

DataType.setPathExistence


toString() ​

ts
toString(simplified?, multiline?): string;

Parameters ​

simplified? ​

boolean = false

multiline? ​

boolean = false

Returns ​

string

Inherited from ​

DataType.toString


toStringInternal() ​

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

Parameters ​

simplified ​

boolean

multiline ​

boolean

level ​

number

Returns ​

string

Overrides ​

DataType.toStringInternal


withAnnotations() ​

ts
withAnnotations(annotations): DataType;

Parameters ​

annotations ​

ReadonlySet<DataTypeAnnotation>

Returns ​

DataType

Overrides ​

DataType.withAnnotations


create() ​

ts
static create(
   prefixElementTypes, 
   restElementType, 
   requiredElementCount, 
   annotations?): NeverDataType | ArrayDataType;

Parameters ​

prefixElementTypes ​

readonly DataType[]

restElementType ​

DataType

requiredElementCount ​

number

annotations? ​

ReadonlySet<DataTypeAnnotation> = DataTypeAnnotation.EMPTY_SET

Returns ​

NeverDataType | ArrayDataType