The website http://hl7api.sourceforge.net/devbyexample.html
Section Validating Messages -> the link for "MessageVisitor for validating" is dead.
http://hl7api.sourceforge.net/xref/ca/uhn/hl7v2/examples/CustomMessageValidationWithValidatingVisitor.html
The xref is of HAPI v2.1. The example was added with 2.2