Package org.daisy.braille.facade
Class PEFConverterFacade
- java.lang.Object
-
- org.daisy.braille.facade.PEFConverterFacade
-
public class PEFConverterFacade extends java.lang.ObjectProvides a facade for both PEFHandler and TextHandler- Author:
- Joel HÃ¥kansson
-
-
Field Summary
Fields Modifier and Type Field Description static java.text.SimpleDateFormatDATE_FORMATstatic java.lang.StringKEY_ALIGNKey for parsePefFile setting, corresponding settings value should match a value inPEFHandler.Alignmentstatic java.lang.StringKEY_ALIGNMENT_OFFSETKey for parsePefFile setting, corresponding settings value should be the number of characters to offset alignment bystatic java.lang.StringKEY_AUTHORKey for parseTextFile setting, corresponding settings value should contain the author of the publicationstatic java.lang.StringKEY_BREAKSKey for parsePefFile setting, corresponding settings value should match a value in StandardLineBreaks.Typestatic java.lang.StringKEY_CELL_HEIGHTKey for parsePefFile setting, corresponding settings value should be a number, in millimetersstatic java.lang.StringKEY_CELL_WIDTHKey for parsePefFile setting, corresponding settings value should be a number, in millimetersstatic java.lang.StringKEY_DATEKey for parseTextFile setting, corresponding settings value should be a string containing a valid date on the form yyyy-MM-ddstatic java.lang.StringKEY_DUPLEXKey for parseTextFile setting, corresponding settings value should be "true" for duplex or "false" for simplexstatic java.lang.StringKEY_EMBOSSERKey for parsePefFile setting, corresponding settings value should match an embosser identifierstatic java.lang.StringKEY_FALLBACKKey for parsePefFile setting, corresponding settings value should match a value inEmbosserBrailleConverter.EightDotFallbackMethodstatic java.lang.StringKEY_IDENTIFIERKey for parseTextFile setting, corresponding settings value should contain the identifier for the publicationstatic java.lang.StringKEY_LANGUAGEKey for parseTextFile setting, corresponding settings value should contain the language of the publicationstatic java.lang.StringKEY_MODEKey for parseTextFile setting, corresponding settings value should match the table to usestatic java.lang.StringKEY_PADDINGKey for parsePefFile setting, corresponding settings value should match a padding stylestatic java.lang.StringKEY_RANGEKey for parsePefFile setting, corresponding settings value should match a rangestatic java.lang.StringKEY_REPLACEMENTKey for parsePefFile setting, corresponding settings value should be a character in the range 0x2800-0x283Fstatic java.lang.StringKEY_TABLEKey for parsePefFile setting, corresponding settings value should match a table identifierstatic java.lang.StringKEY_TITLEKey for parseTextFile setting, corresponding settings value should contain the title of the publication
-
Constructor Summary
Constructors Constructor Description PEFConverterFacade()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidparsePefFile(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 voidparsePefFile(java.io.File input, PEFHandler ph)Parses the given input using the supplied PEFHandler.static voidparsePefFile(java.io.InputStream is, PEFHandler ph)Parses the given input stream using the supplied PEFHandler.static voidparseTextFile(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
-
-
-
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_FALLBACK
public static final java.lang.String KEY_FALLBACK
Key for parsePefFile setting, corresponding settings value should match a value inEmbosserBrailleConverter.EightDotFallbackMethod- 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_ALIGN
public static final java.lang.String KEY_ALIGN
Key for parsePefFile setting, corresponding settings value should match a value inPEFHandler.Alignment- 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
-
-
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, UnsupportedWidthExceptionParses the given PEF-file input using the supplied output stream and settings.- Parameters:
input-os-settings-- Throws:
java.lang.NumberFormatExceptionjavax.xml.parsers.ParserConfigurationExceptionorg.xml.sax.SAXExceptionjava.io.IOExceptionEmbosserFactoryExceptionUnsupportedWidthException
-
parsePefFile
public static void parsePefFile(java.io.File input, PEFHandler ph) throws javax.xml.parsers.ParserConfigurationException, org.xml.sax.SAXException, java.io.IOException, UnsupportedWidthExceptionParses the given input using the supplied PEFHandler.- Parameters:
input- the input PEF fileph- the PEFHandler to use- Throws:
javax.xml.parsers.ParserConfigurationExceptionorg.xml.sax.SAXExceptionjava.io.IOExceptionUnsupportedWidthException
-
parsePefFile
public static void parsePefFile(java.io.InputStream is, PEFHandler ph) throws javax.xml.parsers.ParserConfigurationException, org.xml.sax.SAXException, java.io.IOException, UnsupportedWidthExceptionParses the given input stream using the supplied PEFHandler.- Parameters:
is- the input streamph- the PEFHandler- Throws:
javax.xml.parsers.ParserConfigurationExceptionorg.xml.sax.SAXExceptionjava.io.IOExceptionUnsupportedWidthException
-
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.IOExceptionParses a text file and outputs a PEF-file based on the contents of the file- Parameters:
input- input text fileoutput- output PEF-filesettings- settings- Throws:
java.io.IOException- if IO fails
-
-