View Javadoc
1   /*
2    * Copyright 2002-2012 the original author or authors.
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    *      http://www.apache.org/licenses/LICENSE-2.0
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  
17  package org.springframework.beans;
18  
19  /**
20   * Interface for strategies that register custom
21   * {@link java.beans.PropertyEditor property editors} with a
22   * {@link org.springframework.beans.PropertyEditorRegistry property editor registry}.
23   *
24   * <p>This is particularly useful when you need to use the same set of
25   * property editors in several different situations: write a corresponding
26   * registrar and reuse that in each case.
27   *
28   * @author Juergen Hoeller
29   * @since 1.2.6
30   * @see PropertyEditorRegistry
31   * @see java.beans.PropertyEditor
32   */
33  public interface PropertyEditorRegistrar {
34  
35  	/**
36  	 * Register custom {@link java.beans.PropertyEditor PropertyEditors} with
37  	 * the given {@code PropertyEditorRegistry}.
38  	 * <p>The passed-in registry will usually be a {@link BeanWrapper} or a
39  	 * {@link org.springframework.validation.DataBinder DataBinder}.
40  	 * <p>It is expected that implementations will create brand new
41  	 * {@code PropertyEditors} instances for each invocation of this
42  	 * method (since {@code PropertyEditors} are not threadsafe).
43  	 * @param registry the {@code PropertyEditorRegistry} to register the
44  	 * custom {@code PropertyEditors} with
45  	 */
46  	void registerCustomEditors(PropertyEditorRegistry registry);
47  
48  }