Package org.daisy.braille.utils.pef
Class PEFConverterFacade
- java.lang.Object
-
- org.daisy.braille.utils.pef.PEFConverterFacade
-
public class PEFConverterFacade extends Object
Provides a facade for both PEFHandler and TextHandler.
-
-
Field Summary
Fields Modifier and Type Field Description static StringKEY_ALIGNKey for parsePefFile setting, corresponding settings value should match a value inPEFHandler.Alignment.static StringKEY_ALIGNMENT_OFFSETKey for parsePefFile setting, corresponding settings value should be the number of characters to offset alignment by.static StringKEY_BREAKSKey for parsePefFile setting, corresponding settings value should match a value in StandardLineBreaks.static StringKEY_CELL_HEIGHTKey for parsePefFile setting, corresponding settings value should be a number, in millimeters.static StringKEY_CELL_WIDTHKey for parsePefFile setting, corresponding settings value should be a number, in millimeters.static StringKEY_EMBOSSERKey for parsePefFile setting, corresponding settings value should match an embosser identifier.static StringKEY_FALLBACKKey for parsePefFile setting, corresponding settings value should match a value inEightDotFallbackMethod.static StringKEY_PADDINGKey for parsePefFile setting, corresponding settings value should match a padding style.static StringKEY_RANGEKey for parsePefFile setting, corresponding settings value should match a range.static StringKEY_REPLACEMENTKey for parsePefFile setting, corresponding settings value should be a character in the range 0x2800-0x283F.static StringKEY_TABLEKey for parsePefFile setting, corresponding settings value should match a table identifier.
-
Constructor Summary
Constructors Constructor Description PEFConverterFacade(EmbosserCatalogService embosserFactory)Creates a newPEFConverterFacadewith the specified embosser factory.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidparsePefFile(File input, OutputStream os, PageFormat pf, Map<String,String> settings)Parses the given PEF-file input using the supplied output stream and settings.voidparsePefFile(File input, PEFHandler ph)Parses the given input using the supplied PEFHandler.voidparsePefFile(InputStream is, PEFHandler ph)Parses the given input stream using the supplied PEFHandler.
-
-
-
Field Detail
-
KEY_EMBOSSER
public static final 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 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 String KEY_BREAKS
Key for parsePefFile setting, corresponding settings value should match a value in StandardLineBreaks.- See Also:
- Constant Field Values
-
KEY_RANGE
public static final String KEY_RANGE
Key for parsePefFile setting, corresponding settings value should match a range.- See Also:
- Constant Field Values
-
KEY_FALLBACK
public static final String KEY_FALLBACK
Key for parsePefFile setting, corresponding settings value should match a value inEightDotFallbackMethod.- See Also:
- Constant Field Values
-
KEY_REPLACEMENT
public static final 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 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 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 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 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 String KEY_CELL_HEIGHT
Key for parsePefFile setting, corresponding settings value should be a number, in millimeters.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
PEFConverterFacade
public PEFConverterFacade(EmbosserCatalogService embosserFactory)
Creates a newPEFConverterFacadewith the specified embosser factory.- Parameters:
embosserFactory- the embosser factory
-
-
Method Detail
-
parsePefFile
public void parsePefFile(File input, OutputStream os, PageFormat pf, Map<String,String> settings) throws NumberFormatException, ParserConfigurationException, SAXException, IOException, EmbosserFactoryException, UnsupportedWidthException
Parses the given PEF-file input using the supplied output stream and settings.- Parameters:
input- the inputos- the output streampf- the page formatsettings- the settings- Throws:
NumberFormatException- if an exception occursParserConfigurationException- if an exception occursSAXException- if an exception occursIOException- if an exception occursEmbosserFactoryException- if an exception occursUnsupportedWidthException- if an exception occurs
-
parsePefFile
public void parsePefFile(File input, PEFHandler ph) throws ParserConfigurationException, SAXException, IOException, UnsupportedWidthException
Parses the given input using the supplied PEFHandler.- Parameters:
input- the input PEF fileph- the PEFHandler to use- Throws:
ParserConfigurationException- if an exception occursSAXException- if an exception occursIOException- if an exception occursUnsupportedWidthException- if an exception occurs
-
parsePefFile
public void parsePefFile(InputStream is, PEFHandler ph) throws ParserConfigurationException, SAXException, IOException, UnsupportedWidthException
Parses the given input stream using the supplied PEFHandler.- Parameters:
is- the input streamph- the PEFHandler- Throws:
ParserConfigurationException- if an exception occursSAXException- if an exception occursIOException- if an exception occursUnsupportedWidthException- if an exception occurs
-
-