private boolean validatePattern ( Object validationObject , Annotation annotate ) { if ( checkNullObject ( validationObject ) ) { return true ; } java . util . regex . Pattern pattern = java . util . regex . Pattern . compile ( ( ( Pattern ) annotate ) . regexp ( ) , ( ( Pattern ) annotate ) . flags ( ) . length ) ; Matcher matcherPattern = pattern . matcher ( ( String ) validationObject ) ; if ( ! matcherPattern . matches ( ) ) { throwValidationException ( ( ( Pattern ) annotate ) . message ( ) ) ; } return true ; }
Checks whether the given string is a valid pattern or not