net.ontopia.topicmaps.schema.impl.osl
Class SchemaValidator

java.lang.Object
  extended by net.ontopia.topicmaps.schema.impl.osl.SchemaValidator
All Implemented Interfaces:
SchemaValidatorIF

public class SchemaValidator
extends java.lang.Object
implements SchemaValidatorIF

INTERNAL: A schema validator that can be used to validate topic map constructs against an OSL schema. The schema validator is bound to a particular OSL schema.


Field Summary
protected  ValidationHandlerIF handler
           
protected  OSLSchema schema
           
 
Method Summary
protected  ConstraintIF findClass(TMObjectIF object, java.util.Collection classes)
           
protected  ConstraintIF findClass(TopicIF topic, java.util.Collection classes)
           
protected  ConstraintIF findClassFor(TopicIF tclass, java.util.Collection classes)
           
protected  TopicIF getTopic(TopicClass klass, TopicMapIF tm)
           
 ValidationHandlerIF getValidationHandler()
          PUBLIC: Returns the validation handler that violations are currently reported to.
 void setValidationHandler(ValidationHandlerIF handler)
          PUBLIC: Sets the validation handler that violations of the schema will be reported to.
 void validate(AssociationIF association)
          PUBLIC: Validates an association against the schema.
protected  void validate(AssociationRoleIF role, AssociationRoleConstraint constraint)
           
protected  void validate(AssociationRoleIF role, TopicRoleConstraint constraint)
           
protected  void validate(OccurrenceIF occ, OccurrenceConstraint constraint)
           
protected  void validate(TMObjectIF container, java.util.Collection constraints, java.util.Collection objects)
           
protected  void validate(TMObjectIF container, java.util.Collection constraints, java.util.Collection objects, boolean strict)
           
protected  void validate(TMObjectIF object, ConstraintIF constraint)
           
 void validate(TopicIF topic)
          PUBLIC: Validates a topic against the schema.
 void validate(TopicMapIF topicmap)
          PUBLIC: Validates a topic map against the schema.
protected  void validate(TopicNameIF basename, TopicNameConstraint constraint)
           
protected  void validate(VariantNameIF variant, VariantConstraint constraint)
           
protected  void validateScope(TMObjectIF container, ScopedIF scoped, ScopedConstraintIF constraint)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

schema

protected OSLSchema schema

handler

protected ValidationHandlerIF handler
Method Detail

validate

public void validate(TopicIF topic)
              throws SchemaViolationException
Description copied from interface: SchemaValidatorIF
PUBLIC: Validates a topic against the schema.

Specified by:
validate in interface SchemaValidatorIF
Throws:
SchemaViolationException

validate

public void validate(TopicMapIF topicmap)
              throws SchemaViolationException
Description copied from interface: SchemaValidatorIF
PUBLIC: Validates a topic map against the schema. The startValidation and endValidation methods of the ValidationHandlerIF interface are called before and after validation.

Specified by:
validate in interface SchemaValidatorIF
Throws:
SchemaViolationException

validate

public void validate(AssociationIF association)
              throws SchemaViolationException
Description copied from interface: SchemaValidatorIF
PUBLIC: Validates an association against the schema.

Specified by:
validate in interface SchemaValidatorIF
Throws:
SchemaViolationException

setValidationHandler

public void setValidationHandler(ValidationHandlerIF handler)
Description copied from interface: SchemaValidatorIF
PUBLIC: Sets the validation handler that violations of the schema will be reported to.

Specified by:
setValidationHandler in interface SchemaValidatorIF

getValidationHandler

public ValidationHandlerIF getValidationHandler()
Description copied from interface: SchemaValidatorIF
PUBLIC: Returns the validation handler that violations are currently reported to.

Specified by:
getValidationHandler in interface SchemaValidatorIF

validate

protected void validate(TMObjectIF container,
                        java.util.Collection constraints,
                        java.util.Collection objects)
                 throws SchemaViolationException
Throws:
SchemaViolationException

validate

protected void validate(TMObjectIF container,
                        java.util.Collection constraints,
                        java.util.Collection objects,
                        boolean strict)
                 throws SchemaViolationException
Throws:
SchemaViolationException

validate

protected void validate(TMObjectIF object,
                        ConstraintIF constraint)
                 throws SchemaViolationException
Throws:
SchemaViolationException

validate

protected void validate(TopicNameIF basename,
                        TopicNameConstraint constraint)
                 throws SchemaViolationException
Throws:
SchemaViolationException

validate

protected void validate(VariantNameIF variant,
                        VariantConstraint constraint)

validate

protected void validate(OccurrenceIF occ,
                        OccurrenceConstraint constraint)
                 throws SchemaViolationException
Throws:
SchemaViolationException

validate

protected void validate(AssociationRoleIF role,
                        TopicRoleConstraint constraint)
                 throws SchemaViolationException
Throws:
SchemaViolationException

validate

protected void validate(AssociationRoleIF role,
                        AssociationRoleConstraint constraint)
                 throws SchemaViolationException
Throws:
SchemaViolationException

validateScope

protected void validateScope(TMObjectIF container,
                             ScopedIF scoped,
                             ScopedConstraintIF constraint)
                      throws SchemaViolationException
Throws:
SchemaViolationException

findClass

protected ConstraintIF findClass(TMObjectIF object,
                                 java.util.Collection classes)

findClass

protected ConstraintIF findClass(TopicIF topic,
                                 java.util.Collection classes)

findClassFor

protected ConstraintIF findClassFor(TopicIF tclass,
                                    java.util.Collection classes)

getTopic

protected TopicIF getTopic(TopicClass klass,
                           TopicMapIF tm)


Copyright © 2000-2012 Ontopia.