KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > beehive > netui > util > type > DelegatingTypeConverter


1 /*
2  * Copyright 2004 The Apache Software Foundation.
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  * $Header:$
17  */

18 package org.apache.beehive.netui.util.type;
19
20 import java.util.Locale JavaDoc;
21
22 /**
23  * Implementation of the {@link TypeConverter} interface that delegates
24  * to a {@link TypeConverter} implementation which doesn't extend
25  * {@link BaseTypeConverter}.
26  */

27 public final class DelegatingTypeConverter
28     extends BaseTypeConverter {
29
30     private TypeConverter _converter = null;
31
32     public DelegatingTypeConverter(TypeConverter converter) {
33         super();
34         assert converter != null;
35         _converter = converter;
36     }
37
38     public Object JavaDoc convertToObject(Class JavaDoc type, String JavaDoc value, Locale JavaDoc locale) {
39         return _converter.convertToObject(value);
40     }
41 }
42
Popular Tags