Compartilhar via


DocumentSpan Class

  • java.lang.Object
    • com.azure.ai.documentintelligence.models.DocumentSpan

Implements

public final class DocumentSpan
implements JsonSerializable<DocumentSpan>

Contiguous region of the concatenated content property, specified as an offset and length.

Method Summary

Modifier and Type Method and Description
static DocumentSpan fromJson(JsonReader jsonReader)

Reads an instance of DocumentSpan from the JsonReader.

int getLength()

Get the length property: Number of characters in the content represented by the span.

int getOffset()

Get the offset property: Zero-based index of the content represented by the span.

JsonWriter toJson(JsonWriter jsonWriter)

Methods inherited from java.lang.Object

Method Details

fromJson

public static DocumentSpan fromJson(JsonReader jsonReader)

Reads an instance of DocumentSpan from the JsonReader.

Parameters:

jsonReader - The JsonReader being read.

Returns:

An instance of DocumentSpan if the JsonReader was pointing to an instance of it, or null if it was pointing to JSON null.

Throws:

IOException

- If the deserialized JSON object was missing any required properties.

getLength

public int getLength()

Get the length property: Number of characters in the content represented by the span.

Returns:

the length value.

getOffset

public int getOffset()

Get the offset property: Zero-based index of the content represented by the span.

Returns:

the offset value.

toJson

public JsonWriter toJson(JsonWriter jsonWriter)

Parameters:

jsonWriter

Throws:

Applies to