KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > jodd > typeconverter > FileUploadConverter


1 // Copyright (c) 2003-2007, Jodd Team (jodd.sf.net). All Rights Reserved.
2

3 package jodd.typeconverter;
4
5 import jodd.servlet.upload.FileUpload;
6
7 /**
8  * Converts given object to jodd.servlet.upload.FileUpload.
9  */

10 public class FileUploadConverter implements TypeConverter {
11
12     public static FileUpload valueOf(Object JavaDoc value) {
13         if (value == null) {
14             return null;
15         }
16         if (value instanceof FileUpload) {
17             return (FileUpload) value;
18         }
19         throw new TypeConversionException();
20     }
21
22     public Object JavaDoc convert(Object JavaDoc value) {
23         return valueOf(value);
24     }
25     
26 }
27
Popular Tags