public class TextValidationHandler extends Object implements ValidationHandlerIF
| Modifier and Type | Field and Description |
|---|---|
protected PrintStream |
err |
protected int |
errors |
| Constructor and Description |
|---|
TextValidationHandler()
PUBLIC: Creates a validation handler that writes to System.err.
|
TextValidationHandler(PrintStream err)
PUBLIC: Creates a validation handler that writes to the given
PrintStream instance.
|
| Modifier and Type | Method and Description |
|---|---|
void |
endValidation()
PUBLIC: Called after the validation of an entire topic map.
|
protected String |
getClassName(Object object) |
protected TopicIF |
getType(TopicIF topic) |
protected String |
printConstraint(ConstraintIF constraint) |
protected void |
printScope(Collection scope) |
protected String |
printTopic(TopicIF topic) |
void |
startValidation()
PUBLIC: Called before the validation of an entire topic map
begins.
|
void |
violation(String message,
TMObjectIF container,
Object offender,
ConstraintIF constraint)
PUBLIC: Called when violations of the schema are discovered.
|
protected PrintStream err
protected int errors
public TextValidationHandler()
public TextValidationHandler(PrintStream err)
public void violation(String message, TMObjectIF container, Object offender, ConstraintIF constraint)
ValidationHandlerIFviolation in interface ValidationHandlerIFmessage - 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.public void startValidation()
ValidationHandlerIFstartValidation in interface ValidationHandlerIFpublic void endValidation()
ValidationHandlerIFendValidation in interface ValidationHandlerIFprotected void printScope(Collection scope)
protected String printConstraint(ConstraintIF constraint)