001/* 002 * Copyright 2002-2012 the original author or authors. 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 * https://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 017package org.springframework.beans; 018 019/** 020 * Interface for strategies that register custom 021 * {@link java.beans.PropertyEditor property editors} with a 022 * {@link org.springframework.beans.PropertyEditorRegistry property editor registry}. 023 * 024 * <p>This is particularly useful when you need to use the same set of 025 * property editors in several different situations: write a corresponding 026 * registrar and reuse that in each case. 027 * 028 * @author Juergen Hoeller 029 * @since 1.2.6 030 * @see PropertyEditorRegistry 031 * @see java.beans.PropertyEditor 032 */ 033public interface PropertyEditorRegistrar { 034 035 /** 036 * Register custom {@link java.beans.PropertyEditor PropertyEditors} with 037 * the given {@code PropertyEditorRegistry}. 038 * <p>The passed-in registry will usually be a {@link BeanWrapper} or a 039 * {@link org.springframework.validation.DataBinder DataBinder}. 040 * <p>It is expected that implementations will create brand new 041 * {@code PropertyEditors} instances for each invocation of this 042 * method (since {@code PropertyEditors} are not threadsafe). 043 * @param registry the {@code PropertyEditorRegistry} to register the 044 * custom {@code PropertyEditors} with 045 */ 046 void registerCustomEditors(PropertyEditorRegistry registry); 047 048}