|
fop 1.1 | |||||||||
| 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.hyphenation.PatternParser
public class PatternParser
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 | |
|---|---|
PatternParser()
Construct a pattern parser. |
|
PatternParser(PatternConsumer consumer)
Construct a pattern parser. |
|
| Method Summary | |
|---|---|
void |
addClass(java.lang.String c)
For testing purposes only. |
void |
addException(java.lang.String w,
java.util.ArrayList e)
For testing purposes only. |
void |
addPattern(java.lang.String p,
java.lang.String v)
For testing purposes only. |
void |
characters(char[] ch,
int start,
int length)
|
void |
closeTestOut()
Close test out file. |
void |
endElement(java.lang.String uri,
java.lang.String local,
java.lang.String raw)
|
void |
error(org.xml.sax.SAXParseException ex)
|
void |
fatalError(org.xml.sax.SAXParseException ex)
|
protected void |
getExternalClasses()
|
static void |
main(java.lang.String[] args)
Main entry point when used as an application. |
void |
parse(java.io.File file)
Parses a hyphenation pattern file. |
void |
parse(org.xml.sax.InputSource source)
Parses a hyphenation pattern file. |
void |
parse(java.lang.String filename)
Parses a hyphenation pattern file. |
void |
setTestOut(java.io.PrintStream testOut)
Set test out stream. |
void |
startElement(java.lang.String uri,
java.lang.String local,
java.lang.String raw,
org.xml.sax.Attributes attrs)
|
void |
warning(org.xml.sax.SAXParseException ex)
|
| 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
HyphenationException - if a hyphenation exception is raised
public PatternParser(PatternConsumer consumer)
throws HyphenationException
consumer - a pattern consumer
HyphenationException - if a hyphenation exception is raised| Method Detail |
|---|
public void parse(java.lang.String filename)
throws HyphenationException
filename - the filename
HyphenationException - In case of an exception while parsing
public void parse(java.io.File file)
throws HyphenationException
file - the pattern file
HyphenationException - In case of an exception while parsing
public void parse(org.xml.sax.InputSource source)
throws HyphenationException
source - the InputSource for the file
HyphenationException - In case of an exception while parsing
protected void getExternalClasses()
throws org.xml.sax.SAXException
org.xml.sax.SAXException - if not caught
public void startElement(java.lang.String uri,
java.lang.String local,
java.lang.String raw,
org.xml.sax.Attributes attrs)
throws org.xml.sax.SAXException
startElement in interface org.xml.sax.ContentHandlerstartElement in class org.xml.sax.helpers.DefaultHandlerorg.xml.sax.SAXException
public void endElement(java.lang.String uri,
java.lang.String local,
java.lang.String raw)
endElement in interface org.xml.sax.ContentHandlerendElement in class org.xml.sax.helpers.DefaultHandler
public void characters(char[] ch,
int start,
int length)
characters in interface org.xml.sax.ContentHandlercharacters in class org.xml.sax.helpers.DefaultHandlerpublic void warning(org.xml.sax.SAXParseException ex)
warning in interface org.xml.sax.ErrorHandlerwarning in class org.xml.sax.helpers.DefaultHandlerpublic void error(org.xml.sax.SAXParseException ex)
error in interface org.xml.sax.ErrorHandlererror in class org.xml.sax.helpers.DefaultHandler
public void fatalError(org.xml.sax.SAXParseException ex)
throws org.xml.sax.SAXException
fatalError in interface org.xml.sax.ErrorHandlerfatalError in class org.xml.sax.helpers.DefaultHandlerorg.xml.sax.SAXExceptionpublic void addClass(java.lang.String c)
addClass in interface PatternConsumerc - character group
public void addException(java.lang.String w,
java.util.ArrayList e)
Hyphen instances
addException in interface PatternConsumerw - word to add as an exceptione - pre-hyphenated word
public void addPattern(java.lang.String p,
java.lang.String v)
addPattern in interface PatternConsumerp - the patternv - interletter values expressed as a string of
digit characters.public void setTestOut(java.io.PrintStream testOut)
testOut - the testOut to setpublic void closeTestOut()
public static void main(java.lang.String[] args)
throws java.lang.Exception
args - array of command line arguments
java.lang.Exception - in case of uncaught exception
|
fop 1.1 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||