|
fop 2.2 | |||||||||
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 raisedpublic PatternParser(PatternConsumer consumer) throws HyphenationException
consumer
- a pattern consumer
HyphenationException
- if a hyphenation exception is raisedMethod Detail |
---|
public void parse(java.lang.String filename) throws HyphenationException
filename
- the filename
HyphenationException
- In case of an exception while parsingpublic void parse(java.io.File file) throws HyphenationException
file
- the pattern file
HyphenationException
- In case of an exception while parsingpublic void parse(org.xml.sax.InputSource source) throws HyphenationException
source
- the InputSource for the file
HyphenationException
- In case of an exception while parsingprotected void getExternalClasses() throws org.xml.sax.SAXException
org.xml.sax.SAXException
- if not caughtpublic 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.ContentHandler
startElement
in class org.xml.sax.helpers.DefaultHandler
org.xml.sax.SAXException
public void endElement(java.lang.String uri, java.lang.String local, java.lang.String raw)
endElement
in interface org.xml.sax.ContentHandler
endElement
in class org.xml.sax.helpers.DefaultHandler
public void characters(char[] ch, int start, int length)
characters
in interface org.xml.sax.ContentHandler
characters
in class org.xml.sax.helpers.DefaultHandler
public void warning(org.xml.sax.SAXParseException ex)
warning
in interface org.xml.sax.ErrorHandler
warning
in class org.xml.sax.helpers.DefaultHandler
public void error(org.xml.sax.SAXParseException ex)
error
in interface org.xml.sax.ErrorHandler
error
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.ErrorHandler
fatalError
in class org.xml.sax.helpers.DefaultHandler
org.xml.sax.SAXException
public void addClass(java.lang.String c)
addClass
in interface PatternConsumer
c
- character grouppublic void addException(java.lang.String w, java.util.ArrayList e)
Hyphen
instances
addException
in interface PatternConsumer
w
- word to add as an exceptione
- pre-hyphenated wordpublic void addPattern(java.lang.String p, java.lang.String v)
addPattern
in interface PatternConsumer
p
- 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 2.2 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |