org.codehaus.spice.configkit
Class ConfigValidatorFactory

java.lang.Object
  |
  +--org.codehaus.spice.configkit.ConfigValidatorFactory

public final class ConfigValidatorFactory
extends Object

The ConfigValidatorFactory is responsible for creating ConfigValidator objects to validate configuration according to specified schemas.

Version:
$Revision: 1.1 $ $Date: 2003/12/03 03:19:28 $
Author:
Peter Donald

Field Summary
static String RELAX_NG
          A constant defining namespace of RELAX_NG schema language.
static String W3C_XML_SCHEMA
          A constant defining namespace of W3C XMLSchema language.
 
Constructor Summary
ConfigValidatorFactory()
           
 
Method Summary
static ConfigValidator create(org.xml.sax.InputSource inputSource)
          Create a ConfigValidator and guess Schema type.
static ConfigValidator create(org.xml.sax.InputSource inputSource, org.xml.sax.EntityResolver resolver)
          Create a ConfigValidator and guess Schema type.
static ConfigValidator create(InputStream inputStream)
          Create a ConfigValidator and guess Schema type.
static ConfigValidator create(String schemaType, org.xml.sax.InputSource inputSource)
          Create a ConfigValidator with specified type.
static ConfigValidator create(String schemaType, org.xml.sax.InputSource inputSource, org.xml.sax.EntityResolver entityResolver)
          Create a ConfigValidator with specified type.
static ConfigValidator create(String schemaType, InputStream inputStream)
          Create a ConfigValidator with specified type.
static ConfigValidator create(String schemaType, InputStream inputStream, org.xml.sax.EntityResolver resolver)
          Create a ConfigValidator with specified type.
static ConfigValidator create(String publicID, String systemID, ClassLoader classLoader)
          Create a ConfigValidator and attempt to guess Schema Type.
static ConfigValidator create(String schemaType, String publicID, String systemID, ClassLoader classLoader)
          Create a ConfigValidator with specified type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RELAX_NG

public static final String RELAX_NG
A constant defining namespace of RELAX_NG schema language.

See Also:
Constant Field Values

W3C_XML_SCHEMA

public static final String W3C_XML_SCHEMA
A constant defining namespace of W3C XMLSchema language.

See Also:
Constant Field Values
Constructor Detail

ConfigValidatorFactory

public ConfigValidatorFactory()
Method Detail

create

public static ConfigValidator create(String publicID,
                                     String systemID,
                                     ClassLoader classLoader)
                              throws Exception
Create a ConfigValidator and attempt to guess Schema Type. The config validator loads the schema from specified publicID, systemID, classloader combination using the ResolverFactory.

Parameters:
publicID - the publicID of schema (may be null)
systemID - the systemID of schema (may be null)
classLoader - the classloader from which to load schema
Returns:
the ConfigValidatorthat conforms to input
Throws:
Exception - if unable to create validator

create

public static ConfigValidator create(String schemaType,
                                     String publicID,
                                     String systemID,
                                     ClassLoader classLoader)
                              throws Exception
Create a ConfigValidator with specified type. The config validator loads the schema from specified publicID, systemID, classloader combination using the ResolverFactory.

Parameters:
schemaType - the type of the schema. (Usually a URL such as "http://relaxng.org/ns/structure/1.0")
publicID - the publicID of schema (may be null)
systemID - the systemID of schema (may be null)
classLoader - the classloader from which to load schema
Returns:
the ConfigValidatorthat conforms to input
Throws:
Exception - if unable to create validator

create

public static ConfigValidator create(InputStream inputStream)
                              throws Exception
Create a ConfigValidator and guess Schema type. The schema is loaded from specified stream.

Parameters:
inputStream - the stream to load schema from
Returns:
the ConfigValidatorthat conforms to input
Throws:
Exception - if unable to create validator

create

public static ConfigValidator create(String schemaType,
                                     InputStream inputStream)
                              throws Exception
Create a ConfigValidator with specified type. The schema is loaded from specified stream.

Parameters:
schemaType - the type of the schema. (Usually a URL such as "http://relaxng.org/ns/structure/1.0")
inputStream - the stream to load schema from
Returns:
the ConfigValidatorthat conforms to input
Throws:
Exception - if unable to create validator

create

public static ConfigValidator create(String schemaType,
                                     InputStream inputStream,
                                     org.xml.sax.EntityResolver resolver)
                              throws Exception
Create a ConfigValidator with specified type. The schema is loaded from specified stream.

Parameters:
schemaType - the type of the schema. (Usually a URL such as "http://relaxng.org/ns/structure/1.0")
inputStream - the stream to load schema from
resolver - a resolver used to resolve entitys for input data
Returns:
the ConfigValidatorthat conforms to input
Throws:
Exception - if unable to create validator

create

public static ConfigValidator create(org.xml.sax.InputSource inputSource)
                              throws Exception
Create a ConfigValidator and guess Schema type. The schema is loaded from specified source.

Parameters:
inputSource - the source to load schema from
Returns:
the ConfigValidatorthat conforms to input
Throws:
Exception - if unable to create validator

create

public static ConfigValidator create(org.xml.sax.InputSource inputSource,
                                     org.xml.sax.EntityResolver resolver)
                              throws Exception
Create a ConfigValidator and guess Schema type. The schema is loaded from specified source.

Parameters:
inputSource - the source to load schema from
resolver - a resolver used to resolve entitys for input data
Returns:
the ConfigValidatorthat conforms to input
Throws:
Exception - if unable to create validator

create

public static ConfigValidator create(String schemaType,
                                     org.xml.sax.InputSource inputSource)
                              throws Exception
Create a ConfigValidator with specified type. The schema is loaded from specified source.

Parameters:
schemaType - the type of the schema. (Usually a URL such as "http://relaxng.org/ns/structure/1.0")
inputSource - the source to load schema from
Returns:
the ConfigValidatorthat conforms to input
Throws:
Exception - if unable to create validator

create

public static ConfigValidator create(String schemaType,
                                     org.xml.sax.InputSource inputSource,
                                     org.xml.sax.EntityResolver entityResolver)
                              throws Exception
Create a ConfigValidator with specified type. The schema is loaded from specified source. Also specified is entity resolver used when loading files to validate.

Parameters:
schemaType - the type of the schema. (Usually a URL such as "http://relaxng.org/ns/structure/1.0")
inputSource - the source to load schema from
entityResolver - a resolver used to resolve entitys for input data
Returns:
the ConfigValidatorthat conforms to input
Throws:
Exception - if unable to create validator


Copyright © 2003 Codehaus. All Rights Reserved.