Javax.xml.validation.Validator Class



Introduction

The javax.xml.validation.Validator class is a processor that checks an XML document against Schema.A validator object is not thread-safe and not reentrant.

Class declaration

Following is the declaration for javax.xml.validation.Validator class −

public abstract class Validator
   extends Object

Class constructors

S.N. Constructor & Description
1 protected Validator()

This is the constructor for derived classes.

Class methods

S.N. Method & Description
1

abstract ErrorHandler getErrorHandler()

This method gets the current ErrorHandler set to this Validator.

2

boolean getFeature(String name)

This method look up the value of a feature flag.

3

Object getProperty(String name)

This method look up the value of a property.

4

abstract LSResourceResolver getResourceResolver()

This method gets the current LSResourceResolver set to this Validator.

5

abstract void setErrorHandler(ErrorHandler errorHandler)

This method sets the ErrorHandler to receive errors encountered during the validate method invocation.

6

void setFeature(String name, boolean value)

This method sets the value of a feature flag.

7

void setProperty(String name, Object object)

This method sets the value of a property.

8

abstract void setResourceResolver(LSResourceResolver resourceResolver)

This method sets the LSResourceResolver to customize resource resolution while in a validation episode.

9

void validate(Source source)

This method validates the specified input.

10

abstract void validate(Source source, Result result)

This method validates the specified input and send the augmented validation result to the specified output.

Methods inherited

This class inherits methods from the following classes −

java.lang.Object

Advertisements