1 package cz.frantovo.alt2xml;
3 import cz.frantovo.alt2xml.vstup.SuperReader;
4 import javax.xml.parsers.ParserConfigurationException;
5 import javax.xml.parsers.SAXParser;
6 import javax.xml.parsers.SAXParserFactory;
7 import org.xml.sax.Parser;
8 import org.xml.sax.SAXException;
9 import org.xml.sax.SAXNotRecognizedException;
10 import org.xml.sax.SAXNotSupportedException;
11 import org.xml.sax.XMLReader;
17 public class SAXTovarna extends SAXParserFactory {
20 public SAXParser newSAXParser() throws ParserConfigurationException, SAXException {
21 return new MůjParser(new SuperReader());
25 public void setFeature(String name, boolean value) throws ParserConfigurationException, SAXNotRecognizedException, SAXNotSupportedException {
26 throw new SAXNotSupportedException("Zatím není podporováno.");
30 public boolean getFeature(String name) throws ParserConfigurationException, SAXNotRecognizedException, SAXNotSupportedException {
31 throw new SAXNotSupportedException("Zatím není podporováno.");
34 private static class MůjParser extends SAXParser {
36 private XMLReader xmlReader;
38 public MůjParser(XMLReader xmlReader) {
39 this.xmlReader = xmlReader;
43 public Parser getParser() throws SAXException {
44 throw new SAXException("Není podporováno.");
48 public XMLReader getXMLReader() throws SAXException {
53 public boolean isNamespaceAware() {
58 public boolean isValidating() {
63 public void setProperty(String name, Object value) throws SAXNotRecognizedException, SAXNotSupportedException {
64 xmlReader.setProperty(name, value);
68 public Object getProperty(String name) throws SAXNotRecognizedException, SAXNotSupportedException {
69 return xmlReader.getProperty(name);