|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.avalon.framework.logger.AbstractLogEnabled
org.apache.cocoon.xml.AbstractXMLProducer
org.apache.cocoon.xml.AbstractXMLPipe
org.apache.cocoon.transformation.AbstractTransformer
org.apache.cocoon.transformation.ValidationReportTransformer
public class ValidationReportTransformer
The ValidationReportTransformer provides a Transformer
validating documents while being processed in a Cocoon pipeline, and preparing
a report of all detected inconsistancies according the specified schema.
The only defined (but not required) configuration for this component is
<grammar>...string...</grammar>
indicating the default grammar language of the schemas to use.
This configuration parameter can be overridden by specifying the
grammar parameter when using this Transformer in a
pipeline.
If no grammar is specified (either as a configuration, or a parameter) this
transformer will instruct the Validator to try and guess the grammar
of the schema being parsed.
The report prepared by this transformer will look like the following:
<report xmlns="http://apache.org/cocoon/validation/1.0">
<warning system="..." public="..." line="..." column="...">
... detailed message ...
</warning>
<error system="..." public="..." line="..." column="...">
... detailed message ...
</error>
<fatal system="..." public="..." line="..." column="...">
... message ...
</fatal>
</report>
The location attributes specified in the <warning/>,
<error/> and <fatal/> tags are all optional
and will be generated only if known.
| Field Summary |
|---|
| Fields inherited from class org.apache.cocoon.xml.AbstractXMLProducer |
|---|
contentHandler, EMPTY_CONTENT_HANDLER, lexicalHandler, xmlConsumer |
| Fields inherited from interface org.apache.cocoon.transformation.Transformer |
|---|
ROLE |
| Constructor Summary | |
|---|---|
ValidationReportTransformer()
Create a new ValidationReportTransformer instance. |
|
| Method Summary | |
|---|---|
void |
configure(Configuration configuration)
Configure this component instance. |
void |
dispose()
Dispose of this component instance releasing all previously acquired required instances back to the ServiceManager. |
void |
endDocument()
Receive notification of the end of the document and produce the report of the validation result. |
Serializable |
getKey()
Return the unique key to associated with the schema being processed in the scope of the request being processed for caching. |
SourceValidity |
getValidity()
Return the SourceValidity associated with the schema currently
being processed in the scope of the request being processed. |
void |
recycle()
Recycle this component instance at the end of request processing. |
void |
service(ServiceManager manager)
Contextualize this component instance specifying its associated ServiceManager instance. |
void |
setConsumer(XMLConsumer consumer)
Specify the XMLConsumer receiving SAX events emitted by this
Transformer instance in the scope of a request. |
void |
setup(SourceResolver resolver,
Map objectModel,
String source,
Parameters parameters)
Contextualize this component in the scope of a pipeline when a request is processed. |
| Methods inherited from class org.apache.cocoon.xml.AbstractXMLPipe |
|---|
characters, comment, endCDATA, endDTD, endElement, endEntity, endPrefixMapping, ignorableWhitespace, processingInstruction, setDocumentLocator, skippedEntity, startCDATA, startDocument, startDTD, startElement, startEntity, startPrefixMapping |
| Methods inherited from class org.apache.cocoon.xml.AbstractXMLProducer |
|---|
setContentHandler, setLexicalHandler |
| Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled |
|---|
enableLogging, getLogger, setupLogger, setupLogger, setupLogger |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.xml.sax.ContentHandler |
|---|
characters, endElement, endPrefixMapping, ignorableWhitespace, processingInstruction, setDocumentLocator, skippedEntity, startDocument, startElement, startPrefixMapping |
| Methods inherited from interface org.xml.sax.ext.LexicalHandler |
|---|
comment, endCDATA, endDTD, endEntity, startCDATA, startDTD, startEntity |
| Constructor Detail |
|---|
public ValidationReportTransformer()
Create a new ValidationReportTransformer instance.
| Method Detail |
|---|
public void service(ServiceManager manager)
throws ServiceException
Contextualize this component instance specifying its associated
ServiceManager instance.
service in interface Serviceablemanager - the ServiceManager to associate with this component.
ServiceException - if a dependancy of this could not be resolved.
public void configure(Configuration configuration)
throws ConfigurationException
Configure this component instance.
The only defined (but not required) configuration for this component is
<grammar>...string...</grammar>
indicating the default grammar used by this transformer used for parsing
schemas.
configure in interface Configurableconfiguration - a Configuration instance for this component.
ConfigurationException - never thrown.public void dispose()
Dispose of this component instance releasing all previously acquired
required instances back to the ServiceManager.
dispose in interface Disposable
public void setup(SourceResolver resolver,
Map objectModel,
String source,
Parameters parameters)
throws ProcessingException,
SAXException,
IOException
Contextualize this component in the scope of a pipeline when a request is processed.
setup in interface SitemapModelComponentresolver - the SourceResolver contextualized in this request.objectModel - unused.source - the source URI of the schema to validate against.parameters - unused.
ProcessingException
SAXException
IOExceptionpublic void setConsumer(XMLConsumer consumer)
Specify the XMLConsumer receiving SAX events emitted by this
Transformer instance in the scope of a request.
setConsumer in interface XMLProducersetConsumer in class AbstractXMLProducerconsumer - the XMLConsumer to send SAX events to.
public void endDocument()
throws SAXException
Receive notification of the end of the document and produce the report of the validation result.
endDocument in interface ContentHandlerendDocument in class AbstractXMLPipeSAXExceptionContentHandler.endDocument()public Serializable getKey()
Return the unique key to associated with the schema being processed in the scope of the request being processed for caching.
getKey in interface CacheableProcessingComponentString representing the unique key for the schema.public SourceValidity getValidity()
Return the SourceValidity associated with the schema currently
being processed in the scope of the request being processed.
getValidity in interface CacheableProcessingComponentSourceValidity instance.public void recycle()
Recycle this component instance at the end of request processing.
recycle in interface Recyclablerecycle in class AbstractXMLProducer
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||