001/* 002 * (C) Copyright 2006-2008 Nuxeo SAS (http://nuxeo.com/) and contributors. 003 * 004 * All rights reserved. This program and the accompanying materials 005 * are made available under the terms of the GNU Lesser General Public License 006 * (LGPL) version 2.1 which accompanies this distribution, and is available at 007 * http://www.gnu.org/licenses/lgpl.html 008 * 009 * This library is distributed in the hope that it will be useful, 010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 012 * Lesser General Public License for more details. 013 * 014 * Contributors: 015 * bstefanescu 016 */ 017package org.nuxeo.ecm.webengine.forms.validation.test; 018 019import org.nuxeo.ecm.webengine.forms.validation.Form; 020import org.nuxeo.ecm.webengine.forms.validation.annotations.FormValidator; 021import org.nuxeo.ecm.webengine.forms.validation.annotations.Length; 022import org.nuxeo.ecm.webengine.forms.validation.annotations.NotNull; 023import org.nuxeo.ecm.webengine.forms.validation.annotations.Range; 024import org.nuxeo.ecm.webengine.forms.validation.annotations.Regex; 025import org.nuxeo.ecm.webengine.forms.validation.annotations.Required; 026 027/** 028 * @author <a href="mailto:bs@nuxeo.com">Bogdan Stefanescu</a> 029 */ 030@FormValidator(MyFormValidator.class) 031public interface MyForm extends Form { 032 033 @Required 034 String getId(); 035 036 String getTitle(); 037 038 @NotNull("me") 039 String getName(); 040 041 Integer getAge(); 042 043 @Range(min = 3, max = 7) 044 Integer getNumber(); 045 046 @Length(min = 3) 047 @Regex(".+@.+") 048 String[] getEmails(); 049 050 @Required 051 @Length(min = 2) 052 String getPassword(); 053 054 @Required 055 String getVerifyPassword(); 056 057}