01: /**
02: * Copyright 2006 Webmedia Group Ltd.
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
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: **/package org.araneaframework.uilib.form.converter;
16:
17: import java.io.Serializable;
18: import org.araneaframework.Environment;
19: import org.araneaframework.uilib.ConverterNotFoundException;
20: import org.araneaframework.uilib.form.Converter;
21: import org.araneaframework.uilib.form.FormElement;
22:
23: /**
24: * Provides access to registered {@link Converter}s.
25: *
26: * Since 1.1 this interface extends <code>Serializable</code>.
27: * @author Jevgeni Kabanov (ekabanov <i>at</i> araneaframework <i>dot</i> org)
28: *
29: * @see Converter
30: * @see ConverterFactory
31: * @see FormElement#convert()
32: */
33: public interface ConverterProvider extends Serializable {
34: /**
35: * This method should return a {@link BaseConverter }corresponding to the two types given.
36: *
37: * @param fromType from type.
38: * @param toType to type.
39: * @return {@link BaseConverter} corresponding to the types given.
40: *
41: * @throws ConverterNotFoundException if {@link BaseConverter}is not found
42: */
43: public Converter findConverter(String fromType, String toType,
44: Environment env) throws ConverterNotFoundException;
45: }
|