franta-hg@37: /** franta-hg@37: * Alt2XML franta-hg@37: * Copyright © 2014 František Kučera (frantovo.cz) franta-hg@37: * franta-hg@37: * This program is free software: you can redistribute it and/or modify franta-hg@37: * it under the terms of the GNU General Public License as published by franta-hg@37: * the Free Software Foundation, either version 3 of the License, or franta-hg@37: * (at your option) any later version. franta-hg@37: * franta-hg@37: * This program is distributed in the hope that it will be useful, franta-hg@37: * but WITHOUT ANY WARRANTY; without even the implied warranty of franta-hg@37: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the franta-hg@37: * GNU General Public License for more details. franta-hg@37: * franta-hg@37: * You should have received a copy of the GNU General Public License franta-hg@37: * along with this program. If not, see . franta-hg@37: */ franta-hg@37: package cz.frantovo.alt2xml; franta-hg@37: franta-hg@37: import javax.xml.parsers.SAXParser; franta-hg@37: import org.xml.sax.Parser; franta-hg@37: import org.xml.sax.SAXException; franta-hg@37: import org.xml.sax.SAXNotRecognizedException; franta-hg@37: import org.xml.sax.SAXNotSupportedException; franta-hg@37: import org.xml.sax.XMLReader; franta-hg@37: franta-hg@37: /** franta-hg@37: * franta-hg@37: * @author Ing. František Kučera (frantovo.cz) franta-hg@37: */ franta-hg@37: public class AltSAXParser extends SAXParser { franta-hg@37: franta-hg@37: private final XMLReader xmlReader; franta-hg@37: franta-hg@37: public AltSAXParser(XMLReader xmlReader) { franta-hg@37: this.xmlReader = xmlReader; franta-hg@37: } franta-hg@37: franta-hg@37: @Override franta-hg@37: @Deprecated franta-hg@37: public Parser getParser() throws SAXException { franta-hg@37: throw new SAXException("Není podporováno."); franta-hg@37: } franta-hg@37: franta-hg@37: @Override franta-hg@37: public XMLReader getXMLReader() throws SAXException { franta-hg@37: return xmlReader; franta-hg@37: } franta-hg@37: franta-hg@37: @Override franta-hg@37: public boolean isNamespaceAware() { franta-hg@37: return true; franta-hg@37: } franta-hg@37: franta-hg@37: @Override franta-hg@37: public boolean isValidating() { franta-hg@37: return false; franta-hg@37: } franta-hg@37: franta-hg@37: @Override franta-hg@37: public void setProperty(String name, Object value) throws SAXNotRecognizedException, SAXNotSupportedException { franta-hg@37: xmlReader.setProperty(name, value); franta-hg@37: } franta-hg@37: franta-hg@37: @Override franta-hg@37: public Object getProperty(String name) throws SAXNotRecognizedException, SAXNotSupportedException { franta-hg@37: return xmlReader.getProperty(name); franta-hg@37: } franta-hg@37: }