LoadOptions

Inheritance: java.lang.Object

public class LoadOptions

Provides the options which are used to open a file.

An instance of this class is used as parameter in Parser class constructors:

See the usage examples there.

Learn more:

Constructors

Constructor Description
LoadOptions(Duration timeout) Initializes a new instance of the LoadOptions class with timeout .
LoadOptions() Initializes a new instance of the LoadOptions class with empty Password , FileFormat equal to FileFormat.Unknown and default encodings.
LoadOptions(String password) Initializes a new instance of the LoadOptions class with FileFormat equal to FileFormat.Unknown and default encodings.
LoadOptions(FileFormat fileFormat) Initializes a new instance of the LoadOptions class with empty Password and default encodings.
LoadOptions(FileFormat fileFormat, String password) Initializes a new instance of the LoadOptions class with default encodings.
LoadOptions(FileFormat fileFormat, String password, Charset charset, Charset defaultAnsiCharset) Initializes a new instance of the LoadOptions class with custom encodings.
LoadOptions(FileFormat fileFormat, String password, Charset charset, Charset defaultAnsiCharset, Duration timeout) Initializes a new instance of the LoadOptions fully customized class.

Methods

Method Description
getFileFormat() Gets the file format.
getPassword() Gets the password.
getCharset() Gets the encoding of the document.
getDefaultAnsiCharset() Gets the default ANSI encoding which is used for encoding detection.
getTimeout() Gets the value that represents the number of milliseconds to wait.

LoadOptions(Duration timeout)

public LoadOptions(Duration timeout)

Initializes a new instance of the LoadOptions class with timeout .

Parameters:

Parameter Type Description
timeout java.time.Duration The Duration that represents the number of milliseconds to wait.

LoadOptions()

public LoadOptions()

Initializes a new instance of the LoadOptions class with empty Password , FileFormat equal to FileFormat.Unknown and default encodings.

LoadOptions(String password)

public LoadOptions(String password)

Initializes a new instance of the LoadOptions class with FileFormat equal to FileFormat.Unknown and default encodings.

Parameters:

Parameter Type Description
password java.lang.String The password to open the password-protected file.

LoadOptions(FileFormat fileFormat)

public LoadOptions(FileFormat fileFormat)

Initializes a new instance of the LoadOptions class with empty Password and default encodings.

Parameters:

Parameter Type Description
fileFormat FileFormat The format of the file.

LoadOptions(FileFormat fileFormat, String password)

public LoadOptions(FileFormat fileFormat, String password)

Initializes a new instance of the LoadOptions class with default encodings.

Parameters:

Parameter Type Description
fileFormat FileFormat The format of the file.
password java.lang.String The password to open the password-protected file.

LoadOptions(FileFormat fileFormat, String password, Charset charset, Charset defaultAnsiCharset)

public LoadOptions(FileFormat fileFormat, String password, Charset charset, Charset defaultAnsiCharset)

Initializes a new instance of the LoadOptions class with custom encodings.

Parameters:

Parameter Type Description
fileFormat FileFormat The format of the file.
password java.lang.String The password to open the password-protected file.
charset java.nio.charset.Charset The encoding of the document.
defaultAnsiCharset java.nio.charset.Charset The default ANSI encoding which is used for encoding detection.

LoadOptions(FileFormat fileFormat, String password, Charset charset, Charset defaultAnsiCharset, Duration timeout)

public LoadOptions(FileFormat fileFormat, String password, Charset charset, Charset defaultAnsiCharset, Duration timeout)

Initializes a new instance of the LoadOptions fully customized class.

Parameters:

Parameter Type Description
fileFormat FileFormat The format of the file.
password java.lang.String The password to open the password-protected file.
charset java.nio.charset.Charset The encoding of the document.
defaultAnsiCharset java.nio.charset.Charset The default ANSI encoding which is used for encoding detection.
timeout java.time.Duration The Duration that represents the number of milliseconds to wait.

getFileFormat()

public FileFormat getFileFormat()

Gets the file format.

Returns: FileFormat - FileFormat enumeration that contains a file format.

getPassword()

public String getPassword()

Gets the password.

Returns: java.lang.String - A string value that represents a password to open the password-protected file.

getCharset()

public Charset getCharset()

Gets the encoding of the document.

Returns: java.nio.charset.Charset - An instance of Charset class that represents the document encoding; null if it isn’t set.

getDefaultAnsiCharset()

public Charset getDefaultAnsiCharset()

Gets the default ANSI encoding which is used for encoding detection.

Returns: java.nio.charset.Charset - An instance of Charset class that represents the document encoding; null if it isn’t set.

getTimeout()

public Duration getTimeout()

Gets the value that represents the number of milliseconds to wait.

Returns: java.time.Duration - An instance of Duration that represents the number of milliseconds to wait.