public abstract class VerifierFactory extends Object
| Constructor and Description |
|---|
VerifierFactory() |
| Modifier and Type | Method and Description |
|---|---|
Schema |
compileSchema(File f)
processes a schema into a Schema object, which is a compiled representation
of a schema.
|
abstract Schema |
compileSchema(InputSource is)
processes a schema into a Schema object, which is a compiled representation
of a schema.
|
Schema |
compileSchema(InputStream stream)
processes a schema into a Schema object, which is a compiled representation
of a schema.
|
Schema |
compileSchema(InputStream stream,
String systemId)
processes a schema into a Schema object, which is a compiled representation
of a schema.
|
Schema |
compileSchema(String url)
processes a schema into a Schema object, which is a compiled representation
of a schema.
|
EntityResolver |
getEntityResolver()
Gets the current entity resolver, which was set by the
SetEntityResolver method. |
Object |
getProperty(String property)
Gets property value
|
boolean |
isFeature(String feature)
Indicates whether if the feature is supported, or not.
|
static VerifierFactory |
newInstance()
Deprecated.
|
static VerifierFactory |
newInstance(String language) |
static VerifierFactory |
newInstance(String language,
ClassLoader classLoader)
Creates a new instance of a VerifierFactory for the specified schema
language.
|
Verifier |
newVerifier(File file)
parses a schema from the specified file and returns a Verifier object that
validates documents by using that schema.
|
Verifier |
newVerifier(InputSource source)
parses a schema from the specified InputSource and returns a Verifier
object that validates documents by using that schema.
|
Verifier |
newVerifier(InputStream stream)
parses a schema from the specified InputStream and returns a Verifier
object that validates documents by using that schema.
|
Verifier |
newVerifier(InputStream stream,
String systemId)
parses a schema from the specified InputStream and returns a Verifier
object that validates documents by using that schema.
|
Verifier |
newVerifier(String uri)
parses a schema at the specified location and returns a Verifier object
that validates documents by using that schema.
|
void |
setEntityResolver(EntityResolver _resolver)
Sets an EntityResolver This entity resolver is used to resolve entities
encountered while parsing a schema.
|
void |
setFeature(String feature,
boolean value)
Sets feature value
|
void |
setProperty(String property,
Object value)
Sets property value
|
public Verifier newVerifier(String uri) throws VerifierConfigurationException, SAXException, IOException
Some of XML parsers accepts filenames as well as URLs, while others reject them. Therefore, to parse a file as a schema, you should use a File object.
uri - URI of a schema fileVerifierConfigurationExceptionSAXExceptionIOExceptionpublic Verifier newVerifier(File file) throws VerifierConfigurationException, SAXException, IOException
file - File of a schema fileVerifierConfigurationExceptionSAXExceptionIOExceptionpublic Verifier newVerifier(InputStream stream) throws VerifierConfigurationException, SAXException, IOException
public Verifier newVerifier(InputStream stream, String systemId) throws VerifierConfigurationException, SAXException, IOException
systemId - System ID of this stream.VerifierConfigurationExceptionSAXExceptionIOExceptionpublic Verifier newVerifier(InputSource source) throws VerifierConfigurationException, SAXException, IOException
source - InputSource of a schema fileVerifierConfigurationExceptionSAXExceptionIOExceptionpublic abstract Schema compileSchema(InputSource is) throws VerifierConfigurationException, SAXException, IOException
public Schema compileSchema(String url) throws VerifierConfigurationException, SAXException, IOException
Some of XML parsers accepts filenames as well as URLs, while others reject them. Therefore, to parse a file as a schema, you should use a File object.
url - A source url of a schema file to be compiled.VerifierConfigurationExceptionSAXExceptionIOExceptionpublic Schema compileSchema(InputStream stream) throws VerifierConfigurationException, SAXException, IOException
stream - A stream object that holds a schema.VerifierConfigurationExceptionSAXExceptionIOExceptionpublic Schema compileSchema(InputStream stream, String systemId) throws VerifierConfigurationException, SAXException, IOException
systemId - The system Id of this input stream.VerifierConfigurationExceptionSAXExceptionIOExceptionpublic Schema compileSchema(File f) throws VerifierConfigurationException, SAXException, IOException
f - A schema file to be compiledVerifierConfigurationExceptionSAXExceptionIOExceptionpublic boolean isFeature(String feature) throws SAXNotRecognizedException
feature - feature nameSAXNotRecognizedExceptionpublic void setFeature(String feature, boolean value) throws SAXNotRecognizedException
feature - feature namevalue - feature valueSAXNotRecognizedExceptionpublic Object getProperty(String property) throws SAXNotRecognizedException
property - property nameSAXNotRecognizedExceptionpublic void setProperty(String property, Object value) throws SAXNotRecognizedException
property - property namevalue - property valueSAXNotRecognizedExceptionpublic void setEntityResolver(EntityResolver _resolver)
public EntityResolver getEntityResolver()
SetEntityResolver method.@Deprecated public static VerifierFactory newInstance() throws VerifierConfigurationException
VerifierConfigurationExceptionpublic static VerifierFactory newInstance(String language, ClassLoader classLoader) throws VerifierConfigurationException
language - URI that specifies the schema language.
It is preferable to use the namespace URI of the schema language to designate the schema language. For example,
| URI | language |
|---|---|
| http://relaxng.org/ns/structure/0.9 | RELAX NG |
| http://www.xml.gr.jp/xmlns/relaxCore | RELAX Core |
| http://www.xml.gr.jp/xmlns/relaxNamespace | RELAX Namespace |
| http://www.thaiopensource.com/trex | TREX |
| http://www.w3.org/2001/XMLSchema | W3C XML Schema |
| http://www.w3.org/XML/1998/namespace | XML DTD |
classLoader - This class loader is used to search the available implementation.VerifierConfigurationException - if no implementation is available for the specified language.public static VerifierFactory newInstance(String language) throws VerifierConfigurationException
VerifierConfigurationExceptionCopyright © 2016 Philip Helger. All rights reserved.