| java.lang.Object org.apache.cocoon.components.validation.impl.AbstractValidator
All known Subclasses: org.apache.cocoon.components.validation.impl.DefaultValidator,
Method Summary | |
protected String | detectGrammar(Source source) | public void | dispose() | public void | enableLogging(Logger logger) | protected Schema | getSchema(SchemaParser parser, Source source, String grammar) | public ValidationHandler | getValidationHandler(String uri) Return a
ValidationHandler validating an XML document according to
the schema found at the specified location.
The
Validator will attempt to automatically detect the grammar
language of the specified schema, and each error or warning occurring while
validating the document will trigger a
SAXException to be thrown back
to the caller.
Parameters: uri - the location of the schema to use to validate the document. | public ValidationHandler | getValidationHandler(String uri, String grammar) Return a
ValidationHandler validating an XML document according to
the schema found at the specified location.
Each error or warning occurring while validating the document will trigger
a
SAXException to be thrown back to the caller.
Parameters: uri - the location of the schema to use to validate the document. Parameters: grammar - the grammar language of the schema to parse. | public ValidationHandler | getValidationHandler(String uri, ErrorHandler errorHandler) Return a
ValidationHandler validating an XML document according to
the schema found at the specified location.
The
Validator will attempt to automatically detect the grammar
language of the specified schema, while each validation error or warning will
be passed to the specified
ErrorHandler which will have the ability
to generate and throw a
SAXException back to the caller.
Parameters: uri - the location of the schema to use to validate the document. Parameters: errorHandler - the ErrorHandler notified of validation problems. | public ValidationHandler | getValidationHandler(String uri, String grammar, ErrorHandler errorHandler) Return a
ValidationHandler validating an XML document according to
the schema found at the specified location.
Each validation error or warning will be passed to the specified
ErrorHandler which will have the ability to generate and throw a
SAXException back to the caller.
Parameters: uri - the location of the schema to use to validate the document. Parameters: grammar - the grammar language of the schema to parse. Parameters: errorHandler - the ErrorHandler notified of validation problems. | public ValidationHandler | getValidationHandler(Source source) Return a
ValidationHandler validating an XML document according to
the schema found at the specified location.
The
Validator will attempt to automatically detect the grammar
language of the specified schema, and each error or warning occurring while
validating the document will trigger a
SAXException to be thrown back
to the caller.
Parameters: source - the Source identifying the schema to use for validation. | public ValidationHandler | getValidationHandler(Source source, String grammar) Return a
ValidationHandler validating an XML document according to
the schema found at the specified location.
Each error or warning occurring while validating the document will trigger
a
SAXException to be thrown back to the caller.
Parameters: source - the Source identifying the schema to use for validation. Parameters: grammar - the grammar language of the schema to parse. | public ValidationHandler | getValidationHandler(Source source, ErrorHandler errorHandler) Return a
ValidationHandler validating an XML document according to
the schema found at the specified location.
The
Validator will attempt to automatically detect the grammar
language of the specified schema, while each validation error or warning will
be passed to the specified
ErrorHandler which will have the ability
to generate and throw a
SAXException back to the caller.
Parameters: source - the Source identifying the schema to use for validation. Parameters: errorHandler - the ErrorHandler notified of validation problems. | public ValidationHandler | getValidationHandler(Source source, String grammar, ErrorHandler errorHandler) Return a
ValidationHandler validating an XML document according to
the schema found at the specified location.
Each validation error or warning will be passed to the specified
ErrorHandler which will have the ability to generate and throw a
SAXException back to the caller.
Parameters: source - the Source identifying the schema to use for validation. Parameters: grammar - the grammar language of the schema to parse. Parameters: errorHandler - the ErrorHandler notified of validation problems. | abstract protected SchemaParser | lookupParserByGrammar(String grammar) | abstract protected SchemaParser | lookupParserByName(String name) Attempt to acquire a
SchemaParser interface associated with the
specified instance name.
Parameters: name - the name associated with the SchemaParser to be returned. | abstract protected void | releaseParser(SchemaParser parser) | public void | service(ServiceManager manager) |
logger | protected Logger logger(Code) | | The configured
Logger instance.
|
manager | protected ServiceManager manager(Code) | | The configured
ServiceManager instance.
|
resolver | protected SourceResolver resolver(Code) | | The configured
SourceResolver instance.
|
detectGrammar | protected String detectGrammar(Source source) throws IOException, SAXException, ValidatorException(Code) | | Attempt to detect the grammar language used by the schema identified
by the specified
Source .
Parameters: source - a Source instance pointing to the schema to be analyzed. throws: IOException - if an I/O error occurred accessing the schema. throws: SAXException - if an error occurred parsing the schema. throws: ValidatorException - if the language of the schema could not be guessed. |
dispose | public void dispose()(Code) | | Dispose of this component instance.
|
enableLogging | public void enableLogging(Logger logger)(Code) | | Enable logging.
|
getSchema | protected Schema getSchema(SchemaParser parser, Source source, String grammar) throws IOException, SAXException(Code) | | Return a
Schema instance from the specified
SchemaParser associated with the given
Source and grammar language.
This method simply implements resolution returning the
Schema instance acquired calling parser.getSchema(source,grammar) .
Parameters: parser - the SchemaParser producing the Schema. Parameters: source - the Source associated with the Schema to return. Parameters: grammar - the grammar language of the schema to produce. throws: SAXException - if a grammar error occurred parsing the schema. throws: IOException - if an I/O error occurred parsing the schema. |
lookupParserByGrammar | abstract protected SchemaParser lookupParserByGrammar(String grammar)(Code) | | Attempt to acquire a
SchemaParser interface able to understand
the grammar language specified.
Parameters: grammar - the grammar language that must be understood by the returnedSchemaParser a SchemaParser instance or null if none was found ableto understand the specified grammar language. |
lookupParserByName | abstract protected SchemaParser lookupParserByName(String name)(Code) | | Attempt to acquire a
SchemaParser interface associated with the
specified instance name.
Parameters: name - the name associated with the SchemaParser to be returned. a SchemaParser instance or null if none was found. |
releaseParser | abstract protected void releaseParser(SchemaParser parser)(Code) | | Release a previously acquired
SchemaParser instance back to its
original component manager.
This method is supplied in case solid implementations of this class relied
on the
ServiceManager to manage
SchemaParser s instances.
Parameters: parser - the SchemaParser whose instance is to be released. |
service | public void service(ServiceManager manager) throws ServiceException(Code) | | Specify the
ServiceManager available to this instance.
|
|
|