AnalyzeDocumentOptions Class

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

Implements

public final class AnalyzeDocumentOptions
implements JsonSerializable<AnalyzeDocumentOptions>

Document analysis parameters.

Constructor Summary

Constructor Description
AnalyzeDocumentOptions(byte[] bytesSource)

Creates an instance of AnalyzeDocumentOptions with the specified bytes of the document.

AnalyzeDocumentOptions(BinaryData binaryData)

Creates an instance of AnalyzeDocumentOptions with the specified BinaryData source.

AnalyzeDocumentOptions(String urlSource)

Creates an instance of AnalyzeDocumentOptions with the specified URL source.

Method Summary

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

Reads an instance of AnalyzeDocumentOptions from the JsonReader.

byte[] getBytesSource()

Get the bytesSource property: Base64 encoding of the document to analyze.

List<DocumentAnalysisFeature> getDocumentAnalysisFeatures()

Get the list of optional analysis features.

String getLocale()

Get the locale hint for text recognition and document analysis.

List<AnalyzeOutputFormat> getOutput()

Gets the list of output formats.

DocumentContentFormat getOutputContentFormat()

Gets the output content format.

List<String> getPages()

Get the custom page numbers for multipage documents(PDF/TIFF).

List<String> getQueryFields()

Gets the list of additional fields to include in the result.

StringIndexType getStringIndexType()

Gets the string index type.

String getUrlSource()

Get the urlSource property: Document URL to analyze.

AnalyzeDocumentOptions setDocumentAnalysisFeatures(DocumentAnalysisFeature[] documentAnalysisFeatures)

Set optional analysis features.

AnalyzeDocumentOptions setDocumentAnalysisFeatures(List<DocumentAnalysisFeature> documentAnalysisFeatures)

Set the list of optional analysis features.

AnalyzeDocumentOptions setLocale(String locale)

Set the locale value.

AnalyzeDocumentOptions setOutput(List<AnalyzeOutputFormat> output)

Sets the list of output formats.

AnalyzeDocumentOptions setOutputContentFormat(DocumentContentFormat outputContentFormat)

Sets the output content format.

AnalyzeDocumentOptions setPages(List<String> pages)

Set the custom page numbers for multipage documents(PDF/TIFF).

AnalyzeDocumentOptions setQueryFields(List<String> queryFields)

Sets the list of additional fields to include in the result.

AnalyzeDocumentOptions setStringIndexType(StringIndexType stringIndexType)

Sets the string index type.

JsonWriter toJson(JsonWriter jsonWriter)

Methods inherited from java.lang.Object

Constructor Details

AnalyzeDocumentOptions

public AnalyzeDocumentOptions(byte[] bytesSource)

Creates an instance of AnalyzeDocumentOptions with the specified bytes of the document.

Parameters:

bytesSource - the bytes of the document to analyze.

AnalyzeDocumentOptions

public AnalyzeDocumentOptions(BinaryData binaryData)

Creates an instance of AnalyzeDocumentOptions with the specified BinaryData source.

Parameters:

binaryData - the document to analyze.

AnalyzeDocumentOptions

public AnalyzeDocumentOptions(String urlSource)

Creates an instance of AnalyzeDocumentOptions with the specified URL source.

Parameters:

urlSource - the URL of the document to analyze.

Method Details

fromJson

public static AnalyzeDocumentOptions fromJson(JsonReader jsonReader)

Reads an instance of AnalyzeDocumentOptions from the JsonReader.

Parameters:

jsonReader - The JsonReader being read.

Returns:

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

Throws:

IOException

- If an error occurs while reading the AnalyzeDocumentOptions.

getBytesSource

public byte[] getBytesSource()

Get the bytesSource property: Base64 encoding of the document to analyze. Either urlSource or base64Source must be specified.

Returns:

the bytesSource value.

getDocumentAnalysisFeatures

public List<DocumentAnalysisFeature> getDocumentAnalysisFeatures()

Get the list of optional analysis features.

Returns:

List of optional analysis features.

getLocale

public String getLocale()

Get the locale hint for text recognition and document analysis. Value may contain only the language code (ex. \"en\", \"fr\") or BCP 47 language tag (ex. \"en-US\").

Returns:

the locale value.

getOutput

public List<AnalyzeOutputFormat> getOutput()

Gets the list of output formats.

Returns:

the list of output formats.

getOutputContentFormat

public DocumentContentFormat getOutputContentFormat()

Gets the output content format.

Returns:

the output content format.

getPages

public List<String> getPages()

Get the custom page numbers for multipage documents(PDF/TIFF). Input the number of the pages you want to get the recognized result for.

For a range of pages, use a hyphen, ex - ["1-3"]. Separate each page or a page range with a comma, ex - ["1-3", 4].

Returns:

the list of custom page numbers for a multipage document.

getQueryFields

public List<String> getQueryFields()

Gets the list of additional fields to include in the result.

Returns:

the list of additional fields to include in the result.

getStringIndexType

public StringIndexType getStringIndexType()

Gets the string index type.

Returns:

the string index type.

getUrlSource

public String getUrlSource()

Get the urlSource property: Document URL to analyze. Either urlSource or base64Source must be specified.

Returns:

the urlSource value.

setDocumentAnalysisFeatures

public AnalyzeDocumentOptions setDocumentAnalysisFeatures(DocumentAnalysisFeature[] documentAnalysisFeatures)

Set optional analysis features.

Parameters:

documentAnalysisFeatures - List of optional analysis features.

Returns:

the updated AnalyzeDocumentOptions value.

setDocumentAnalysisFeatures

public AnalyzeDocumentOptions setDocumentAnalysisFeatures(List<DocumentAnalysisFeature> documentAnalysisFeatures)

Set the list of optional analysis features.

Parameters:

documentAnalysisFeatures - List of optional analysis features.

Returns:

the updated AnalyzeDocumentOptions value.

setLocale

public AnalyzeDocumentOptions setLocale(String locale)

Set the locale value. Supported locales include: en-AU, en-CA, en-GB, en-IN, en-US.

Parameters:

locale - the locale value to set.

Returns:

the updated AnalyzeDocumentOptions value.

setOutput

public AnalyzeDocumentOptions setOutput(List<AnalyzeOutputFormat> output)

Sets the list of output formats.

Parameters:

output - the list of output formats to set.

Returns:

the updated AnalyzeDocumentOptions value.

setOutputContentFormat

public AnalyzeDocumentOptions setOutputContentFormat(DocumentContentFormat outputContentFormat)

Sets the output content format.

Parameters:

outputContentFormat - the output content format to set.

Returns:

the updated AnalyzeDocumentOptions value.

setPages

public AnalyzeDocumentOptions setPages(List<String> pages)

Set the custom page numbers for multipage documents(PDF/TIFF). Input the number of the pages you want to get the recognized result for.

For a range of pages, use a hyphen, ex - ["1-3"]. Separate each page or a page range with a comma, ex - ["1-3", 4].

Parameters:

pages - the custom page numbers value to set.

Returns:

the updated AnalyzeDocumentOptions value.

setQueryFields

public AnalyzeDocumentOptions setQueryFields(List<String> queryFields)

Sets the list of additional fields to include in the result.

Parameters:

queryFields - the list of additional fields to include in the result.

Returns:

the updated AnalyzeDocumentOptions value.

setStringIndexType

public AnalyzeDocumentOptions setStringIndexType(StringIndexType stringIndexType)

Sets the string index type.

Parameters:

stringIndexType - the string index type to set.

Returns:

the updated AnalyzeDocumentOptions value.

toJson

public JsonWriter toJson(JsonWriter jsonWriter)

Parameters:

jsonWriter

Throws:

Applies to