Interface ObjectParser (1.45.0)

public interface ObjectParser

Parses a data source into the specified data type.

Implementations should normally be thread-safe.

Methods

<T>parseAndClose(InputStream in, Charset charset, Class<T> dataClass)

public abstract T <T>parseAndClose(InputStream in, Charset charset, Class<T> dataClass)

Parses the given input stream into a new instance of the the given data class of key/value pairs and closes the input stream.

Parameters
Name Description
in InputStream

input stream which contains the data to parse

charset Charset

charset which should be used to decode the input stream or null if unknown

dataClass Class<T>

class into which the data is parsed

Returns
Type Description
T
Exceptions
Type Description
IOException

<T>parseAndClose(Reader reader, Class<T> dataClass)

public abstract T <T>parseAndClose(Reader reader, Class<T> dataClass)

Parses the given reader into a new instance of the the given data class of key/value pairs and closes the reader.

Parameters
Name Description
reader Reader

reader which contains the text data to parse

dataClass Class<T>

class into which the data is parsed

Returns
Type Description
T
Exceptions
Type Description
IOException

parseAndClose(InputStream in, Charset charset, Type dataType)

public abstract Object parseAndClose(InputStream in, Charset charset, Type dataType)

Parses the given input stream into a new instance of the the given data type of key/value pairs and closes the input stream.

Parameters
Name Description
in InputStream

input stream which contains the data to parse

charset Charset

charset which should be used to decode the input stream or null if unknown

dataType Type

type into which the data is parsed

Returns
Type Description
Object
Exceptions
Type Description
IOException

parseAndClose(Reader reader, Type dataType)

public abstract Object parseAndClose(Reader reader, Type dataType)

Parses the given reader into a new instance of the the given data type of key/value pairs and closes the reader.

Parameters
Name Description
reader Reader

reader which contains the text data to parse

dataType Type

type into which the data is parsed

Returns
Type Description
Object
Exceptions
Type Description
IOException