KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > thaiopensource > validate > schematron > SchematronSchemaReaderFactory


1 package com.thaiopensource.validate.schematron;
2
3 import com.thaiopensource.validate.IncorrectSchemaException;
4 import com.thaiopensource.validate.Option;
5 import com.thaiopensource.validate.SchemaReader;
6 import com.thaiopensource.validate.SchemaReaderFactory;
7
8 import javax.xml.transform.TransformerConfigurationException JavaDoc;
9 import javax.xml.transform.TransformerFactory JavaDoc;
10 import javax.xml.transform.TransformerFactoryConfigurationError JavaDoc;
11
12 public abstract class SchematronSchemaReaderFactory implements SchemaReaderFactory {
13   public SchemaReader createSchemaReader(String JavaDoc namespaceUri) {
14     if (namespaceUri.equals(SchemaReaderImpl.SCHEMATRON_URI)) {
15       try {
16         return new SchemaReaderImpl(newTransformerFactory());
17       }
18       catch (TransformerFactoryConfigurationError JavaDoc e) { }
19       catch (IncorrectSchemaException e) { }
20       catch (TransformerConfigurationException JavaDoc e) { }
21     }
22     return null;
23   }
24
25   public Option getOption(String JavaDoc uri) {
26     return SchematronProperty.getOption(uri);
27   }
28
29   public abstract TransformerFactory JavaDoc newTransformerFactory();
30 }
31
Popular Tags