|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.cocoon.components.validation.impl.AbstractSchemaParser org.apache.cocoon.components.validation.jaxp.JaxpSchemaParser
public class JaxpSchemaParser
An implementation of the SchemaParser
interface wrapping JAXP
SchemaFactory
instances.
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 | |
---|---|
JaxpSchemaParser()
Create a new JaxpSchemaParser instance. |
Method Summary | |
---|---|
void |
configure(Configuration conf)
Configure this instance. |
String[] |
getSupportedGrammars()
Return an array of String s containing all the grammar languages
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 |
---|
public JaxpSchemaParser()
Create a new JaxpSchemaParser
instance.
Method Detail |
---|
public void configure(Configuration conf) throws ConfigurationException
Configure this instance.
The JaxpSchemaParser
requires at least one configuration element:
<factory-class>class name</factory-class>
.
This specifies the JAXP SchemaFactory
class to be used by this
instance.
Grammars will be automatically detected if the SchemaFactory
supports one of the RELAX-NG
grammar,
XML-Schema
grammar, or the
XML-DTD
grammar.
If the factory is known to support different grammars, the default detection can be overridden specifying in the configuration something similar to the following:
<grammars> <grammar>... a first grammar identifier ...</grammar> <grammar>... another grammar identifier ...</grammar> </grammars>
configure
in interface Configurable
ConfigurationException
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)
.
parseSchema
in interface SchemaParser
source
- the Source
associated with the Schema
to return.
Schema
instance.
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.public String[] getSupportedGrammars()
SchemaParser
Return an array of String
s containing all the grammar languages
supported by this SchemaParser
.
getSupportedGrammars
in interface SchemaParser
String
s.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |