sk.uniba.euromath.document.schema
Class ValidationContextImpl

java.lang.Object
  extended by sk.uniba.euromath.document.schema.ValidationContextImpl
All Implemented Interfaces:
IValidationContextP

public final class ValidationContextImpl
extends Object
implements IValidationContextP

Implementation of ValidationContextP.

Author:
Martin Vysny

Method Summary
 boolean isNotation(String notationName)
          Checks if a notation is declared with the specified name.
 boolean isUnparsedEntity(String entityName, String namespace)
          Checks if an unparsed entity is declared with the specified name.
 String resolveNamespacePrefix(String prefix)
          Resolves a namespace prefix to the corresponding namespace URI.
 void validate(Element element)
          Performs full validation over given element.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

isNotation

public boolean isNotation(String notationName)
Description copied from interface: IValidationContextP
Checks if a notation is declared with the specified name.

Specified by:
isNotation in interface IValidationContextP
Parameters:
notationName - the notation name
Returns:
true if such notation is declared.

isUnparsedEntity

public boolean isUnparsedEntity(String entityName,
                                String namespace)
Description copied from interface: IValidationContextP
Checks if an unparsed entity is declared with the specified name.

Specified by:
isUnparsedEntity in interface IValidationContextP
Parameters:
entityName - the entity name.
namespace - namespace, where this entity occured.
Returns:
true if document or appropriate schema has an unparsed entity declaration for the specified name. false otherwise.

resolveNamespacePrefix

public String resolveNamespacePrefix(String prefix)
Description copied from interface: IValidationContextP
Resolves a namespace prefix to the corresponding namespace URI. This method is used for validating the QName type, for example.

Specified by:
resolveNamespacePrefix in interface IValidationContextP
Parameters:
prefix - If the prefix is "" (empty string), it indicates an unprefixed value. Because of the prefix management, it will be always resolved to empty string. If the prefix is "xml", it will be resolved to "http://www.w3.org/XML/1998/namespace", as defined in the XML Namespaces Recommendation.
Returns:
namespace URI of this prefix, or null, if the specified prefix is not declared.

validate

public void validate(Element element)
              throws SchemaException
Description copied from interface: IValidationContextP
Performs full validation over given element. This element must be one of root elements from some schema, or an SchemaException will be thrown.

Specified by:
validate in interface IValidationContextP
Parameters:
element - element to be validated.
Throws:
SchemaException - thrown if element isn't the root element, or if given uri doesn't exist, or it is thrown by underlying schema.validate.


Copyright © 2003-2006 null. All Rights Reserved.