franta-hg@15: /** franta-hg@15: * Alt2XML franta-hg@15: * Copyright © 2014 František Kučera (frantovo.cz) franta-hg@15: * franta-hg@15: * This program is free software: you can redistribute it and/or modify franta-hg@15: * it under the terms of the GNU General Public License as published by franta-hg@111: * the Free Software Foundation, version 3 of the License. franta-hg@15: * franta-hg@15: * This program is distributed in the hope that it will be useful, franta-hg@15: * but WITHOUT ANY WARRANTY; without even the implied warranty of franta-hg@15: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the franta-hg@15: * GNU General Public License for more details. franta-hg@15: * franta-hg@15: * You should have received a copy of the GNU General Public License franta-hg@15: * along with this program. If not, see . franta-hg@15: */ franta-hg@15: package cz.frantovo.alt2xml; franta-hg@15: franta-hg@15: import java.util.regex.Pattern; franta-hg@15: franta-hg@15: /** franta-hg@15: * Factory for XMLReaders that can read documents with systemId defined by given pattern (typically franta-hg@15: * file extension like .ini, .properties etc.) franta-hg@15: * franta-hg@15: * @author Ing. František Kučera (frantovo.cz) franta-hg@15: */ franta-hg@15: public abstract class Alt2XmlRegexReaderFactory implements Alt2XmlReaderFactory { franta-hg@15: franta-hg@15: protected abstract Pattern getSystemIdPattern(); franta-hg@15: franta-hg@15: @Override franta-hg@36: public boolean canRead(AltInputSource inputSource) { franta-hg@36: return getSystemIdPattern().matcher(inputSource.getSystemId()).matches(); franta-hg@15: } franta-hg@15: }