sk.uniba.euromath.document.schema
Class Validator

java.lang.Object
  extended by sk.uniba.euromath.document.schema.Validator

public final class Validator
extends Object

Manages validator switching when validating document with multiple namespaces. Thread-safe.

Author:
Martin Vysny

Method Summary
static Validator getInstance()
          Returns one and only instance of this class.
 void validate(Attr attr)
          Validates this attribute by appropriate schema.
 void validate(Element element, SchemaReferences ref)
          Performs full validation over given element.
 void validateAttr(String namespaceUri, String localName, String qname, Element owner, String value)
          Validates this attribute by appropriate schema.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static Validator getInstance()
Returns one and only instance of this class.

Returns:
singleton instance.

validate

public void validate(Element element,
                     SchemaReferences ref)
              throws SchemaException
Performs full validation over given element. This element must be one of root elements from some schema, or an SchemaException will be thrown. This function must NOT be used by the Schema object.

Parameters:
element - element to be validated.
ref - reference to schema manager for the document.
Throws:
SchemaException - thrown if element isn't the root element, or by underlying schema.validate.
SchemaException - if given uri doesn't exist.

validateAttr

public void validateAttr(String namespaceUri,
                         String localName,
                         String qname,
                         Element owner,
                         String value)
                  throws SchemaException
Validates this attribute by appropriate schema.

Parameters:
namespaceUri - namespace of attribute. It must not be empty namespace.
localName - localName of attribute.
qname - displayable qualified name, in form of prefix:localname
owner - owner element.
value - value of the attribute.
Throws:
SchemaException - if attribute is not exportable or invalid.

validate

public void validate(Attr attr)
              throws SchemaException
Validates this attribute by appropriate schema.

Parameters:
attr - attribute to validate. It must not have empty namespace.
Throws:
SchemaException - when an attribute mismatch had been found.


Copyright © 2003-2006 null. All Rights Reserved.