## org.exist.validation
Class Validator

    java.lang.Object
      org.exist.validation.Validator

public class Validator
extends java.lang.Object

Validate XML documents with their grammars (DTD's and Schemas).

Author:
  dizzzz

Constructor Summary
`Validator(BrokerPool pool)` Setup Validator object with brokerpool as centre.

Method Summary
`DatabaseResources` `getDatabaseResources()` Get access to internal DatabaseResources.
`GrammarPool` `getGrammarPool()` Get access to internal GrammarPool.
`void` `setGrammarPool(GrammarPool gp)`
`ValidationReport` `validate(java.io.InputStream is)` Validate XML data in inputstream.
`ValidationReport` `validate(java.io.InputStream is, java.lang.String grammarPath)` Validate XML data in inputstream.
`ValidationReport` `validate(java.io.Reader reader)` Validate XML data from reader.
`ValidationReport` `validate(java.io.Reader reader, java.lang.String grammarPath)` Validate XML data from reader using specified grammar.

Methods inherited from class java.lang.Object
`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### Validator

    public Validator(BrokerPool pool)

  Setup Validator object with brokerpool as centre.

Method Detail

### validate

    public ValidationReport validate(java.io.InputStream is)

  Validate XML data in inputstream.

  Parameters:
    `is` - XML input stream.
  Returns:
    Validation report containing all validation info.

### validate

    public ValidationReport validate(java.io.InputStream is,
                                     java.lang.String grammarPath)

  Validate XML data in inputstream.

  Parameters:
    `is` - XML input stream.
  Returns:
    Validation report containing all validation info.

### validate

    public ValidationReport validate(java.io.Reader reader)

  Validate XML data from reader.

  Parameters:
    `reader` - XML input
  Returns:
    Validation report containing all validation info.

### validate

    public ValidationReport validate(java.io.Reader reader,
                                     java.lang.String grammarPath)

  Validate XML data from reader using specified grammar. grammar path null : search all documents starting in /db /db/doc/ : start search start in specified collection /db/doc/schema/schema.xsd :start with this schema, no search needed.

  Parameters:
    `grammarPath` - User supplied path to grammar.
    `reader` - XML input.
  Returns:
    Validation report containing all validation info.

### getDatabaseResources

    public DatabaseResources getDatabaseResources()

  Get access to internal DatabaseResources.

  Returns:
    Internally used DatabaseResources.

### getGrammarPool

    public GrammarPool getGrammarPool()

  Get access to internal GrammarPool.

  Returns:
    Internally used GrammarPool.

### setGrammarPool

    public void setGrammarPool(GrammarPool gp)

Copyright (C) Wolfgang Meier. All rights reserved.