1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package net.sf.morph.reflect.reflectors;
17
18 import java.util.ArrayList;
19 import java.util.Enumeration;
20 import java.util.List;
21
22 /**
23 * Base class for reflectors that reflect objects from the Servlet API.
24 *
25 * @author Matt Sgarlata
26 * @since Nov 30, 2004
27 */
28 public abstract class BaseServletReflector extends BaseBeanReflector {
29
30 protected String[] enumerationToStringArray(Enumeration e) {
31
32
33
34
35 List list = new ArrayList();
36 while (e.hasMoreElements()) {
37 list.add(e.nextElement());
38 }
39 return (String[]) list.toArray(new String[list.size()]);
40 }
41
42 protected boolean isReadableImpl(Object bean, String propertyName)
43 throws Exception {
44 return true;
45 }
46
47 protected Class getTypeImpl(Object bean, String propertyName) throws Exception {
48 return Object.class;
49 }
50
51 }