com.ibm.sketch.utilities
Class QualityChecker

java.lang.Object
  |
  +--com.ibm.sketch.utilities.QualityChecker

public class QualityChecker
extends java.lang.Object

QualityChecker class defines methods to read in a W3C XML Schema and to check for its validity.


Field Summary
static java.lang.String copyright
           
 
Constructor Summary
QualityChecker()
           
 
Method Summary
 IError[] findErrors(java.net.URL schemaLocation)
          returns all errors found in the schema located at a given location.
 IError[] findErrors(java.net.URL schemaLocation, int maximumCheckCost, java.lang.String language, java.lang.String userLevel)
          returns all errors found in the schema located at a given location.
 IError[] findErrors(java.net.URL schemaLocation, int maximumCheckCost, java.lang.String language, java.lang.String userLevel, java.util.Vector schemas)
          returns all errors found in the schema located at a given location.
 IError[] findErrors(java.net.URL schemaLocation, int maximumCheckCost, java.lang.String language, java.lang.String userLevel, java.util.Vector schemas, boolean requireEachDocumentValid)
          returns all errors found in the schema located at a given location.
 ILocationCorrespondance getLocationCorrespondance()
          returns the ILocationCorrespondance object that can be used to redirect connections to certain resources to others.
 boolean getWSDL()
          returns whether the validation of schemas embedded inside WSDL documents is enabled.
 boolean getXForm()
          returns whether the validation of schemas embedded inside XForms is enabled.
 void setEmbedddedSchemas(boolean processEmbeddedSchemas)
          enables or disables the processing of embedded schemas.
 void setSchemaLocation(java.lang.String uri, java.net.URL location)
          specifies the location of the schema to use to validate elements and attributes of a given namespace.
 void setWSDL(boolean processWSDL)
          enables or disables the validation of embedded schemas in a WSDL document.
 void setXFORM(boolean processXForm)
          enables or disables the validation of embedded schemas in a XForm.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

copyright

public static final java.lang.String copyright
Constructor Detail

QualityChecker

public QualityChecker()
Method Detail

findErrors

public IError[] findErrors(java.net.URL schemaLocation)
returns all errors found in the schema located at a given location. It returns null if the schema is valid.
Parameters:
schemaLocation - java.net.URL the location of the schema to check for validity

findErrors

public IError[] findErrors(java.net.URL schemaLocation,
                           int maximumCheckCost,
                           java.lang.String language,
                           java.lang.String userLevel)
returns all errors found in the schema located at a given location. It returns null if the schema is valid.
Parameters:
schemaLocation - java.net.URL the location of the schema to check for validity
language - String the language in which errors will be described. (for the moment, only "USEnglish" is accepted)
userLevel - String a string indicating how familar the user is with XML Schema.
maximumCheckCost - int. The maximum cost allowed for a check operation.

To check that a constraint on schema is valid, we use objects called Checkers. The cost of a check operation depends on the complexity of the check to perform. Each checker object specifies a cost which is an integer between 0 to 10 : 0 is the cost of the less expensive checkers and 10 the cost of the most expensive ones.

Only Checkers whose cost is less than or equal to maximumCheckCost will be activated and will be able to perform their check operations.

Set maximumCheckCost to 10 in order to have all checkers activated.

See Also:
IError

findErrors

public IError[] findErrors(java.net.URL schemaLocation,
                           int maximumCheckCost,
                           java.lang.String language,
                           java.lang.String userLevel,
                           java.util.Vector schemas)
returns all errors found in the schema located at a given location. It returns null if the schema is valid.
Parameters:
schemaLocation - java.net.URL the location of the schema to check for validity
language - String the language in which errors will be described. (for the moment, Only "USEnglish" is accepted)
userLevel - String a string indicating how familar the user is with XML Schema.
maximumCheckCost - int. The maximum cost allowed for a check operation.

To check that a constraint on schema is valid, we use objects called Checkers. The cost of a check operation depends on the complexity of the check to perform. Each checker object specifies a cost which is an integer between 0 to 10 : 0 is the cost of the less expensive checkers and 10 the cost of the most expensive ones.

Only Checkers whose cost is less than or equal to maximumCheckCost will be activated and will be able to perform their check operations.

Set maximumCheckCost to 10 in order to have all checkers activated.

Vector - schemas . The schema located at schemaLocation will be added in this Vector
See Also:
IError

findErrors

public IError[] findErrors(java.net.URL schemaLocation,
                           int maximumCheckCost,
                           java.lang.String language,
                           java.lang.String userLevel,
                           java.util.Vector schemas,
                           boolean requireEachDocumentValid)
returns all errors found in the schema located at a given location. It returns null if the schema is valid.
Parameters:
schemaLocation - java.net.URL the location of the schema to check for validity
language - String the language in which errors will be described. (for the moment, Only "USEnglish" is accepted)
userLevel - String a string indicating how familar the user is with XML Schema.
maximumCheckCost - int. The maximum cost allowed for a check operation.

To check that a constraint on schema is valid, we use objects called Checkers. The cost of a check operation depends on the complexity of the check to perform. Each checker object specifies a cost which is an integer between 0 to 10 : 0 is the cost of the less expensive checkers and 10 the cost of the most expensive ones.

Only Checkers whose cost is less than or equal to maximumCheckCost will be activated and will be able to perform their check operations.

Set maximumCheckCost to 10 in order to have all checkers activated.

Vector - schemas . The schema located at schemaLocation will be added in this Vector
requireEachDocumentValid - boolean specify whether or not each schema file used by the main schema located at schemaLocation must be valid by itself.
See Also:
IError

getLocationCorrespondance

public ILocationCorrespondance getLocationCorrespondance()
returns the ILocationCorrespondance object that can be used to redirect connections to certain resources to others.

If you want to perform URL connection redirection, you must call this method before opening any URL connection. In this case, we strongly recommend to start your program with a call to this method.

NOTE. In order to have ILocationCorrespondance information taken into account, QualityChecker must have java.lang.RuntimePermission("setFactory") and java.net.NetPermission("specifyStreamHandler")

See Also:
ILocationCorrespondance

setEmbedddedSchemas

public void setEmbedddedSchemas(boolean processEmbeddedSchemas)
enables or disables the processing of embedded schemas.

setWSDL

public void setWSDL(boolean processWSDL)
enables or disables the validation of embedded schemas in a WSDL document.

setXFORM

public void setXFORM(boolean processXForm)
enables or disables the validation of embedded schemas in a XForm.

setSchemaLocation

public void setSchemaLocation(java.lang.String uri,
                              java.net.URL location)
specifies the location of the schema to use to validate elements and attributes of a given namespace. This information will also be used to resolve references to components defined in the "uri" namespace.

getWSDL

public boolean getWSDL()
returns whether the validation of schemas embedded inside WSDL documents is enabled.
See Also:
setWSDL(boolean)

getXForm

public boolean getXForm()
returns whether the validation of schemas embedded inside XForms is enabled.
See Also:
setXForm(boolean)