Package org.daisy.dotify.api.formatter
Class FormatterConfiguration.Builder
- java.lang.Object
-
- org.daisy.dotify.api.formatter.FormatterConfiguration.Builder
-
- Enclosing class:
- FormatterConfiguration
public static class FormatterConfiguration.Builder extends Object
Provides a builder for formatter configuration.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FormatterConfiguration.Builder
allowsEndingPageOnHyphen(boolean value)
Sets the hyphenation policy for the last line (of the main flow) in each page.FormatterConfiguration.Builder
allowsEndingVolumeOnHyphen(boolean value)
Sets the hyphenation policy for the last line (of the main flow) in each volume.FormatterConfiguration.Builder
allowsTextOverflowTrimming(boolean value)
Sets the text overflow trimming policy.FormatterConfiguration
build()
Creates new configuration.FormatterConfiguration.Builder
hyphenate(boolean value)
Sets the global hyphenation policy.FormatterConfiguration.Builder
ignoreStyle(String style)
Adds a style to ignore.FormatterConfiguration.Builder
markCapitalLetters(boolean value)
Sets the global capital letter policy.
-
-
-
Method Detail
-
allowsTextOverflowTrimming
public FormatterConfiguration.Builder allowsTextOverflowTrimming(boolean value)
Sets the text overflow trimming policy. If the value is true, text that overflows its boundaries may be truncated if needed. If the value is false, an error should be thrown and the process aborted (default).- Parameters:
value
- the value of the text overflow trimming policy- Returns:
- returns this builder
-
allowsEndingPageOnHyphen
public FormatterConfiguration.Builder allowsEndingPageOnHyphen(boolean value)
Sets the hyphenation policy for the last line (of the main flow) in each page.- Parameters:
value
- true if the last line may be hyphenated, false otherwise.- Returns:
- returns this builder
-
allowsEndingVolumeOnHyphen
public FormatterConfiguration.Builder allowsEndingVolumeOnHyphen(boolean value)
Sets the hyphenation policy for the last line (of the main flow) in each volume. If theFormatterConfiguration.allowsEndingPageOnHyphen()
setting isfalse
, it overrides this setting.- Parameters:
value
- true if the last line may be hyphenated, false otherwise.- Returns:
- returns this builder
-
hyphenate
public FormatterConfiguration.Builder hyphenate(boolean value)
Sets the global hyphenation policy.- Parameters:
value
- the value of the global hyphenation policy- Returns:
- returns this builder
-
markCapitalLetters
public FormatterConfiguration.Builder markCapitalLetters(boolean value)
Sets the global capital letter policy.- Parameters:
value
- the value of the capital letters policy- Returns:
- returns this builder
-
ignoreStyle
public FormatterConfiguration.Builder ignoreStyle(String style)
Adds a style to ignore.- Parameters:
style
- a style to ignore- Returns:
- returns this builder
-
build
public FormatterConfiguration build()
Creates new configuration.- Returns:
- returns a new configuration instance
-
-