Package com.itextpdf.layout.hyphenation
Class PatternParser
java.lang.Object
org.xml.sax.helpers.DefaultHandler
com.itextpdf.layout.hyphenation.PatternParser
- All Implemented Interfaces:
-
ContentHandler,DTDHandler,EntityResolver,ErrorHandler
A SAX document handler to read and parse hyphenation patterns from a XML file.
This work was authored by Carlos Villegas (cav@uniscope.co.jp).
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcharacters(char[] ch, int start, int length) voidendElement(String uri, String local, String raw) voidvoidprotected voidvoidparse(InputStream stream, String name) Parses a hyphenation pattern file.voidParses a hyphenation pattern file.voidstartElement(String uri, String local, String raw, Attributes attrs) voidMethods inherited from class org.xml.sax.helpers.DefaultHandler
endDocument, endPrefixMapping, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDeclMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.xml.sax.ContentHandler
declaration
-
Constructor Details
-
PatternParser
Construct a pattern parser.- Parameters:
-
consumer- a pattern consumer
-
-
Method Details
-
parse
Parses a hyphenation pattern file.- Parameters:
-
filename- the filename - Throws:
-
HyphenationException- In case of an exception while parsing -
FileNotFoundException- If the specified file is not found -
IOException
-
parse
Parses a hyphenation pattern file.- Parameters:
-
stream- the InputStream for the file -
name- unique key representing country-language combination - Throws:
-
HyphenationException- In case of an exception while parsing
-
getExternalClasses
- Throws:
-
SAXException- if not caught
-
startElement
public void startElement(String uri, String local, String raw, Attributes attrs) throws SAXException - Specified by:
-
startElementin interfaceContentHandler - Overrides:
-
startElementin classDefaultHandler - Throws:
-
SAXException- if parsing of hyphenation classes resource xml has failed.
-
endElement
- Specified by:
-
endElementin interfaceContentHandler - Overrides:
-
endElementin classDefaultHandler
-
characters
public void characters(char[] ch, int start, int length) - Specified by:
-
charactersin interfaceContentHandler - Overrides:
-
charactersin classDefaultHandler
-
warning
- Specified by:
-
warningin interfaceErrorHandler - Overrides:
-
warningin classDefaultHandler
-
error
- Specified by:
-
errorin interfaceErrorHandler - Overrides:
-
errorin classDefaultHandler
-
fatalError
- Specified by:
-
fatalErrorin interfaceErrorHandler - Overrides:
-
fatalErrorin classDefaultHandler - Throws:
-
SAXException
-