org.apache.uima.annotator.regex.extension
Interface Validation

All Known Implementing Classes:
CreditCardNumberValidator, ISBNNumberValidator

public interface Validation

The Validation interface is provided to implement a custom validator that can be used to validate an annotation before it is created.


Method Summary
 boolean validate(java.lang.String coveredText, java.lang.String ruleID)
          The validate method validates the covered text of an annotator and returns true or false whether the annotation is correct or not.
 

Method Detail

validate

boolean validate(java.lang.String coveredText,
                 java.lang.String ruleID)
                 throws java.lang.Exception
The validate method validates the covered text of an annotator and returns true or false whether the annotation is correct or not. The validate method is called between a rule match and the annotation creation. The annotation is only created if the method returns true.

Parameters:
coveredText - covered text of the annotation that should be validated
ruleID - ruleID of the rule which created the match
Returns:
true if the annotation is valid or false if the annotation is invalid
Throws:
java.lang.Exception - throws an exception if an validation error occurred


Copyright © 2011. All Rights Reserved.