1.1 --- a/java/alt2xml-in-json/src/cz/frantovo/alt2xml/in/json/ReaderFactory.java Thu Jun 05 23:45:24 2014 +0200
1.2 +++ b/java/alt2xml-in-json/src/cz/frantovo/alt2xml/in/json/ReaderFactory.java Sat Jun 07 10:38:31 2014 +0200
1.3 @@ -17,23 +17,25 @@
1.4 */
1.5 package cz.frantovo.alt2xml.in.json;
1.6
1.7 -import cz.frantovo.alt2xml.Alt2XmlReaderFactory;
1.8 +import cz.frantovo.alt2xml.Alt2XmlRegexReaderFactory;
1.9 +import java.util.regex.Pattern;
1.10 import org.xml.sax.XMLReader;
1.11
1.12 /**
1.13 *
1.14 * @author Ing. František Kučera (frantovo.cz)
1.15 */
1.16 -public class ReaderFactory implements Alt2XmlReaderFactory {
1.17 +public class ReaderFactory extends Alt2XmlRegexReaderFactory {
1.18 +
1.19 + private static final Pattern pattern = Pattern.compile("^.*\\.json$");
1.20
1.21 @Override
1.22 - public boolean canRead(String systemId) {
1.23 - throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
1.24 + protected Pattern getSystemIdPattern() {
1.25 + return pattern;
1.26 }
1.27
1.28 @Override
1.29 public XMLReader getReader() {
1.30 - throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
1.31 + return new Reader();
1.32 }
1.33 -
1.34 }