Package org.apache.xml.resolver.readers
Class XCatalogReader
- java.lang.Object
-
- org.apache.xml.resolver.readers.SAXCatalogReader
-
- org.apache.xml.resolver.readers.XCatalogReader
-
- All Implemented Interfaces:
CatalogReader
,SAXCatalogParser
,org.xml.sax.ContentHandler
,org.xml.sax.DocumentHandler
public class XCatalogReader extends SAXCatalogReader implements SAXCatalogParser
Parse "XCatalog" XML Catalog files, this is the XML Catalog format developed by John Cowan and supported by Apache.- Version:
- 1.0
- Author:
- Norman Walsh Norman.Walsh@Sun.COM
- See Also:
Catalog
-
-
Field Summary
Fields Modifier and Type Field Description protected Catalog
catalog
The catalog object needs to be stored by the object so that SAX callbacks can use it.-
Fields inherited from class org.apache.xml.resolver.readers.SAXCatalogReader
debug, namespaceMap, parserClass, parserFactory
-
-
Constructor Summary
Constructors Constructor Description XCatalogReader()
Default constructorXCatalogReader(javax.xml.parsers.SAXParserFactory parserFactory, Catalog catalog)
Constructor allowing for providing custom SAX parser factory
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
characters(char[] ch, int start, int length)
The SAXcharacters
method does nothing.void
endDocument()
The SAXendDocument
method does nothing.void
endElement(java.lang.String namespaceURI, java.lang.String localName, java.lang.String qName)
The SAXendElement
method does nothing.void
endPrefixMapping(java.lang.String prefix)
The SAXendPrefixMapping
method does nothing.Catalog
getCatalog()
Get the current catalog.void
ignorableWhitespace(char[] ch, int start, int length)
The SAXignorableWhitespace
method does nothing.void
processingInstruction(java.lang.String target, java.lang.String data)
The SAXprocessingInstruction
method does nothing.void
setCatalog(Catalog catalog)
Set the current catalog.void
setDocumentLocator(org.xml.sax.Locator locator)
The SAXsetDocumentLocator
method does nothing.void
skippedEntity(java.lang.String name)
The SAXskippedEntity
method does nothing.void
startDocument()
The SAXstartDocument
method does nothing.void
startElement(java.lang.String namespaceURI, java.lang.String localName, java.lang.String qName, org.xml.sax.Attributes atts)
The SAXstartElement
method recognizes elements from the plain catalog format and instantiates CatalogEntry objects for them.void
startPrefixMapping(java.lang.String prefix, java.lang.String uri)
The SAXstartPrefixMapping
method does nothing.-
Methods inherited from class org.apache.xml.resolver.readers.SAXCatalogReader
endElement, getCatalogParser, getParserClass, getParserFactory, readCatalog, readCatalog, setCatalogParser, setClassLoader, setParserClass, setParserFactory, startElement
-
-
-
-
Field Detail
-
catalog
protected Catalog catalog
The catalog object needs to be stored by the object so that SAX callbacks can use it.
-
-
Constructor Detail
-
XCatalogReader
public XCatalogReader()
Default constructor
-
XCatalogReader
public XCatalogReader(javax.xml.parsers.SAXParserFactory parserFactory, Catalog catalog)
Constructor allowing for providing custom SAX parser factory
-
-
Method Detail
-
setCatalog
public void setCatalog(Catalog catalog)
Set the current catalog.- Specified by:
setCatalog
in interfaceSAXCatalogParser
-
getCatalog
public Catalog getCatalog()
Get the current catalog.
-
setDocumentLocator
public void setDocumentLocator(org.xml.sax.Locator locator)
The SAXsetDocumentLocator
method does nothing.- Specified by:
setDocumentLocator
in interfaceorg.xml.sax.ContentHandler
- Specified by:
setDocumentLocator
in interfaceorg.xml.sax.DocumentHandler
- Overrides:
setDocumentLocator
in classSAXCatalogReader
-
startDocument
public void startDocument() throws org.xml.sax.SAXException
The SAXstartDocument
method does nothing.- Specified by:
startDocument
in interfaceorg.xml.sax.ContentHandler
- Specified by:
startDocument
in interfaceorg.xml.sax.DocumentHandler
- Overrides:
startDocument
in classSAXCatalogReader
- Throws:
org.xml.sax.SAXException
-
endDocument
public void endDocument() throws org.xml.sax.SAXException
The SAXendDocument
method does nothing.- Specified by:
endDocument
in interfaceorg.xml.sax.ContentHandler
- Specified by:
endDocument
in interfaceorg.xml.sax.DocumentHandler
- Overrides:
endDocument
in classSAXCatalogReader
- Throws:
org.xml.sax.SAXException
-
startElement
public void startElement(java.lang.String namespaceURI, java.lang.String localName, java.lang.String qName, org.xml.sax.Attributes atts) throws org.xml.sax.SAXException
The SAXstartElement
method recognizes elements from the plain catalog format and instantiates CatalogEntry objects for them.- Specified by:
startElement
in interfaceorg.xml.sax.ContentHandler
- Overrides:
startElement
in classSAXCatalogReader
- Parameters:
namespaceURI
- The namespace name of the element.localName
- The local name of the element.qName
- The QName of the element.atts
- The list of attributes on the element.- Throws:
org.xml.sax.SAXException
- See Also:
CatalogEntry
-
endElement
public void endElement(java.lang.String namespaceURI, java.lang.String localName, java.lang.String qName) throws org.xml.sax.SAXException
The SAXendElement
method does nothing.- Specified by:
endElement
in interfaceorg.xml.sax.ContentHandler
- Overrides:
endElement
in classSAXCatalogReader
- Throws:
org.xml.sax.SAXException
-
characters
public void characters(char[] ch, int start, int length) throws org.xml.sax.SAXException
The SAXcharacters
method does nothing.- Specified by:
characters
in interfaceorg.xml.sax.ContentHandler
- Specified by:
characters
in interfaceorg.xml.sax.DocumentHandler
- Overrides:
characters
in classSAXCatalogReader
- Throws:
org.xml.sax.SAXException
-
ignorableWhitespace
public void ignorableWhitespace(char[] ch, int start, int length) throws org.xml.sax.SAXException
The SAXignorableWhitespace
method does nothing.- Specified by:
ignorableWhitespace
in interfaceorg.xml.sax.ContentHandler
- Specified by:
ignorableWhitespace
in interfaceorg.xml.sax.DocumentHandler
- Overrides:
ignorableWhitespace
in classSAXCatalogReader
- Throws:
org.xml.sax.SAXException
-
processingInstruction
public void processingInstruction(java.lang.String target, java.lang.String data) throws org.xml.sax.SAXException
The SAXprocessingInstruction
method does nothing.- Specified by:
processingInstruction
in interfaceorg.xml.sax.ContentHandler
- Specified by:
processingInstruction
in interfaceorg.xml.sax.DocumentHandler
- Overrides:
processingInstruction
in classSAXCatalogReader
- Throws:
org.xml.sax.SAXException
-
skippedEntity
public void skippedEntity(java.lang.String name) throws org.xml.sax.SAXException
The SAXskippedEntity
method does nothing.- Specified by:
skippedEntity
in interfaceorg.xml.sax.ContentHandler
- Overrides:
skippedEntity
in classSAXCatalogReader
- Throws:
org.xml.sax.SAXException
-
startPrefixMapping
public void startPrefixMapping(java.lang.String prefix, java.lang.String uri) throws org.xml.sax.SAXException
The SAXstartPrefixMapping
method does nothing.- Specified by:
startPrefixMapping
in interfaceorg.xml.sax.ContentHandler
- Overrides:
startPrefixMapping
in classSAXCatalogReader
- Throws:
org.xml.sax.SAXException
-
endPrefixMapping
public void endPrefixMapping(java.lang.String prefix) throws org.xml.sax.SAXException
The SAXendPrefixMapping
method does nothing.- Specified by:
endPrefixMapping
in interfaceorg.xml.sax.ContentHandler
- Overrides:
endPrefixMapping
in classSAXCatalogReader
- Throws:
org.xml.sax.SAXException
-
-