1.1 --- a/java/alt2xml/src/cz/frantovo/alt2xml/SAXTovarna.java Mon Jan 02 20:15:52 2012 +0100
1.2 +++ b/java/alt2xml/src/cz/frantovo/alt2xml/SAXTovarna.java Tue Jan 03 12:55:38 2012 +0100
1.3 @@ -1,11 +1,16 @@
1.4 package cz.frantovo.alt2xml;
1.5
1.6 +import cz.frantovo.alt2xml.vstup.SuperReader;
1.7 +import java.util.logging.Level;
1.8 +import java.util.logging.Logger;
1.9 import javax.xml.parsers.ParserConfigurationException;
1.10 import javax.xml.parsers.SAXParser;
1.11 import javax.xml.parsers.SAXParserFactory;
1.12 +import org.xml.sax.Parser;
1.13 import org.xml.sax.SAXException;
1.14 import org.xml.sax.SAXNotRecognizedException;
1.15 import org.xml.sax.SAXNotSupportedException;
1.16 +import org.xml.sax.XMLReader;
1.17
1.18 /**
1.19 *
1.20 @@ -15,7 +20,7 @@
1.21
1.22 @Override
1.23 public SAXParser newSAXParser() throws ParserConfigurationException, SAXException {
1.24 - return new AltParser();
1.25 + return new MůjParser(new SuperReader());
1.26 }
1.27
1.28 @Override
1.29 @@ -27,5 +32,53 @@
1.30 public boolean getFeature(String name) throws ParserConfigurationException, SAXNotRecognizedException, SAXNotSupportedException {
1.31 throw new UnsupportedOperationException("Not supported yet.");
1.32 }
1.33 -
1.34 -}
1.35 +
1.36 + private static class MůjParser extends SAXParser {
1.37 +
1.38 + private static final Logger log = Logger.getLogger(MůjParser.class.getName());
1.39 + private XMLReader xmlReader;
1.40 +
1.41 + public MůjParser(XMLReader xmlReader) {
1.42 + this.xmlReader = xmlReader;
1.43 + }
1.44 +
1.45 + @Override
1.46 + public Parser getParser() throws SAXException {
1.47 + // TODO: dopsat
1.48 + log.log(Level.FINE, "getParser");
1.49 + return null;
1.50 + }
1.51 +
1.52 + @Override
1.53 + public XMLReader getXMLReader() throws SAXException {
1.54 + return xmlReader;
1.55 + }
1.56 +
1.57 + @Override
1.58 + public boolean isNamespaceAware() {
1.59 + // TODO: dopsat
1.60 + log.log(Level.FINE, "isNamespaceAware");
1.61 + return false;
1.62 + }
1.63 +
1.64 + @Override
1.65 + public boolean isValidating() {
1.66 + // TODO: dopsat
1.67 + log.log(Level.FINE, "isValidating");
1.68 + return false;
1.69 + }
1.70 +
1.71 + @Override
1.72 + public void setProperty(String name, Object value) throws SAXNotRecognizedException, SAXNotSupportedException {
1.73 + // TODO: dopsat
1.74 + log.log(Level.FINE, "setProperty: {0} = {1}", new Object[]{name, value});
1.75 + }
1.76 +
1.77 + @Override
1.78 + public Object getProperty(String name) throws SAXNotRecognizedException, SAXNotSupportedException {
1.79 + // TODO: dopsat
1.80 + log.log(Level.FINE, "getProperty: {0}", name);
1.81 + return null;
1.82 + }
1.83 + }
1.84 +}
1.85 \ No newline at end of file