class PropertyPatternRule {
        protected String propertyName;
        protected Pattern requiredPattern; 
        protected String errorMessage;
        public PropertyPatternRule(String name, String pat, String msg) {
            propertyName = name;
            requiredPattern = Pattern.compile(pat);
            errorMessage = msg.replace("@@", pat);
        }
        public void test(BeanWrapperImpl wrapper, Errors errors) {<FILL_FUNCTION_BODY>}

    }

            Matcher m = requiredPattern.matcher(
                    (CharSequence)wrapper.getPropertyValue(propertyName));
            if(!m.matches()) {
                errors.rejectValue(propertyName, null, errorMessage);
            }
        
<no_super_class>