java/alt2xml-in-json/src/cz/frantovo/alt2xml/in/json/ReaderFactory.java
author František Kučera <franta-hg@frantovo.cz>
Sun, 15 Nov 2020 20:11:05 +0100
changeset 115 96e1125c8500
parent 111 e4900596abdb
permissions -rw-r--r--
cli: default action = xml
franta-hg@13
     1
/**
franta-hg@13
     2
 * Alt2XML
franta-hg@13
     3
 * Copyright © 2014 František Kučera (frantovo.cz)
franta-hg@13
     4
 *
franta-hg@13
     5
 * This program is free software: you can redistribute it and/or modify
franta-hg@13
     6
 * it under the terms of the GNU General Public License as published by
franta-hg@111
     7
 * the Free Software Foundation, version 3 of the License.
franta-hg@13
     8
 *
franta-hg@13
     9
 * This program is distributed in the hope that it will be useful,
franta-hg@13
    10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
franta-hg@13
    11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
franta-hg@13
    12
 * GNU General Public License for more details.
franta-hg@13
    13
 *
franta-hg@13
    14
 * You should have received a copy of the GNU General Public License
franta-hg@13
    15
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
franta-hg@13
    16
 */
franta-hg@14
    17
package cz.frantovo.alt2xml.in.json;
franta-hg@13
    18
franta-hg@15
    19
import cz.frantovo.alt2xml.Alt2XmlRegexReaderFactory;
franta-hg@15
    20
import java.util.regex.Pattern;
franta-hg@13
    21
import org.xml.sax.XMLReader;
franta-hg@13
    22
franta-hg@13
    23
/**
franta-hg@13
    24
 *
franta-hg@13
    25
 * @author Ing. František Kučera (frantovo.cz)
franta-hg@13
    26
 */
franta-hg@15
    27
public class ReaderFactory extends Alt2XmlRegexReaderFactory {
franta-hg@15
    28
franta-hg@15
    29
	private static final Pattern pattern = Pattern.compile("^.*\\.json$");
franta-hg@13
    30
franta-hg@13
    31
	@Override
franta-hg@15
    32
	protected Pattern getSystemIdPattern() {
franta-hg@15
    33
		return pattern;
franta-hg@13
    34
	}
franta-hg@13
    35
franta-hg@13
    36
	@Override
franta-hg@13
    37
	public XMLReader getReader() {
franta-hg@15
    38
		return new Reader();
franta-hg@13
    39
	}
franta-hg@13
    40
}