com.wutka.dtd
Class DTDParser
java.lang.Object
|
+--com.wutka.dtd.DTDParser
- All Implemented Interfaces:
- EntityExpansion
- public class DTDParser
- extends Object
- implements EntityExpansion
Parses a DTD file and returns a DTD object
- Version:
- $Revision: 1.13 $ $Date: 2001/07/05 23:47:13 $ by $Author: wutka $
- Author:
- Mark Wutka
Constructor Summary |
DTDParser(File in)
Creates a parser that will read from the specified File object |
DTDParser(File in,
boolean trace)
Creates a parser that will read from the specified File object |
DTDParser(Reader in)
Creates a parser that will read from the specified Reader object |
DTDParser(Reader in,
boolean trace)
Creates a parser that will read from the specified Reader object |
DTDParser(URL in)
Creates a parser that will read from the specified URL object |
DTDParser(URL in,
boolean trace)
Creates a parser that will read from the specified URL object |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
scanner
protected com.wutka.dtd.Scanner scanner
dtd
protected DTD dtd
defaultLocation
protected Object defaultLocation
DTDParser
public DTDParser(Reader in)
- Creates a parser that will read from the specified Reader object
DTDParser
public DTDParser(Reader in,
boolean trace)
- Creates a parser that will read from the specified Reader object
- Parameters:
in
- The input stream to readtrace
- True if the parser should print out tokens as it reads them
(used for debugging the parser)
DTDParser
public DTDParser(File in)
throws IOException
- Creates a parser that will read from the specified File object
DTDParser
public DTDParser(File in,
boolean trace)
throws IOException
- Creates a parser that will read from the specified File object
- Parameters:
in
- The file to readtrace
- True if the parser should print out tokens as it reads them
(used for debugging the parser)
DTDParser
public DTDParser(URL in)
throws IOException
- Creates a parser that will read from the specified URL object
DTDParser
public DTDParser(URL in,
boolean trace)
throws IOException
- Creates a parser that will read from the specified URL object
- Parameters:
in
- The URL to readtrace
- True if the parser should print out tokens as it reads them
(used for debugging the parser)
parse
public DTD parse()
throws IOException
- Parses the DTD file and returns a DTD object describing the DTD.
This invocation of parse does not try to guess the root element
(for efficiency reasons)
parse
public DTD parse(boolean guessRootElement)
throws IOException
- Parses the DTD file and returns a DTD object describing the DTD.
- Parameters:
guessRootElement
- If true, tells the parser to try to guess the
root element of the document by process of elimination
removeElements
protected void removeElements(Hashtable h,
DTD dtd,
DTDItem item)
parseTopLevelElement
protected void parseTopLevelElement()
throws IOException
skipUntil
protected void skipUntil(com.wutka.dtd.TokenType stopToken)
throws IOException
expect
protected com.wutka.dtd.Token expect(com.wutka.dtd.TokenType expected)
throws IOException
parseElement
protected void parseElement()
throws IOException
parseContentSpec
protected void parseContentSpec(com.wutka.dtd.Scanner scanner,
DTDElement element)
throws IOException
parseMixed
protected void parseMixed(DTDElement element)
throws IOException
parseChildren
protected void parseChildren(DTDElement element)
throws IOException
parseChoiceSequence
protected DTDContainer parseChoiceSequence()
throws IOException
parseCP
protected DTDItem parseCP()
throws IOException
parseCardinality
protected DTDCardinal parseCardinality()
throws IOException
parseAttlist
protected void parseAttlist()
throws IOException
parseAttdef
protected void parseAttdef(com.wutka.dtd.Scanner scanner,
DTDElement element,
DTDAttlist attlist)
throws IOException
parseNotationList
protected DTDNotationList parseNotationList()
throws IOException
parseEnumeration
protected DTDEnumeration parseEnumeration()
throws IOException
parseEntity
protected void parseEntity()
throws IOException
parseEntityDef
protected void parseEntityDef(DTDEntity entity)
throws IOException
parseNotation
protected void parseNotation()
throws IOException
expandEntity
public DTDEntity expandEntity(String name)
- Specified by:
expandEntity
in interface EntityExpansion