001 package com.thaiopensource.validate;
002
003 import com.thaiopensource.util.PropertyMap;
004 import com.thaiopensource.validate.IncorrectSchemaException;
005 import org.xml.sax.InputSource;
006 import org.xml.sax.SAXException;
007
008 import java.io.IOException;
009
010 /**
011 * A SchemaReader object is immutable and can thus be safely accessed
012 * concurrently from multiple threads.
013 */
014 public interface SchemaReader {
015 public static final String BASE_URI = "http://www.thaiopensource.com/validate/";
016 /**
017 * Creates a <code>Schema</code> by reading it from an <code>InputSource</code>.
018 *
019 * @param in the <code>InputSource</code> from which to read the schema;
020 * must not be <code>null</code>
021 * @param properties a <code>PropertyMap</code> to control the schema creation;
022 * must not be <code>null</code>
023 * @return a newly created <code>Schema</code>, never <code>null</code>
024 * @throws IOException if an I/O error occurs
025 * @throws SAXException
026 * @throws IncorrectSchemaException
027 *
028 * @see ValidateProperty
029 */
030 Schema createSchema(InputSource in, PropertyMap properties)
031 throws IOException, SAXException, IncorrectSchemaException;
032
033 Option getOption(String uri);
034 }