Package org.daisy.braille.embosser
Class ConfigurableEmbosser.Builder
- java.lang.Object
-
- org.daisy.braille.embosser.ConfigurableEmbosser.Builder
-
- Enclosing class:
- ConfigurableEmbosser
public static class ConfigurableEmbosser.Builder extends java.lang.ObjectProvides a builder for ConfigurableEmbosser- Author:
- Joel HÃ¥kansson
-
-
Constructor Summary
Constructors Constructor Description Builder(java.io.OutputStream os, BrailleConverter bt)Creates a new builder with the suppled output stream and braille converter.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ConfigurableEmbosser.BuilderautoLineFeedOnEmptyPage(boolean value)Sets the auto line feed on empty page policy.ConfigurableEmbosser.Builderbreaks(java.lang.String value)Sets the line break styleConfigurableEmbosser.Builderbreaks(LineBreaks value)Sets the line break styleConfigurableEmbosserbuild()Builds a new ConfigurableEmbosser based on this builders current configuration.ConfigurableEmbosser.BuilderembosserProperties(EmbosserWriterProperties props)Sets the embosser properties for this object.ConfigurableEmbosser.BuilderfillSheet(boolean value)Sets the fill sheet policy.ConfigurableEmbosser.Builderfooter(byte[] value)Sets the communication footerConfigurableEmbosser.Builderheader(byte[] value)Sets the communication headerConfigurableEmbosser.BuilderpadNewline(java.lang.String value)Sets the padding styleConfigurableEmbosser.BuilderpadNewline(AbstractEmbosserWriter.Padding value)Sets the padding styleConfigurableEmbosser.Builderpagebreaks(PageBreaks value)Sets the page break style
-
-
-
Constructor Detail
-
Builder
public Builder(java.io.OutputStream os, BrailleConverter bt)Creates a new builder with the suppled output stream and braille converter.- Parameters:
os- the output stream to usebt- the braille converter to use
-
-
Method Detail
-
embosserProperties
public ConfigurableEmbosser.Builder embosserProperties(EmbosserWriterProperties props)
Sets the embosser properties for this object.- Parameters:
props- the embosser properties to use- Returns:
- returns this object
-
breaks
public ConfigurableEmbosser.Builder breaks(java.lang.String value)
Sets the line break style- Parameters:
value- one of dos, unix, mac or default- Returns:
- returns this object
-
breaks
public ConfigurableEmbosser.Builder breaks(LineBreaks value)
Sets the line break style- Parameters:
value- the line break style to use- Returns:
- returns this object
-
pagebreaks
public ConfigurableEmbosser.Builder pagebreaks(PageBreaks value)
Sets the page break style- Parameters:
value- the page break style to use- Returns:
- returns this object
-
padNewline
public ConfigurableEmbosser.Builder padNewline(java.lang.String value)
Sets the padding style- Parameters:
value- a padding style- Returns:
- returns this object
-
padNewline
public ConfigurableEmbosser.Builder padNewline(AbstractEmbosserWriter.Padding value)
Sets the padding style- Parameters:
value- the padding style to use- Returns:
- returns this object
-
header
public ConfigurableEmbosser.Builder header(byte[] value)
Sets the communication header- Parameters:
value- the header to use- Returns:
- returns this object
-
footer
public ConfigurableEmbosser.Builder footer(byte[] value)
Sets the communication footer- Parameters:
value- the footer to use- Returns:
- returns this object
-
fillSheet
public ConfigurableEmbosser.Builder fillSheet(boolean value)
Sets the fill sheet policy. Set to true to fill the last sheet by adding a form feed before closing the communication if the last page has an odd number.- Parameters:
value- the value- Returns:
- returns this object
-
autoLineFeedOnEmptyPage
public ConfigurableEmbosser.Builder autoLineFeedOnEmptyPage(boolean value)
Sets the auto line feed on empty page policy.- Parameters:
value- set to true, to add line feed on empty page, false otherwise.- Returns:
- returns this object
-
build
public ConfigurableEmbosser build()
Builds a new ConfigurableEmbosser based on this builders current configuration.- Returns:
- returns a new ConfigurableEmbosser
-
-