001// Licensed under the Apache License, Version 2.0 (the "License"); 002// you may not use this file except in compliance with the License. 003// You may obtain a copy of the License at 004// 005// http://www.apache.org/licenses/LICENSE-2.0 006// 007// Unless required by applicable law or agreed to in writing, software 008// distributed under the License is distributed on an "AS IS" BASIS, 009// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 010// See the License for the specific language governing permissions and 011// limitations under the License. 012package org.apache.tapestry5.internal; 013 014/** 015 * Defines a context for validating beans. 016 * 017 * @since 5.2.0 018 */ 019public interface BeanValidationContext 020{ 021 /** 022 * Returns the type of the object to validate. This method is needed for client side validation. 023 */ 024 Class getBeanType(); 025 026 /** 027 * Return the object to validate. 028 */ 029 Object getBeanInstance(); 030 031 /** 032 * Returns name of the property to validate. The current name is overwritten by every form field. 033 */ 034 String getCurrentProperty(); 035 036 /** 037 * Sets name of the property to validate. 038 * 039 * @param propertyName name of the property 040 */ 041 void setCurrentProperty(String propertyName); 042}