001/* 002 * (C) Copyright 2006-2008 Nuxeo SA (http://nuxeo.com/) and others. 003 * 004 * Licensed under the Apache License, Version 2.0 (the "License"); 005 * you may not use this file except in compliance with the License. 006 * You may obtain a copy of the License at 007 * 008 * http://www.apache.org/licenses/LICENSE-2.0 009 * 010 * Unless required by applicable law or agreed to in writing, software 011 * distributed under the License is distributed on an "AS IS" BASIS, 012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 013 * See the License for the specific language governing permissions and 014 * limitations under the License. 015 * 016 * Contributors: 017 * bstefanescu 018 */ 019package org.nuxeo.ecm.webengine.forms.validation.test; 020 021import org.nuxeo.ecm.webengine.forms.validation.Form; 022import org.nuxeo.ecm.webengine.forms.validation.annotations.FormValidator; 023import org.nuxeo.ecm.webengine.forms.validation.annotations.Length; 024import org.nuxeo.ecm.webengine.forms.validation.annotations.NotNull; 025import org.nuxeo.ecm.webengine.forms.validation.annotations.Range; 026import org.nuxeo.ecm.webengine.forms.validation.annotations.Regex; 027import org.nuxeo.ecm.webengine.forms.validation.annotations.Required; 028 029/** 030 * @author <a href="mailto:[email protected]">Bogdan Stefanescu</a> 031 */ 032@FormValidator(MyFormValidator.class) 033public interface MyForm extends Form { 034 035 @Required 036 String getId(); 037 038 String getTitle(); 039 040 @NotNull("me") 041 String getName(); 042 043 Integer getAge(); 044 045 @Range(min = 3, max = 7) 046 Integer getNumber(); 047 048 @Length(min = 3) 049 @Regex(".+@.+") 050 String[] getEmails(); 051 052 @Required 053 @Length(min = 2) 054 String getPassword(); 055 056 @Required 057 String getVerifyPassword(); 058 059}