Top Description Fields Methods
org.codehaus.stax2.validation

public Interface XMLValidationSchema

Known Direct Subinterfaces
org.codehaus.stax2.validation.DTDValidationSchema
Imports
javax.xml.stream.XMLStreamException

Defines the API that validator schema instances have to implement. Schema objects are results of parsing of input that defines validation rules; things like DTD files, W3c Schema input documents and so on. Schema instances can not be directly used for validation; they are blueprints for constructing such validator Objects. Because of this, they are also guaranteed to be thread-safe and reusable. One way to think of this is that schemas are actual validator factories instead of XMLValidationSchemaFactory instances.

One note about creation of validator instances: since the validation may be invoked from wide variety of contexts (from parser, from serializer, from processing pipeline etc), the validation context is abstracted as ValidationContext. Instances may make use of additional knowledge about actual implementing classes if they can safely determine the type runtime, but should gracefully handle the cases where the context is created by a caller that is not part of the same StAX implementation as the validator.

Field Summary

Modifier and TypeField and Description
public static final String
public static final String
public static final String
public static final String

Method Summary

Modifier and TypeMethod and Description
public XMLValidator
public String

Returns:

One of external schema identifier values (such as SCHEMA_ID_DTD).
getSchemaType
()

Returns type of this schema.

Field Detail

SCHEMA_ID_DTDback to summary
public static final String SCHEMA_ID_DTD
SCHEMA_ID_RELAXNGback to summary
public static final String SCHEMA_ID_RELAXNG
SCHEMA_ID_TREXback to summary
public static final String SCHEMA_ID_TREX
SCHEMA_ID_W3C_SCHEMAback to summary
public static final String SCHEMA_ID_W3C_SCHEMA

Method Detail

createValidatorback to summary
public XMLValidator createValidator(ValidationContext ctxt) throws XMLStreamException
getSchemaTypeback to summary
public String getSchemaType()

Returns type of this schema.

Returns:String

One of external schema identifier values (such as SCHEMA_ID_DTD).