001: /*
002: * Copyright 2004,2006 The Apache Software Foundation.
003: *
004: * Licensed under the Apache License, Version 2.0 (the "License");
005: * you may not use this file except in compliance with the License.
006: * You may obtain a copy of the License at
007: *
008: * http://www.apache.org/licenses/LICENSE-2.0
009: *
010: * Unless required by applicable law or agreed to in writing, software
011: * distributed under the License is distributed on an "AS IS" BASIS,
012: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013: * See the License for the specific language governing permissions and
014: * limitations under the License.
015: */
016: package javax.faces.el;
017:
018: /**
019: * Provides methods to read, write and inspect properties of javabeans, Maps,
020: * Arrays and Lists. This class is used by such things as the ValueBinding
021: * implementation and the ManagedBeanBuilder to access JSF beans.
022: *
023: * See the javadoc of the <a href="http://java.sun.com/javaee/javaserverfaces/1.2/docs/api/index.html">JSF Specification</a>
024: * for more details.
025: *
026: * @author Thomas Spiegl (latest modification by $Author: mbr $)
027: * @version $Revision: 512227 $ $Date: 2007-02-27 13:25:16 +0100 (Di, 27 Feb 2007) $
028: * @deprecated
029: */
030: public abstract class PropertyResolver {
031:
032: /**
033: * @deprecated
034: */
035: public PropertyResolver() {
036: }
037:
038: /**
039: * Returns the datatype of the specified element within a list or array.
040: * <p>
041: * Param base must be of type Array or List.
042: *
043: * @deprecated
044: */
045: public abstract Class getType(Object base, int index)
046: throws EvaluationException, PropertyNotFoundException;
047:
048: /**
049: * Returns the datatype of the specified javabean property on the
050: * specified object.
051: * <p>
052: * Param base may be a map, in which case param property is used
053: * as a key into the map, and the type of the object with that key
054: * is returned. If there is no such key in the map, then Object.class
055: * is returned.
056: * <p>
057: * Otherwise java.beans.Introspector is used to determine the actual
058: * property type. If the base bean has no such property then a
059: * PropertyNotFoundException is thrown.
060: *
061: * @param base must not be null.
062: * @param property must be of type String, must not be null and
063: * must not be an empty string.
064: * @deprecated
065: */
066: public abstract Class getType(Object base, java.lang.Object property)
067: throws EvaluationException, PropertyNotFoundException;
068:
069: /**
070: * Return the specified element from a list or array.
071: * <p>
072: * Param base must be of type Array or List. When the array is of a
073: * primitive type, the appropriate wrapper is returned.
074: * <p>
075: * Null is returned when param index is "out of bounds" for the provided
076: * base object.
077: *
078: * @throws ReferenceSyntaxException if the base object is not an Array
079: * or List.
080: * @deprecated
081: */
082: public abstract Object getValue(Object base, int index)
083: throws EvaluationException, PropertyNotFoundException;
084:
085: /**
086: * Return the current value of the specified property on the base
087: * object.
088: * <p>
089: * If base is a Map, then Map.get(property) is returned. Null is
090: * returned if there is no entry with that key.
091: * <p>
092: * Otherwise, java.beans.Introspector is applied to the base object
093: * to find the associated PropertyDescriptor and the specified
094: * read method is invoked.
095: *
096: * @throws PropertyNotFoundException if the provided object does
097: * not have the specified property.
098: * @deprecated
099: */
100: public abstract Object getValue(Object base,
101: java.lang.Object property) throws EvaluationException,
102: PropertyNotFoundException;
103:
104: /**
105: * @deprecated
106: */
107: public abstract boolean isReadOnly(Object base, int index)
108: throws EvaluationException, PropertyNotFoundException;
109:
110: /**
111: * @deprecated
112: */
113: public abstract boolean isReadOnly(Object base,
114: java.lang.Object property) throws EvaluationException,
115: PropertyNotFoundException;
116:
117: /**
118: * Replace the object at the specified index within the base collection
119: * with the provided value.
120: * <p>
121: * Param base is expected to be an Array or List object.
122: *
123: * @throws EvaluationException if the base object is not an Array or List.
124: * @throws PropertyNotFoundException if the index is "out of bounds".
125: *
126: * @deprecated
127: */
128: public abstract void setValue(Object base, int index,
129: java.lang.Object value) throws EvaluationException,
130: PropertyNotFoundException;
131:
132: /**
133: * Set the named property on the base object to the provided value.
134: *
135: * @deprecated
136: */
137: public abstract void setValue(Object base, Object property,
138: java.lang.Object value) throws EvaluationException,
139: PropertyNotFoundException;
140: }
|