|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.avalon.excalibur.catalog.XMLCatalogReader
Parses XML Catalog files.
This class reads XML Catalog files, returning a stream of tokens. At present, it recognizes John Cowan's XML Catalogs (formerly XCatalogs). In the future, additional XML Catalog formats may be supported.This code interrogates the following non-standard system properties:
Sets the debug level. A value of 0 is assumed if the property is not set or is not a number.
Catalog
Field Summary | |
int |
debug
The debug level |
Constructor Summary | |
XMLCatalogReader()
Construct an XMLCatalogReader object. |
Method Summary | |
void |
characters(char[] ch,
int start,
int length)
The SAX characters method. |
void |
endDocument()
The SAX endDocument method. |
void |
endElement(java.lang.String name)
The SAX endElement method. |
void |
ignorableWhitespace(char[] ch,
int start,
int length)
The SAX ignorableWhitespace method. |
CatalogEntry |
nextEntry()
Get the next entry from the file |
void |
parseCatalog(java.lang.String fileUrl)
Attempt to parse an XML Catalog file. |
void |
processingInstruction(java.lang.String target,
java.lang.String data)
The SAX processingInstruction method. |
void |
setDocumentLocator(org.xml.sax.Locator locator)
The SAX setDocumentLocator method. |
void |
setParserClass(java.lang.String parser)
Sets the parser class, enabling XML Catalog parsing. |
void |
startDocument()
The SAX startDocument method. |
void |
startElement(java.lang.String name,
org.xml.sax.AttributeList atts)
The SAX startElement method. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public int debug
The debug level
In general, higher numbers produce more information:
Constructor Detail |
public XMLCatalogReader()
Construct an XMLCatalogReader object.
Method Detail |
public void parseCatalog(java.lang.String fileUrl) throws org.xml.sax.SAXException, java.io.IOException, NotXMLCatalogException, NoXMLParserException, UnknownCatalogFormatException, java.lang.ClassNotFoundException, java.lang.InstantiationException, java.lang.IllegalAccessException, java.lang.ClassCastException
Attempt to parse an XML Catalog file.
fileUrl
- The URL or filename of the catalog file to processorg.xml.sax.SAXException
- Error parsing catalog file.java.io.IOException
- Error reading catalog file.NoXMLParserException
- No Parser class provided.NotXMLCatalogException
- The Catalog appears not to be XML.UnknownCatalogFormatException
- Unexpected XML catalog type.java.lang.ClassNotFoundException
- Parser class can't be found.java.lang.InstantiationException
- Parser class can't be instantiated.java.lang.IllegalAccessException
- Error instantiating parser class.java.lang.ClassCastException
- Parser class isn't a SAX Parser.public CatalogEntry nextEntry() throws java.io.IOException
Get the next entry from the file
java.io.IOException
- Error reading catalog filepublic void startDocument() throws org.xml.sax.SAXException
The SAX startDocument
method. Does nothing.
startDocument
in interface org.xml.sax.DocumentHandler
org.xml.sax.SAXException
- DOC: Insert Description of Exceptionpublic void endDocument() throws org.xml.sax.SAXException
The SAX endDocument
method. Does nothing.
endDocument
in interface org.xml.sax.DocumentHandler
org.xml.sax.SAXException
- DOC: Insert Description of Exceptionpublic void startElement(java.lang.String name, org.xml.sax.AttributeList atts) throws org.xml.sax.SAXException
The SAX startElement
method.
This element attempts to identify the type of catalog by looking at the
name of the first element encountered. If it recognizes the element, it
sets the catalogType
appropriately.
After the catalog type has been identified, the appropriate entry parser is called for each subsequent element in the catalog.
startElement
in interface org.xml.sax.DocumentHandler
name
- The name of the element.atts
- The list of attributes on the element.org.xml.sax.SAXException
- DOC: Insert Description of Exceptionpublic void endElement(java.lang.String name) throws org.xml.sax.SAXException
The SAX endElement
method. Does nothing.
endElement
in interface org.xml.sax.DocumentHandler
name
- DOC: Insert Description of Parameterorg.xml.sax.SAXException
- DOC: Insert Description of Exceptionpublic void characters(char[] ch, int start, int length) throws org.xml.sax.SAXException
The SAX characters
method. Does nothing.
characters
in interface org.xml.sax.DocumentHandler
ch
- DOC: Insert Description of Parameterstart
- DOC: Insert Description of Parameterlength
- DOC: Insert Description of Parameterorg.xml.sax.SAXException
- DOC: Insert Description of Exceptionpublic void ignorableWhitespace(char[] ch, int start, int length) throws org.xml.sax.SAXException
The SAX ignorableWhitespace
method. Does nothing.
ignorableWhitespace
in interface org.xml.sax.DocumentHandler
ch
- DOC: Insert Description of Parameterstart
- DOC: Insert Description of Parameterlength
- DOC: Insert Description of Parameterorg.xml.sax.SAXException
- DOC: Insert Description of Exceptionpublic void processingInstruction(java.lang.String target, java.lang.String data) throws org.xml.sax.SAXException
The SAX processingInstruction
method. Does nothing.
processingInstruction
in interface org.xml.sax.DocumentHandler
target
- DOC: Insert Description of Parameterdata
- DOC: Insert Description of Parameterorg.xml.sax.SAXException
- DOC: Insert Description of Exceptionpublic void setParserClass(java.lang.String parser)
Sets the parser class, enabling XML Catalog parsing.
Sets the parser class that will be used for loading XML Catalogs. If this
method is not called, all attempts to use the XMLCatalogParser
will fail, throwing a NoXMLParserException
.
parser
- The name of a class implementing the SAX Parser interface
to be used for subsequent XML Catalog parsing.com.arbortext.catalog.NoXMLParserException
public void setDocumentLocator(org.xml.sax.Locator locator)
The SAX setDocumentLocator
method. Does nothing.
setDocumentLocator
in interface org.xml.sax.DocumentHandler
locator
- The new DocumentLocator value
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |