public boolean matches ( String text ) { if ( text == null ) { return false ; } if ( this . regex ) { final Pattern rx ; if ( this . caseSensitive ) { rx = Pattern . compile ( this . value ) ; } else { rx = Pattern . compile ( this . value , Pattern . CASE_INSENSITIVE ) ; } return rx . matcher ( text ) . matches ( ) ; } else { if ( this . caseSensitive ) { return value . equals ( text ) ; } else { return value . equalsIgnoreCase ( text ) ; } } }
Uses the object s properties to determine if the supplied string matches the value of this property .