Package org.daisy.braille.utils.pef
Class TextHandler.Builder
- java.lang.Object
- 
- org.daisy.braille.utils.pef.TextHandler.Builder
 
- 
- Enclosing class:
- TextHandler
 
 public static class TextHandler.Builder extends Object Provides a Builder for TextHandler.
- 
- 
Constructor SummaryConstructors Constructor Description Builder(File input, File output, TableCatalogService factory)Create a new TextParser builder.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description TextHandler.Builderauthor(String value)Sets the author for publications created using TextHandlers created with this builder.TextHandlerbuild()Builds a TextParser using the settings of this Builder.TextHandler.BuilderconverterId(String value)Sets the converter identifier to be used when creating a TextHandler.TextHandler.Builderdate(Date value)Sets the date for publications created using TextHandlers created with this builder.TextHandler.Builderduplex(boolean value)Sets the duplex property for publications created using TextHandlers created with this builder.TextHandler.Builderidentifier(String value)Sets the identifier for publications created using TextHandlers created with this builder.TextHandler.Builderlanguage(String value)Sets the language for publications created using TextHandlers created with this builder.TextHandler.Builderoptions(Map<String,String> settings)Sets options from a map.voidparse()Parses the input file with the current settings.TextHandler.Buildertitle(String value)Sets the title for publications created using TextHandlers created with this builder.
 
- 
- 
- 
Constructor Detail- 
Builderpublic Builder(File input, File output, TableCatalogService factory) Create a new TextParser builder.- Parameters:
- input- the input
- output- the output
- factory- the table catalog
 
 
- 
 - 
Method Detail- 
optionspublic TextHandler.Builder options(Map<String,String> settings) Sets options from a map.- Parameters:
- settings- the settings.
- Returns:
- returns this object
- Throws:
- IllegalArgumentException- if a key is unknown or if a value doesn't meet the requirements.
 
 - 
titlepublic TextHandler.Builder title(String value) Sets the title for publications created using TextHandlers created with this builder.- Parameters:
- value- the title
- Returns:
- returns this object
 
 - 
authorpublic TextHandler.Builder author(String value) Sets the author for publications created using TextHandlers created with this builder.- Parameters:
- value- the author
- Returns:
- returns this object
 
 - 
languagepublic TextHandler.Builder language(String value) Sets the language for publications created using TextHandlers created with this builder.- Parameters:
- value- the language
- Returns:
- returns this object
 
 - 
identifierpublic TextHandler.Builder identifier(String value) Sets the identifier for publications created using TextHandlers created with this builder.- Parameters:
- value- the identifier
- Returns:
- returns this object
 
 - 
converterIdpublic TextHandler.Builder converterId(String value) Sets the converter identifier to be used when creating a TextHandler. See TableCatalog for available values. If none is suppled, the builder will attempt to select one based on file input characteristics.- Parameters:
- value- the identifier for the converter
- Returns:
- returns this object
 
 - 
duplexpublic TextHandler.Builder duplex(boolean value) Sets the duplex property for publications created using TextHandlers created with this builder.- Parameters:
- value- the duplex value
- Returns:
- returns this object
 
 - 
datepublic TextHandler.Builder date(Date value) Sets the date for publications created using TextHandlers created with this builder.- Parameters:
- value- the date to use
- Returns:
- returns this object
 
 - 
buildpublic TextHandler build() throws IOException, InputDetectionException Builds a TextParser using the settings of this Builder.- Returns:
- returns a new TextParser
- Throws:
- IOException- if an error occurs
- InputDetectionException- if an error occurs
- UnsupportedEncodingException- if an error occurs
 
 - 
parsepublic void parse() throws InputDetectionException, IOExceptionParses the input file with the current settings.- Throws:
- InputDetectionException- if an error occurs
- IOException- if an error occurs
 
 
- 
 
-