public class PatternParser extends DefaultHandler implements PatternConsumer
| Constructor and Description |
|---|
PatternParser() |
PatternParser(PatternConsumer consumer) |
| Modifier and Type | Method and Description |
|---|---|
void |
addClass(String c)
Add a character class.
|
void |
addException(String w,
ArrayList e)
Add a hyphenation exception.
|
void |
addPattern(String p,
String v)
Add hyphenation patterns.
|
void |
characters(char[] ch,
int start,
int length) |
void |
endElement(String uri,
String local,
String raw) |
void |
error(SAXParseException ex) |
void |
fatalError(SAXParseException ex) |
protected String |
getExceptionWord(ArrayList ex) |
protected static String |
getInterletterValues(String pat) |
protected static String |
getPattern(String word) |
static void |
main(String[] args) |
protected ArrayList |
normalizeException(ArrayList ex) |
void |
parse(File file)
Parses a hyphenation pattern file.
|
void |
parse(InputSource source)
Parses a hyphenation pattern file.
|
void |
parse(String filename)
Parses a hyphenation pattern file.
|
protected String |
readToken(StringBuffer chars) |
InputSource |
resolveEntity(String publicId,
String systemId) |
void |
setConsumer(PatternConsumer consumer) |
void |
startElement(String uri,
String local,
String raw,
Attributes attrs) |
void |
warning(SAXParseException ex) |
endDocument, endPrefixMapping, ignorableWhitespace, notationDecl, processingInstruction, setDocumentLocator, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDeclpublic PatternParser()
throws HyphenationException
HyphenationExceptionpublic PatternParser(PatternConsumer consumer) throws HyphenationException
HyphenationExceptionpublic void setConsumer(PatternConsumer consumer)
public void parse(String filename) throws HyphenationException
filename - the filenameHyphenationException - In case of an exception while parsingpublic void parse(File file) throws HyphenationException
file - the pattern fileHyphenationException - In case of an exception while parsingpublic void parse(InputSource source) throws HyphenationException
source - the InputSource for the fileHyphenationException - In case of an exception while parsingprotected String readToken(StringBuffer chars)
public InputSource resolveEntity(String publicId, String systemId)
resolveEntity in interface EntityResolverresolveEntity in class DefaultHandlerpublic void startElement(String uri, String local, String raw, Attributes attrs)
startElement in interface ContentHandlerstartElement in class DefaultHandlerContentHandler.startElement(java.lang.String,
java.lang.String, java.lang.String, org.xml.sax.Attributes)public void endElement(String uri, String local, String raw)
endElement in interface ContentHandlerendElement in class DefaultHandlerContentHandler.endElement(java.lang.String,
java.lang.String, java.lang.String)public void characters(char[] ch,
int start,
int length)
characters in interface ContentHandlercharacters in class DefaultHandlerContentHandler.characters(char[], int, int)public void warning(SAXParseException ex)
warning in interface ErrorHandlerwarning in class DefaultHandlerErrorHandler.warning(org.xml.sax.SAXParseException)public void error(SAXParseException ex)
error in interface ErrorHandlererror in class DefaultHandlerErrorHandler.error(org.xml.sax.SAXParseException)public void fatalError(SAXParseException ex) throws SAXException
fatalError in interface ErrorHandlerfatalError in class DefaultHandlerSAXExceptionErrorHandler.fatalError(org.xml.sax.SAXParseException)public void addClass(String c)
PatternConsumeraddClass in interface PatternConsumerc - character grouppublic void addException(String w, ArrayList e)
PatternConsumerHyphen instancesaddException in interface PatternConsumerpublic void addPattern(String p, String v)
PatternConsumeraddPattern in interface PatternConsumerp - the patternv - interletter values expressed as a string of digit characters.Copyright © 2000-2012 Apache Software Foundation. All Rights Reserved.