|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.cocoon.components.validation.impl.AbstractValidator
org.apache.cocoon.components.validation.impl.DefaultValidator
public class DefaultValidator
The default implementation of the Validator interface provides
core management for a number of SchemaParser instances.
Given the simplicity of this implementation, only SchemaParsers
implementing the ThreadSafe interface can be managed, and they can be
accessed directly (via its name) through the methods specified by the
ServiceSelector interface.
That said, normally selection would occur using the methods declared by the
AbstractValidator class and implemented here.
| Field Summary |
|---|
| Fields inherited from class org.apache.cocoon.components.validation.impl.AbstractValidator |
|---|
logger, manager, resolver |
| Fields inherited from interface org.apache.cocoon.components.validation.Validator |
|---|
GRAMMAR_ISO_SCHEMATRON, GRAMMAR_RELAX_CORE, GRAMMAR_RELAX_NG, GRAMMAR_RELAX_NS, GRAMMAR_SCHEMATRON, GRAMMAR_TREX, GRAMMAR_XML_DTD, GRAMMAR_XML_SCHEMA, ROLE |
| Constructor Summary | |
|---|---|
DefaultValidator()
Create a new DefaultValidator instance. |
|
| Method Summary | |
|---|---|
void |
configure(Configuration conf)
Configure this instance. |
void |
contextualize(Context context)
Contextualize this instance. |
void |
dispose()
Dispose of this instance. |
void |
initialize()
Initialize this instance. |
boolean |
isSelectable(Object selectionKey)
Check whether a subcomponent ( SchemaParser) associated with the
specified selection key (its configured "name") is selectable in
this ServiceSelector instance. |
protected SchemaParser |
lookupParserByGrammar(String grammar)
Attempt to acquire a SchemaParser interface able to understand
the grammar language specified. |
protected SchemaParser |
lookupParserByName(String name)
Attempt to acquire a SchemaParser interface associated with the
specified instance name. |
void |
release(Object component)
Release a subcomponent ( SchemaParser) instance previously selected
from this ServiceSelector instance. |
protected void |
releaseParser(SchemaParser parser)
Release a previously acquired SchemaParser instance back to its
original component manager. |
Object |
select(Object selectionKey)
Select a subcomponent ( SchemaParser) associated with the specified
selection key (its configured "name"). |
| Methods inherited from class org.apache.cocoon.components.validation.impl.AbstractValidator |
|---|
detectGrammar, enableLogging, getSchema, getValidationHandler, getValidationHandler, getValidationHandler, getValidationHandler, getValidationHandler, getValidationHandler, getValidationHandler, getValidationHandler, service |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DefaultValidator()
Create a new DefaultValidator instance.
| Method Detail |
|---|
public void contextualize(Context context)
throws ContextException
Contextualize this instance.
contextualize in interface ContextualizableContextException
public void configure(Configuration conf)
throws ConfigurationException
Configure this instance.
configure in interface ConfigurableConfigurationException
public void initialize()
throws Exception
Initialize this instance.
initialize in interface InitializableExceptionpublic void dispose()
Dispose of this instance.
All sub-components initialized previously will be disposed of when this method is called.
dispose in interface Disposabledispose in class AbstractValidatorprotected SchemaParser lookupParserByGrammar(String grammar)
Attempt to acquire a SchemaParser interface able to understand
the grammar language specified.
lookupParserByGrammar in class AbstractValidatorgrammar - the grammar language that must be understood by the returned
SchemaParser
SchemaParser instance or null if none was found able
to understand the specified grammar language.protected SchemaParser lookupParserByName(String name)
Attempt to acquire a SchemaParser interface associated with the
specified instance name.
lookupParserByName in class AbstractValidatorname - the name associated with the SchemaParser to be returned.
SchemaParser instance or null if none was found.protected void releaseParser(SchemaParser parser)
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 SchemaParsers instances.
releaseParser in class AbstractValidatorparser - the SchemaParser whose instance is to be released.
public Object select(Object selectionKey)
throws ServiceException
Select a subcomponent (SchemaParser) associated with the specified
selection key (its configured "name").
select in interface ServiceSelectorServiceExceptionpublic boolean isSelectable(Object selectionKey)
Check whether a subcomponent (SchemaParser) associated with the
specified selection key (its configured "name") is selectable in
this ServiceSelector instance.
isSelectable in interface ServiceSelectorpublic void release(Object component)
Release a subcomponent (SchemaParser) instance previously selected
from this ServiceSelector instance.
release in interface ServiceSelector
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||