protected boolean isValidEventNameForScope ( String eventName , Element listenerElement ) { if ( eventName != null && eventName . trim ( ) . length ( ) > 0 ) { if ( "start" . equals ( eventName ) || "end" . equals ( eventName ) ) { return true ; } else { addError ( "Attribute 'event' must be one of {start|end}" , listenerElement ) ; } } else { addError ( "Attribute 'event' is mandatory on listener" , listenerElement ) ; } return false ; }
Check if the given event name is valid . If not an appropriate error is added .