    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
    015public class BeanValidationContextImpl implements BeanValidationContext
    016{
    017    private Object bean;
    018    private String currentProperty;
    019
    020    public BeanValidationContextImpl(Object bean)
    021    {
    022        this.bean = bean;
    023    }
    024
    025    public Class getBeanType()
    026    {
    027        return bean==null?null:bean.getClass();
    028    }
    029
    030    public Object getBeanInstance()
    031    {
    032        return bean;
    033    }
    034
    035    public String getCurrentProperty()
    036    {
    037        return currentProperty;
    038    }
    039
    040    public void setCurrentProperty(String propertyName)
    041    {
    042        this.currentProperty = propertyName;
    043    }
    044
    045}