net.ontopia.topicmaps.schema.utils
Class TextValidationHandler

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

public class TextValidationHandler
extends java.lang.Object
implements ValidationHandlerIF

PUBLIC: Validation handler that writes error reports on each violation out to the given PrintStream. The default PrintStream is System.err.


Field Summary
protected  java.io.PrintStream err
           
protected  int errors
           
protected  StringifierIF stringifier
           
 
Constructor Summary
TextValidationHandler()
          PUBLIC: Creates a validation handler that writes to System.err.
TextValidationHandler(java.io.PrintStream err)
          PUBLIC: Creates a validation handler that writes to the given PrintStream instance.
 
Method Summary
 void endValidation()
          PUBLIC: Called after the validation of an entire topic map.
protected  java.lang.String getClassName(java.lang.Object object)
           
 StringifierIF getStringifier()
          PUBLIC: Gets the stringifier implementation used to write out topics related to errors.
protected  TopicIF getType(TopicIF topic)
           
protected  java.lang.String printConstraint(ConstraintIF constraint)
           
protected  void printScope(java.util.Collection scope)
           
protected  java.lang.String printTopic(TopicIF topic)
           
 void setStringifier(StringifierIF stringifier)
          PUBLIC: Sets the stringifier implementation used to write out topics related to errors.
 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

err

protected java.io.PrintStream err

stringifier

protected StringifierIF stringifier

errors

protected int errors
Constructor Detail

TextValidationHandler

public TextValidationHandler()
PUBLIC: Creates a validation handler that writes to System.err.


TextValidationHandler

public TextValidationHandler(java.io.PrintStream err)
PUBLIC: Creates a validation handler that writes to the given PrintStream instance.

Method Detail

getStringifier

public StringifierIF getStringifier()
PUBLIC: Gets the stringifier implementation used to write out topics related to errors.


setStringifier

public void setStringifier(StringifierIF stringifier)
PUBLIC: Sets the stringifier implementation used to write out topics related to errors.


violation

public void violation(java.lang.String message,
                      TMObjectIF container,
                      java.lang.Object offender,
                      ConstraintIF constraint)
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.

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

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)

printTopic

protected java.lang.String printTopic(TopicIF topic)

printConstraint

protected java.lang.String printConstraint(ConstraintIF constraint)

getType

protected TopicIF getType(TopicIF topic)

getClassName

protected java.lang.String getClassName(java.lang.Object object)


Copyright © 2000-2012 Ontopia.