net.ontopia.topicmaps.schema.utils
Class HTMLValidationHandler

java.lang.Object
  extended by net.ontopia.topicmaps.schema.utils.HTMLValidationHandler
All Implemented Interfaces:
ValidationHandlerIF

public class HTMLValidationHandler
extends java.lang.Object
implements ValidationHandlerIF

INTERNAL: Validation handler that writes error reports (using some HTML markup) on each violation out to the given Writer.


Field Summary
protected  int errors
           
protected  java.io.Writer out
           
protected  StringifierIF stringifier
           
 
Constructor Summary
HTMLValidationHandler(java.io.Writer out)
           
 
Method Summary
 void endValidation()
          PUBLIC: Called after the validation of an entire topic map.
 int getErrors()
           
protected  java.lang.String printAssociationRole(AssociationRoleIF role)
           
protected  java.lang.String printConstraint(ConstraintIF constraint)
           
protected  java.lang.String printMatcher(TMObjectMatcherIF matcher)
           
protected  void printScope(java.util.Collection scope)
           
protected  java.lang.String printScopeSpec(ScopeSpecification scopespec)
           
protected  java.lang.String printTopic(TopicIF topic)
           
protected  java.lang.String printTypes(TopicIF topic)
           
protected  java.lang.String printTypeSpec(TypeSpecification typespec)
           
protected  java.lang.String printTypeSpecs(java.util.Collection specs)
           
 void startValidation()
          PUBLIC: Called before the validation of an entire topic map begins.
 void violation(java.lang.String message, TMObjectIF container, java.lang.Object offender, ConstraintIF constraint)
          PUBLIC: Called when violations of the schema are discovered.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

out

protected java.io.Writer out

errors

protected int errors

stringifier

protected StringifierIF stringifier
Constructor Detail

HTMLValidationHandler

public HTMLValidationHandler(java.io.Writer out)
Method Detail

startValidation

public void startValidation()
Description copied from interface: ValidationHandlerIF
PUBLIC: Called before the validation of an entire topic map begins. When single topics or associations are validated this method is not called.

Specified by:
startValidation in interface ValidationHandlerIF

violation

public void violation(java.lang.String message,
                      TMObjectIF container,
                      java.lang.Object offender,
                      ConstraintIF constraint)
               throws SchemaViolationException
Description copied from interface: ValidationHandlerIF
PUBLIC: Called when violations of the schema are discovered.

Specified by:
violation in interface ValidationHandlerIF
Parameters:
message - A message describing the nature of the violation.
container - The container of the offending object.
offender - The object that violated the schema.
constraint - The constraint that was violated.
Throws:
SchemaViolationException - Implementations may throw this exception if they wish to halt validation.

endValidation

public void endValidation()
Description copied from interface: ValidationHandlerIF
PUBLIC: Called after the validation of an entire topic map. When single topics or associations are validated this method is not called.

Specified by:
endValidation in interface ValidationHandlerIF

printScope

protected void printScope(java.util.Collection scope)
                   throws java.io.IOException
Throws:
java.io.IOException

printTypes

protected java.lang.String printTypes(TopicIF topic)

printTopic

protected java.lang.String printTopic(TopicIF topic)

printConstraint

protected java.lang.String printConstraint(ConstraintIF constraint)

printMatcher

protected java.lang.String printMatcher(TMObjectMatcherIF matcher)

printTypeSpecs

protected java.lang.String printTypeSpecs(java.util.Collection specs)

printTypeSpec

protected java.lang.String printTypeSpec(TypeSpecification typespec)

printScopeSpec

protected java.lang.String printScopeSpec(ScopeSpecification scopespec)

printAssociationRole

protected java.lang.String printAssociationRole(AssociationRoleIF role)

getErrors

public int getErrors()


Copyright © 2000-2012 Ontopia.