Package org.daisy.dotify.common.text
Class TextFileReader.Builder
- java.lang.Object
-
- org.daisy.dotify.common.text.TextFileReader.Builder
-
- Enclosing class:
- TextFileReader
public static class TextFileReader.Builder extends Object
Provides a builder for a text file reader.
-
-
Constructor Summary
Constructors Constructor Description Builder(InputStream value)
Creates a new builder with the specified input stream.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TextFileReader
build()
Creates a new text file reader with the current configuration.TextFileReader.Builder
charset(Charset value)
Sets the charset for this builder.TextFileReader.Builder
limit(int value)
Sets the maximum number of times that the specified regular expression is matched on a single row.TextFileReader.Builder
regex(String value)
Sets the regular expression of this builder.
-
-
-
Constructor Detail
-
Builder
public Builder(InputStream value)
Creates a new builder with the specified input stream.- Parameters:
value
- the input stream
-
-
Method Detail
-
charset
public TextFileReader.Builder charset(Charset value)
Sets the charset for this builder.- Parameters:
value
- the charset- Returns:
- returns this builder
-
regex
public TextFileReader.Builder regex(String value)
Sets the regular expression of this builder.- Parameters:
value
- the expression to use- Returns:
- returns this builder
- Throws:
PatternSyntaxException
- If the expression's syntax is invalid
-
limit
public TextFileReader.Builder limit(int value)
Sets the maximum number of times that the specified regular expression is matched on a single row.- Parameters:
value
- the limit- Returns:
- returns this builder
-
build
public TextFileReader build()
Creates a new text file reader with the current configuration.- Returns:
- returns a new text file reader
-
-