org.apache.cocoon.components.validation.jing
Class JingSchemaParser

java.lang.Object
  extended by org.apache.cocoon.components.validation.impl.AbstractSchemaParser
      extended by org.apache.cocoon.components.validation.jing.JingSchemaParser
All Implemented Interfaces:
Disposable, Initializable, LogEnabled, Serviceable, ThreadSafe, SchemaParser

public class JingSchemaParser
extends AbstractSchemaParser
implements ThreadSafe

A SchemaParser implementation for the RELAX NG grammar using the JING validation engine.


Field Summary
 
Fields inherited from class org.apache.cocoon.components.validation.impl.AbstractSchemaParser
entityResolver, logger, serviceManager, sourceResolver
 
Fields inherited from interface org.apache.cocoon.components.validation.SchemaParser
ROLE
 
Constructor Summary
JingSchemaParser()
          Create a new JingSchemaParser instance.
 
Method Summary
 String[] getSupportedGrammars()
          Return an array of Strings containing all schema grammars supported by this SchemaParser.
 Schema parseSchema(Source source, String grammar)
          Parse the specified Source and return a new Schema.
 
Methods inherited from class org.apache.cocoon.components.validation.impl.AbstractSchemaParser
dispose, enableLogging, initialize, service
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JingSchemaParser

public JingSchemaParser()

Create a new JingSchemaParser instance.

Method Detail

parseSchema

public Schema parseSchema(Source source,
                          String grammar)
                   throws SAXException,
                          IOException

Parse the specified Source and return a new Schema.

The returned Schema must be able to validate multiple documents via multiple invocations of Schema.createValidator(ErrorHandler).

Specified by:
parseSchema in interface SchemaParser
Parameters:
source - the Source associated with the Schema to return.
Returns:
a non-null Schema instance.
Throws:
SAXException - if a grammar error occurred parsing the schema.
IOException - if an I/O error occurred parsing the schema.
IllegalArgumentException - if the specified grammar type is not one of the grammar types returned by the getSupportedGrammars() method.

getSupportedGrammars

public String[] getSupportedGrammars()

Return an array of Strings containing all schema grammars supported by this SchemaParser.

The JingSchemaParser supports only the RELAX NG grammar.

Specified by:
getSupportedGrammars in interface SchemaParser
Returns:
a non-null array of Strings.


Copyright © 1999-2010 The Apache Software Foundation. All Rights Reserved.