1 /*
2 * Licensed to the Apache Software Foundation (ASF) under one
3 * or more contributor license agreements. See the NOTICE file
4 * distributed with this work for additional information
5 * regarding copyright ownership. The ASF licenses this file
6 * to you under the Apache License, Version 2.0 (the
7 * "License"); you may not use this file except in compliance
8 * with the License. You may obtain a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing,
13 * software distributed under the License is distributed on an
14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 * KIND, either express or implied. See the License for the
16 * specific language governing permissions and limitations
17 * under the License.
18 */
19 package javax.faces.el;
20
21 /**
22 * Provides methods to read, write and inspect properties of javabeans, Maps, Arrays and Lists. This class is used by
23 * such things as the ValueBinding implementation and the ManagedBeanBuilder to access JSF beans.
24 *
25 * See the javadoc of the <a href="http://java.sun.com/javaee/javaserverfaces/1.2/docs/api/index.html">JSF
26 * Specification</a> for more details.
27 *
28 * @author Thomas Spiegl (latest modification by $Author: bommel $)
29 * @version $Revision: 1187701 $ $Date: 2011-10-22 07:21:54 -0500 (Sat, 22 Oct 2011) $
30 * @deprecated
31 */
32 public abstract class PropertyResolver
33 {
34
35 /**
36 * @deprecated
37 */
38 public PropertyResolver()
39 {
40 }
41
42 /**
43 * Returns the datatype of the specified element within a list or array.
44 * <p>
45 * Param base must be of type Array or List.
46 *
47 * @deprecated
48 */
49 public abstract Class getType(Object base, int index) throws EvaluationException, PropertyNotFoundException;
50
51 /**
52 * Returns the datatype of the specified javabean property on the specified object.
53 * <p>
54 * Param base may be a map, in which case param property is used as a key into the map, and the type of the object
55 * with that key is returned. If there is no such key in the map, then Object.class is returned.
56 * <p>
57 * Otherwise java.beans.Introspector is used to determine the actual property type. If the base bean has no such
58 * property then a PropertyNotFoundException is thrown.
59 *
60 * @param base
61 * must not be null.
62 * @param property
63 * must be of type String, must not be null and must not be an empty string.
64 * @deprecated
65 */
66 @SuppressWarnings("unchecked")
67 public abstract Class getType(Object base, java.lang.Object property) throws EvaluationException,
68 PropertyNotFoundException;
69
70 /**
71 * Return the specified element from a list or array.
72 * <p>
73 * Param base must be of type Array or List. When the array is of a primitive type, the appropriate wrapper is
74 * returned.
75 * <p>
76 * Null is returned when param index is "out of bounds" for the provided base object.
77 *
78 * @throws ReferenceSyntaxException
79 * if the base object is not an Array or List.
80 * @deprecated
81 */
82 public abstract Object getValue(Object base, int index) throws EvaluationException, PropertyNotFoundException;
83
84 /**
85 * Return the current value of the specified property on the base object.
86 * <p>
87 * If base is a Map, then Map.get(property) is returned. Null is returned if there is no entry with that key.
88 * <p>
89 * Otherwise, java.beans.Introspector is applied to the base object to find the associated PropertyDescriptor and
90 * the specified read method is invoked.
91 *
92 * @throws PropertyNotFoundException
93 * if the provided object does not have the specified property.
94 * @deprecated
95 */
96 public abstract Object getValue(Object base, java.lang.Object property) throws EvaluationException,
97 PropertyNotFoundException;
98
99 /**
100 * @deprecated
101 */
102 public abstract boolean isReadOnly(Object base, int index) throws EvaluationException, PropertyNotFoundException;
103
104 /**
105 * @deprecated
106 */
107 public abstract boolean isReadOnly(Object base, java.lang.Object property) throws EvaluationException,
108 PropertyNotFoundException;
109
110 /**
111 * Replace the object at the specified index within the base collection with the provided value.
112 * <p>
113 * Param base is expected to be an Array or List object.
114 *
115 * @throws EvaluationException
116 * if the base object is not an Array or List.
117 * @throws PropertyNotFoundException
118 * if the index is "out of bounds".
119 *
120 * @deprecated
121 */
122 public abstract void setValue(Object base, int index, java.lang.Object value) throws EvaluationException,
123 PropertyNotFoundException;
124
125 /**
126 * Set the named property on the base object to the provided value.
127 *
128 * @deprecated
129 */
130 public abstract void setValue(Object base, Object property, java.lang.Object value) throws EvaluationException,
131 PropertyNotFoundException;
132 }