AbstractAlt2XmlReader: support features
authorFrantišek Kučera <franta-hg@frantovo.cz>
Mon, 16 Jun 2014 11:11:01 +0200
changeset 447bd195a5fa2a
parent 43 058c1c39251e
child 45 ce2013823604
AbstractAlt2XmlReader: support features
java/alt2xml-lib-input/src/cz/frantovo/alt2xml/AbstractAlt2XmlReader.java
     1.1 --- a/java/alt2xml-lib-input/src/cz/frantovo/alt2xml/AbstractAlt2XmlReader.java	Sun Jun 15 14:50:49 2014 +0200
     1.2 +++ b/java/alt2xml-lib-input/src/cz/frantovo/alt2xml/AbstractAlt2XmlReader.java	Mon Jun 16 11:11:01 2014 +0200
     1.3 @@ -42,6 +42,7 @@
     1.4  	protected DTDHandler dtdHandler;
     1.5  	protected EntityResolver entityResolver;
     1.6  	protected Map<String, Object> properties = new HashMap<>();
     1.7 +	protected Map<String, Boolean> features = new HashMap<>();
     1.8  
     1.9  	@Override
    1.10  	public void parse(String systemId) throws IOException, SAXException {
    1.11 @@ -56,12 +57,16 @@
    1.12  		 * the http://xml.org/sax/features/namespaces
    1.13  		 * and the http://xml.org/sax/features/namespace-prefixes feature names.
    1.14  		 */
    1.15 -		throw new SAXNotSupportedException("Zatím není podporováno.");
    1.16 +		Boolean feature = features.get(name);
    1.17 +		return feature == null ? false : feature;
    1.18  	}
    1.19  
    1.20  	@Override
    1.21  	public void setFeature(String name, boolean value) throws SAXNotRecognizedException, SAXNotSupportedException {
    1.22 -		throw new SAXNotSupportedException("Zatím není podporováno.");
    1.23 +		/**
    1.24 +		 * TODO: filtrovat – povolit jen náš jmenný prostor
    1.25 +		 */
    1.26 +		features.put(name, value);
    1.27  	}
    1.28  
    1.29  	@Override