if ( annotation != null ) {
try {
Validate validateAnnotation = (Validate)annotation;
String ruleStr = validateAnnotation.value();
XmlElement validateElement = new NanoXmlElement();
String extraStr = validateAnnotation.extra();
StringTokenizer tokenizer = new StringTokenizer( extraStr, "," );
while( tokenizer.hasMoreTokens()) {
String token = tokenizer.nextToken();
int pos = token.indexOf( '=' );
validateElement.setAttribute( token.substring( 0, pos ), token.substring( pos + 1 ));
}
int whenAttribValue = FocusEvent.FOCUS_LOST;
String whenAttrib = validateAnnotation.when();
validateElement.setAttribute( "when", whenAttrib );
if (( whenAttrib != null ) && ( whenAttrib.length() > 0 )) {
if ( whenAttrib.toLowerCase().compareTo( "mouseclicked" ) == 0 )
whenAttribValue = MouseEvent.MOUSE_CLICKED;
}