com.thaiopensource.validate.schematron
Class SchemaReaderImpl
java.lang.Object
com.thaiopensource.validate.schematron.SchemaReaderImpl
- All Implemented Interfaces:
- SchemaReader
class SchemaReaderImpl
- extends Object
- implements SchemaReader
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SCHEMATRON_URI
static final String SCHEMATRON_URI
- See Also:
- Constant Field Values
LOCATION_URI
private static final String LOCATION_URI
- See Also:
- Constant Field Values
ERROR_URI
private static final String ERROR_URI
- See Also:
- Constant Field Values
localizer
private final Localizer localizer
transformerFactoryClass
private final Class transformerFactoryClass
schematron
private final Templates schematron
schematronSchema
private final Schema schematronSchema
SCHEMATRON_SCHEMA
private static final String SCHEMATRON_SCHEMA
- See Also:
- Constant Field Values
SCHEMATRON_STYLESHEET
private static final String SCHEMATRON_STYLESHEET
- See Also:
- Constant Field Values
supportedPropertyIds
private static final PropertyId[] supportedPropertyIds
SchemaReaderImpl
SchemaReaderImpl(TransformerFactory transformerFactory)
throws TransformerConfigurationException,
IncorrectSchemaException
- Throws:
TransformerConfigurationException
IncorrectSchemaException
getOption
public Option getOption(String uri)
- Specified by:
getOption
in interface SchemaReader
initTransformerFactory
private void initTransformerFactory(TransformerFactory factory)
createSchema
public Schema createSchema(InputSource in,
PropertyMap properties)
throws IOException,
SAXException,
IncorrectSchemaException
- Description copied from interface:
SchemaReader
- Creates a
Schema
by reading it from an InputSource
.
- Specified by:
createSchema
in interface SchemaReader
- Parameters:
in
- the InputSource
from which to read the schema;
must not be null
properties
- a PropertyMap
to control the schema creation;
must not be null
- Returns:
- a newly created
Schema
, never null
- Throws:
IOException
- if an I/O error occurs
SAXException
IncorrectSchemaException
- See Also:
ValidateProperty
createValidatingSource
private SAXSource createValidatingSource(InputSource in,
PropertyMap properties,
CountingErrorHandler ceh)
throws SAXException
- Throws:
SAXException
createTransformingSource
private SAXSource createTransformingSource(SAXSource in,
String phase,
boolean diagnose,
String systemId,
CountingErrorHandler ceh)
throws SAXException
- Throws:
SAXException
toSAXException
private SAXException toSAXException(TransformerException e,
boolean hadError)
throws IOException,
IncorrectSchemaException
- Throws:
IOException
IncorrectSchemaException
causeToSAXException
private SAXException causeToSAXException(Throwable cause,
boolean hadError)
throws IOException,
IncorrectSchemaException
- Throws:
IOException
IncorrectSchemaException
toSAXException
private static SAXException toSAXException(SchemaReaderImpl.UserException e)
throws IOException,
IncorrectSchemaException
- Throws:
IOException
IncorrectSchemaException
fullResourceName
private static String fullResourceName(String name)
getResourceAsStream
private static InputStream getResourceAsStream(String resourceName)