Package org.iso_relax.verifier
Class VerifierFactory
java.lang.Object
org.iso_relax.verifier.VerifierFactory
VerifierFactory
- Since:
- Feb. 23, 2001
- Version:
- Apr. 17, 2001
- Author:
- ASAMI, Tomoharu (asami@zeomtech.com), Kohsuke KAWAGUCHI
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprocesses a schema into a Schema object, which is a compiled representation of a schema.compileSchema(InputStream stream) processes a schema into a Schema object, which is a compiled representation of a schema.compileSchema(InputStream stream, String systemId) processes a schema into a Schema object, which is a compiled representation of a schema.compileSchema(String url) processes a schema into a Schema object, which is a compiled representation of a schema.abstract Schemaprocesses a schema into a Schema object, which is a compiled representation of a schema.Gets the current entity resolver, which was set by theSetEntityResolvermethod.getProperty(String property) Gets property valuebooleanIndicates whether if the feature is supported, or not.static VerifierFactorynewInstance(String language) static VerifierFactorynewInstance(String language, ClassLoader classLoader) Creates a new instance of a VerifierFactory for the specified schema language.newVerifier(File file) parses a schema from the specified file and returns a Verifier object that validates documents by using that schema.newVerifier(InputStream stream) parses a schema from the specified InputStream and returns a Verifier object that validates documents by using that schema.newVerifier(InputStream stream, String systemId) parses a schema from the specified InputStream and returns a Verifier object that validates documents by using that schema.newVerifier(String uri) parses a schema at the specified location and returns a Verifier object that validates documents by using that schema.newVerifier(InputSource source) parses a schema from the specified InputSource and returns a Verifier object that validates documents by using that schema.voidsetEntityResolver(EntityResolver _resolver) Sets an EntityResolver This entity resolver is used to resolve entities encountered while parsing a schema.voidsetFeature(String feature, boolean value) Sets feature valuevoidsetProperty(String property, Object value) Sets property value
-
Constructor Details
-
VerifierFactory
public VerifierFactory()
-
-
Method Details
-
newVerifier
public Verifier newVerifier(String uri) throws VerifierConfigurationException, SAXException, IOException parses a schema at the specified location and returns a Verifier object that validates documents by using that schema.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.
- Parameters:
uri- URI of a schema file- Throws:
VerifierConfigurationExceptionSAXExceptionIOException
-
newVerifier
public Verifier newVerifier(File file) throws VerifierConfigurationException, SAXException, IOException parses a schema from the specified file and returns a Verifier object that validates documents by using that schema.- Parameters:
uri- File of a schema file- Throws:
VerifierConfigurationExceptionSAXExceptionIOException
-
newVerifier
public Verifier newVerifier(InputStream stream) throws VerifierConfigurationException, SAXException, IOException parses a schema from the specified InputStream and returns a Verifier object that validates documents by using that schema. -
newVerifier
public Verifier newVerifier(InputStream stream, String systemId) throws VerifierConfigurationException, SAXException, IOException parses a schema from the specified InputStream and returns a Verifier object that validates documents by using that schema.- Parameters:
systemId- System ID of this stream.- Throws:
VerifierConfigurationExceptionSAXExceptionIOException
-
newVerifier
public Verifier newVerifier(InputSource source) throws VerifierConfigurationException, SAXException, IOException parses a schema from the specified InputSource and returns a Verifier object that validates documents by using that schema.- Parameters:
source- InputSource of a schema file- Throws:
VerifierConfigurationExceptionSAXExceptionIOException
-
compileSchema
public abstract Schema compileSchema(InputSource is) throws VerifierConfigurationException, SAXException, IOException processes a schema into a Schema object, which is a compiled representation of a schema. The obtained schema object can then be used concurrently across multiple threads. -
compileSchema
public Schema compileSchema(String url) throws VerifierConfigurationException, SAXException, IOException processes a schema into a Schema object, which is a compiled representation of a schema. The obtained schema object can then be used concurrently across multiple threads.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.
- Parameters:
url- A source url of a schema file to be compiled.- Throws:
VerifierConfigurationExceptionSAXExceptionIOException
-
compileSchema
public Schema compileSchema(InputStream stream) throws VerifierConfigurationException, SAXException, IOException processes a schema into a Schema object, which is a compiled representation of a schema. The obtained schema object can then be used concurrently across multiple threads.- Parameters:
stream- A stream object that holds a schema.- Throws:
VerifierConfigurationExceptionSAXExceptionIOException
-
compileSchema
public Schema compileSchema(InputStream stream, String systemId) throws VerifierConfigurationException, SAXException, IOException processes a schema into a Schema object, which is a compiled representation of a schema. The obtained schema object can then be used concurrently across multiple threads.- Parameters:
systemId- The system Id of this input stream.- Throws:
VerifierConfigurationExceptionSAXExceptionIOException
-
compileSchema
public Schema compileSchema(File f) throws VerifierConfigurationException, SAXException, IOException processes a schema into a Schema object, which is a compiled representation of a schema. The obtained schema object can then be used concurrently across multiple threads.- Parameters:
file- A schema file to be compiled- Throws:
VerifierConfigurationExceptionSAXExceptionIOException
-
isFeature
Indicates whether if the feature is supported, or not.- Parameters:
feature- feature name- Throws:
SAXNotRecognizedExceptionSAXNotSupportedException
-
setFeature
public void setFeature(String feature, boolean value) throws SAXNotRecognizedException, SAXNotSupportedException Sets feature value- Parameters:
feature- feature namevalue- feature value- Throws:
SAXNotRecognizedExceptionSAXNotSupportedException
-
getProperty
public Object getProperty(String property) throws SAXNotRecognizedException, SAXNotSupportedException Gets property value- Parameters:
property- property name- Throws:
SAXNotRecognizedExceptionSAXNotSupportedException
-
setProperty
public void setProperty(String property, Object value) throws SAXNotRecognizedException, SAXNotSupportedException Sets property value- Parameters:
property- property namevalue- property value- Throws:
SAXNotRecognizedExceptionSAXNotSupportedException
-
setEntityResolver
Sets an EntityResolver This entity resolver is used to resolve entities encountered while parsing a schema. -
getEntityResolver
Gets the current entity resolver, which was set by theSetEntityResolvermethod. -
newInstance
public static VerifierFactory newInstance(String language, ClassLoader classLoader) throws VerifierConfigurationException Creates a new instance of a VerifierFactory for the specified schema language.- Parameters:
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.- Returns:
- a non-null valid VerifierFactory instance.
- Throws:
VerifierConfigurationException- if no implementation is available for the specified language.
-
newInstance
- Throws:
VerifierConfigurationException
-