|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.xml.sax.helpers.DefaultHandler
org.apache.fop.layout.hyphenation.PatternParser
A SAX document handler to read and parse hyphenation patterns from a XML file.
| Constructor Summary | |
PatternParser()
|
|
PatternParser(PatternConsumer consumer)
|
|
| Method Summary | |
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)
Characters. |
void |
endElement(String uri,
String local,
String raw)
|
void |
error(SAXParseException ex)
Error. |
void |
fatalError(SAXParseException ex)
Fatal error. |
protected static InputSource |
fileInputSource(String filename)
create an InputSource from a file name |
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(String filename)
|
protected String |
readToken(StringBuffer chars)
|
void |
setConsumer(PatternConsumer consumer)
|
void |
startElement(String uri,
String local,
String raw,
Attributes attrs)
Start element. |
void |
warning(SAXParseException ex)
Warning. |
| Methods inherited from class org.xml.sax.helpers.DefaultHandler |
endDocument, endPrefixMapping, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDecl |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public PatternParser()
throws HyphenationException
public PatternParser(PatternConsumer consumer)
throws HyphenationException
| Method Detail |
public void setConsumer(PatternConsumer consumer)
public void parse(String filename)
throws HyphenationException
HyphenationException
protected static InputSource fileInputSource(String filename)
throws HyphenationException
filename - the name of the file
HyphenationExceptionprotected String readToken(StringBuffer chars)
protected static String getPattern(String word)
protected ArrayList normalizeException(ArrayList ex)
protected String getExceptionWord(ArrayList ex)
protected static String getInterletterValues(String pat)
public void startElement(String uri,
String local,
String raw,
Attributes attrs)
startElement in interface ContentHandler
public void endElement(String uri,
String local,
String raw)
endElement in interface ContentHandler
public void characters(char[] ch,
int start,
int length)
characters in interface ContentHandlerpublic void warning(SAXParseException ex)
warning in interface ErrorHandlerpublic void error(SAXParseException ex)
error in interface ErrorHandler
public void fatalError(SAXParseException ex)
throws SAXException
fatalError in interface ErrorHandlerSAXExceptionpublic void addClass(String c)
PatternConsumer
addClass in interface PatternConsumer
public void addException(String w,
ArrayList e)
PatternConsumerHyphen instances
addException in interface PatternConsumer
public void addPattern(String p,
String v)
PatternConsumer
addPattern in interface PatternConsumerp - v - interletter values expressed as a string of
digit characters.
public static void main(String[] args)
throws Exception
Exception
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||