Class PEFConverterFacade


  • public class PEFConverterFacade
    extends java.lang.Object
    Provides a facade for both PEFHandler and TextHandler
    Author:
    Joel HÃ¥kansson
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.text.SimpleDateFormat DATE_FORMAT  
      static java.lang.String KEY_ALIGN
      Key for parsePefFile setting, corresponding settings value should match a value in PEFHandler.Alignment
      static java.lang.String KEY_ALIGNMENT_OFFSET
      Key for parsePefFile setting, corresponding settings value should be the number of characters to offset alignment by
      static java.lang.String KEY_AUTHOR
      Key for parseTextFile setting, corresponding settings value should contain the author of the publication
      static java.lang.String KEY_BREAKS
      Key for parsePefFile setting, corresponding settings value should match a value in StandardLineBreaks.Type
      static java.lang.String KEY_CELL_HEIGHT
      Key for parsePefFile setting, corresponding settings value should be a number, in millimeters
      static java.lang.String KEY_CELL_WIDTH
      Key for parsePefFile setting, corresponding settings value should be a number, in millimeters
      static java.lang.String KEY_DATE
      Key for parseTextFile setting, corresponding settings value should be a string containing a valid date on the form yyyy-MM-dd
      static java.lang.String KEY_DUPLEX
      Key for parseTextFile setting, corresponding settings value should be "true" for duplex or "false" for simplex
      static java.lang.String KEY_EMBOSSER
      Key for parsePefFile setting, corresponding settings value should match an embosser identifier
      static java.lang.String KEY_FALLBACK
      Key for parsePefFile setting, corresponding settings value should match a value in EmbosserBrailleConverter.EightDotFallbackMethod
      static java.lang.String KEY_IDENTIFIER
      Key for parseTextFile setting, corresponding settings value should contain the identifier for the publication
      static java.lang.String KEY_LANGUAGE
      Key for parseTextFile setting, corresponding settings value should contain the language of the publication
      static java.lang.String KEY_MODE
      Key for parseTextFile setting, corresponding settings value should match the table to use
      static java.lang.String KEY_PADDING
      Key for parsePefFile setting, corresponding settings value should match a padding style
      static java.lang.String KEY_RANGE
      Key for parsePefFile setting, corresponding settings value should match a range
      static java.lang.String KEY_REPLACEMENT
      Key for parsePefFile setting, corresponding settings value should be a character in the range 0x2800-0x283F
      static java.lang.String KEY_TABLE
      Key for parsePefFile setting, corresponding settings value should match a table identifier
      static java.lang.String KEY_TITLE
      Key for parseTextFile setting, corresponding settings value should contain the title of the publication
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void parsePefFile​(java.io.File input, java.io.OutputStream os, PageFormat pf, java.util.Map<java.lang.String,​java.lang.String> settings)
      Parses the given PEF-file input using the supplied output stream and settings.
      static void parsePefFile​(java.io.File input, PEFHandler ph)
      Parses the given input using the supplied PEFHandler.
      static void parsePefFile​(java.io.InputStream is, PEFHandler ph)
      Parses the given input stream using the supplied PEFHandler.
      static void parseTextFile​(java.io.File input, java.io.File output, java.util.Map<java.lang.String,​java.lang.String> settings)
      Parses a text file and outputs a PEF-file based on the contents of the file
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • DATE_FORMAT

        public static final java.text.SimpleDateFormat DATE_FORMAT
      • KEY_EMBOSSER

        public static final java.lang.String KEY_EMBOSSER
        Key for parsePefFile setting, corresponding settings value should match an embosser identifier
        See Also:
        Constant Field Values
      • KEY_TABLE

        public static final java.lang.String KEY_TABLE
        Key for parsePefFile setting, corresponding settings value should match a table identifier
        See Also:
        Constant Field Values
      • KEY_BREAKS

        public static final java.lang.String KEY_BREAKS
        Key for parsePefFile setting, corresponding settings value should match a value in StandardLineBreaks.Type
        See Also:
        Constant Field Values
      • KEY_RANGE

        public static final java.lang.String KEY_RANGE
        Key for parsePefFile setting, corresponding settings value should match a range
        See Also:
        Constant Field Values
      • KEY_REPLACEMENT

        public static final java.lang.String KEY_REPLACEMENT
        Key for parsePefFile setting, corresponding settings value should be a character in the range 0x2800-0x283F
        See Also:
        Constant Field Values
      • KEY_PADDING

        public static final java.lang.String KEY_PADDING
        Key for parsePefFile setting, corresponding settings value should match a padding style
        See Also:
        Constant Field Values
      • KEY_ALIGNMENT_OFFSET

        public static final java.lang.String KEY_ALIGNMENT_OFFSET
        Key for parsePefFile setting, corresponding settings value should be the number of characters to offset alignment by
        See Also:
        Constant Field Values
      • KEY_CELL_WIDTH

        public static final java.lang.String KEY_CELL_WIDTH
        Key for parsePefFile setting, corresponding settings value should be a number, in millimeters
        See Also:
        Constant Field Values
      • KEY_CELL_HEIGHT

        public static final java.lang.String KEY_CELL_HEIGHT
        Key for parsePefFile setting, corresponding settings value should be a number, in millimeters
        See Also:
        Constant Field Values
      • KEY_TITLE

        public static final java.lang.String KEY_TITLE
        Key for parseTextFile setting, corresponding settings value should contain the title of the publication
        See Also:
        Constant Field Values
      • KEY_AUTHOR

        public static final java.lang.String KEY_AUTHOR
        Key for parseTextFile setting, corresponding settings value should contain the author of the publication
        See Also:
        Constant Field Values
      • KEY_IDENTIFIER

        public static final java.lang.String KEY_IDENTIFIER
        Key for parseTextFile setting, corresponding settings value should contain the identifier for the publication
        See Also:
        Constant Field Values
      • KEY_MODE

        public static final java.lang.String KEY_MODE
        Key for parseTextFile setting, corresponding settings value should match the table to use
        See Also:
        Constant Field Values
      • KEY_LANGUAGE

        public static final java.lang.String KEY_LANGUAGE
        Key for parseTextFile setting, corresponding settings value should contain the language of the publication
        See Also:
        Constant Field Values
      • KEY_DUPLEX

        public static final java.lang.String KEY_DUPLEX
        Key for parseTextFile setting, corresponding settings value should be "true" for duplex or "false" for simplex
        See Also:
        Constant Field Values
      • KEY_DATE

        public static final java.lang.String KEY_DATE
        Key for parseTextFile setting, corresponding settings value should be a string containing a valid date on the form yyyy-MM-dd
        See Also:
        Constant Field Values
    • Constructor Detail

      • PEFConverterFacade

        public PEFConverterFacade()
    • Method Detail

      • parsePefFile

        public static void parsePefFile​(java.io.File input,
                                        java.io.OutputStream os,
                                        PageFormat pf,
                                        java.util.Map<java.lang.String,​java.lang.String> settings)
                                 throws java.lang.NumberFormatException,
                                        javax.xml.parsers.ParserConfigurationException,
                                        org.xml.sax.SAXException,
                                        java.io.IOException,
                                        EmbosserFactoryException,
                                        UnsupportedWidthException
        Parses the given PEF-file input using the supplied output stream and settings.
        Parameters:
        input -
        os -
        settings -
        Throws:
        java.lang.NumberFormatException
        javax.xml.parsers.ParserConfigurationException
        org.xml.sax.SAXException
        java.io.IOException
        EmbosserFactoryException
        UnsupportedWidthException
      • parsePefFile

        public static void parsePefFile​(java.io.File input,
                                        PEFHandler ph)
                                 throws javax.xml.parsers.ParserConfigurationException,
                                        org.xml.sax.SAXException,
                                        java.io.IOException,
                                        UnsupportedWidthException
        Parses the given input using the supplied PEFHandler.
        Parameters:
        input - the input PEF file
        ph - the PEFHandler to use
        Throws:
        javax.xml.parsers.ParserConfigurationException
        org.xml.sax.SAXException
        java.io.IOException
        UnsupportedWidthException
      • parsePefFile

        public static void parsePefFile​(java.io.InputStream is,
                                        PEFHandler ph)
                                 throws javax.xml.parsers.ParserConfigurationException,
                                        org.xml.sax.SAXException,
                                        java.io.IOException,
                                        UnsupportedWidthException
        Parses the given input stream using the supplied PEFHandler.
        Parameters:
        is - the input stream
        ph - the PEFHandler
        Throws:
        javax.xml.parsers.ParserConfigurationException
        org.xml.sax.SAXException
        java.io.IOException
        UnsupportedWidthException
      • parseTextFile

        public static void parseTextFile​(java.io.File input,
                                         java.io.File output,
                                         java.util.Map<java.lang.String,​java.lang.String> settings)
                                  throws java.io.IOException
        Parses a text file and outputs a PEF-file based on the contents of the file
        Parameters:
        input - input text file
        output - output PEF-file
        settings - settings
        Throws:
        java.io.IOException - if IO fails