Class ConfigurableEmbosser.Builder

java.lang.Object
org.daisy.braille.embosser.ConfigurableEmbosser.Builder
Enclosing class:
ConfigurableEmbosser

public static class ConfigurableEmbosser.Builder extends Object
Provides a builder for ConfigurableEmbosser
Author:
Joel HÃ¥kansson
  • Constructor Details

    • Builder

      public Builder(OutputStream os, BrailleConverter bt)
      Creates a new builder with the suppled output stream and braille converter.
      Parameters:
      os - the output stream to use
      bt - the braille converter to use
  • Method Details

    • 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(String value)
      Sets the line break style
      Parameters:
      value - one of dos, unix, mac or default
      Returns:
      returns this object
    • breaks

      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(String value)
      Sets the padding style
      Parameters:
      value - a padding style
      Returns:
      returns this object
    • padNewline

      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