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 String
KEY_ALIGN
Key for parsePefFile setting, corresponding settings value should match a value inPEFHandler.Alignment
.static String
KEY_ALIGNMENT_OFFSET
Key for parsePefFile setting, corresponding settings value should be the number of characters to offset alignment by.static String
KEY_BREAKS
Key for parsePefFile setting, corresponding settings value should match a value in StandardLineBreaks.static String
KEY_CELL_HEIGHT
Key for parsePefFile setting, corresponding settings value should be a number, in millimeters.static String
KEY_CELL_WIDTH
Key for parsePefFile setting, corresponding settings value should be a number, in millimeters.static String
KEY_EMBOSSER
Key for parsePefFile setting, corresponding settings value should match an embosser identifier.static String
KEY_FALLBACK
Key for parsePefFile setting, corresponding settings value should match a value inEightDotFallbackMethod
.static String
KEY_PADDING
Key for parsePefFile setting, corresponding settings value should match a padding style.static String
KEY_RANGE
Key for parsePefFile setting, corresponding settings value should match a range.static String
KEY_REPLACEMENT
Key for parsePefFile setting, corresponding settings value should be a character in the range 0x2800-0x283F.static String
KEY_TABLE
Key for parsePefFile setting, corresponding settings value should match a table identifier.
-
Constructor Summary
Constructors Constructor Description PEFConverterFacade(EmbosserCatalogService embosserFactory)
Creates a newPEFConverterFacade
with the specified embosser factory.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
parsePefFile(File input, OutputStream os, PageFormat pf, Map<String,String> settings)
Parses the given PEF-file input using the supplied output stream and settings.void
parsePefFile(File input, PEFHandler ph)
Parses the given input using the supplied PEFHandler.void
parsePefFile(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 newPEFConverterFacade
with 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
-
-