diff -r 5cfb685d8eec -r 9107f7df660c java/alt2xml/src/cz/frantovo/alt2xml/SAXTovarna.java --- a/java/alt2xml/src/cz/frantovo/alt2xml/SAXTovarna.java Tue Jan 03 14:47:22 2012 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,72 +0,0 @@ -package cz.frantovo.alt2xml; - -import cz.frantovo.alt2xml.vstup.SuperReader; -import javax.xml.parsers.ParserConfigurationException; -import javax.xml.parsers.SAXParser; -import javax.xml.parsers.SAXParserFactory; -import org.xml.sax.Parser; -import org.xml.sax.SAXException; -import org.xml.sax.SAXNotRecognizedException; -import org.xml.sax.SAXNotSupportedException; -import org.xml.sax.XMLReader; - -/** - * - * @author fiki - */ -public class SAXTovarna extends SAXParserFactory { - - @Override - public SAXParser newSAXParser() throws ParserConfigurationException, SAXException { - return new MůjParser(new SuperReader()); - } - - @Override - public void setFeature(String name, boolean value) throws ParserConfigurationException, SAXNotRecognizedException, SAXNotSupportedException { - throw new SAXNotSupportedException("Zatím není podporováno."); - } - - @Override - public boolean getFeature(String name) throws ParserConfigurationException, SAXNotRecognizedException, SAXNotSupportedException { - throw new SAXNotSupportedException("Zatím není podporováno."); - } - - private static class MůjParser extends SAXParser { - - private XMLReader xmlReader; - - public MůjParser(XMLReader xmlReader) { - this.xmlReader = xmlReader; - } - - @Override - public Parser getParser() throws SAXException { - throw new SAXException("Není podporováno."); - } - - @Override - public XMLReader getXMLReader() throws SAXException { - return xmlReader; - } - - @Override - public boolean isNamespaceAware() { - return false; - } - - @Override - public boolean isValidating() { - return false; - } - - @Override - public void setProperty(String name, Object value) throws SAXNotRecognizedException, SAXNotSupportedException { - xmlReader.setProperty(name, value); - } - - @Override - public Object getProperty(String name) throws SAXNotRecognizedException, SAXNotSupportedException { - return xmlReader.getProperty(name); - } - } -} \ No newline at end of file