001    package com.thaiopensource.validate;
002    
003    import com.thaiopensource.validate.SchemaReader;
004    
005    /**
006     * A factory for SchemaReader. A class that implements this interface can be
007     * automatically discovered by SchemaReaderLoader, if it has
008     * a 0-argument constructor and if its name is listed in the file
009     * <code>META-INF/services/com.thaiopensource.validate.SchemaReaderFactory</code>.
010     *
011     * @see SchemaReaderLoader
012     * @see SchemaReader
013     */
014    public interface SchemaReaderFactory {
015      /**
016       * Creates a SchemaReader for a particular schema language.
017       *
018       * @param namespaceUri a String identifing the schema language; must not be <code>null</code>;
019       * for schema languages that use XML, this should be the namespace URI
020       * of the root element if the root element has a non-absent namespace URI
021       *
022       * @return a SchemaReader for the specified schema language, or <code>null</code>,
023       * if this SchemaReaderFactory cannot create a SchemaReader for the specified
024       * schema language
025       */
026      public SchemaReader createSchemaReader(String namespaceUri);
027    
028      Option getOption(String uri);
029    }