Package org.xmlunit.validation
Class Validator
- java.lang.Object
-
- org.xmlunit.validation.Validator
-
- Direct Known Subclasses:
JAXPValidator
,ParsingValidator
public abstract class Validator extends java.lang.Object
Validates a piece of XML against a schema given in a supported language or the definition of such a schema itself.
-
-
Field Summary
Fields Modifier and Type Field Description private javax.xml.transform.Source[]
sourceLocations
-
Constructor Summary
Constructors Modifier Constructor Description protected
Validator()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static Validator
forLanguage(java.lang.String language)
Factory that obtains a Validator instance based on the schema language.protected javax.xml.transform.Source[]
getSchemaSources()
Where to find the schema.void
setSchemaSource(javax.xml.transform.Source s)
Where to find the schema.void
setSchemaSources(javax.xml.transform.Source... s)
Where to find the schema.abstract ValidationResult
validateInstance(javax.xml.transform.Source instance)
Validates an instance against the schema.abstract ValidationResult
validateSchema()
Validates a schema.
-
-
-
Method Detail
-
setSchemaSources
public void setSchemaSources(javax.xml.transform.Source... s)
Where to find the schema.
-
setSchemaSource
public final void setSchemaSource(javax.xml.transform.Source s)
Where to find the schema.
-
getSchemaSources
protected javax.xml.transform.Source[] getSchemaSources()
Where to find the schema.
-
validateSchema
public abstract ValidationResult validateSchema()
Validates a schema.- Throws:
java.lang.UnsupportedOperationException
- if the language's implementation doesn't support schema validation
-
validateInstance
public abstract ValidationResult validateInstance(javax.xml.transform.Source instance)
Validates an instance against the schema.
-
-