You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by sk...@apache.org on 2006/01/16 02:16:42 UTC

svn commit: r369297 - /myfaces/api/trunk/api/src/main/java/javax/faces/el/PropertyResolver.java

Author: skitching
Date: Sun Jan 15 17:16:38 2006
New Revision: 369297

URL: http://svn.apache.org/viewcvs?rev=369297&view=rev
Log:
Add javadoc, remove tabs.

Modified:
    myfaces/api/trunk/api/src/main/java/javax/faces/el/PropertyResolver.java

Modified: myfaces/api/trunk/api/src/main/java/javax/faces/el/PropertyResolver.java
URL: http://svn.apache.org/viewcvs/myfaces/api/trunk/api/src/main/java/javax/faces/el/PropertyResolver.java?rev=369297&r1=369296&r2=369297&view=diff
==============================================================================
--- myfaces/api/trunk/api/src/main/java/javax/faces/el/PropertyResolver.java (original)
+++ myfaces/api/trunk/api/src/main/java/javax/faces/el/PropertyResolver.java Sun Jan 15 17:16:38 2006
@@ -1,5 +1,5 @@
 /*
- * Copyright 2004 The Apache Software Foundation.
+ * Copyright 2004,2006 The Apache Software Foundation.
  * 
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -16,7 +16,12 @@
 package javax.faces.el;
 
 /**
- * see Javadoc of <a href="http://java.sun.com/j2ee/javaserverfaces/1.1_01/docs/api/index.html">JSF Specification</a>
+ * Provides methods to read, write and inspect properties of javabeans, Maps,
+ * Arrays and Lists. This class is used by such things as the ValueBinding
+ * implementation and the ManagedBeanBuilder to access JSF beans.
+ *
+ * See the javadoc of the <a href="http://java.sun.com/j2ee/javaserverfaces/1.1_01/docs/api/index.html">JSF Specification</a>
+ * for more details.
  *
  * @author Thomas Spiegl (latest modification by $Author$)
  * @version $Revision$ $Date$
@@ -24,37 +29,91 @@
 public abstract class PropertyResolver
 {
 
-	// FIELDS
-
-	// CONSTRUCTORS
-	public PropertyResolver()
-	{
-	}
-
-	// METHODS
-	public abstract Class getType(Object base, int index)
-        throws EvaluationException, PropertyNotFoundException;
-
-
-	public abstract Class getType(Object base, java.lang.Object property)
-        throws EvaluationException, PropertyNotFoundException;
-
-	public abstract Object getValue(Object base, int index)
-        throws EvaluationException, PropertyNotFoundException;
-
-	public abstract Object getValue(Object base, java.lang.Object property)
+    public PropertyResolver()
+    {
+    }
+    
+    /**
+     * Returns the datatype of the specified element within a list or array.
+     * <p>
+     * Param base must be of type Array or List.
+     */
+    public abstract Class getType(Object base, int index)
+        throws EvaluationException, PropertyNotFoundException;
+
+    /**
+     * Returns the datatype of the specified javabean property on the
+     * specified object.
+     * <p>
+     * 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 with that key
+     * is returned. If there is no such key in the map, then Object.class
+     * is returned.
+     * <p>
+     * Otherwise java.beans.Introspector is used to determine the actual
+     * property type. If the base bean has no such property then a
+     * PropertyNotFoundException is thrown.
+     * 
+     * @param base must not be null.
+     * @param property must be of type String, must not be null and
+     *  must not be an empty string.
+     */
+    public abstract Class getType(Object base, java.lang.Object property)
+        throws EvaluationException, PropertyNotFoundException;
+
+    /**
+     * Return the specified element from a list or array.
+     * <p>
+     * Param base must be of type Array or List. When the array is of a
+     * primitive type, the appropriate wrapper is returned.
+     * <p>
+     * Null is returned when param index is "out of bounds" for the provided
+     * base object.
+     *  
+     * @throws ReferenceSyntaxException if the base object is not an Array
+     * or List.
+     */
+    public abstract Object getValue(Object base, int index)
+        throws EvaluationException, PropertyNotFoundException;
+
+    /**
+     * Return the current value of the specified property on the base
+     * object.
+     * <p>
+     * If base is a Map, then Map.get(property) is returned. Null is
+     * returned if there is no entry with that key.
+     * <p>
+     * Otherwise, java.beans.Introspector is applied to the base object
+     * to find the associated PropertyDescriptor and the specified
+     * read method is invoked.
+     * 
+     * @throws PropertyNotFoundException if the provided object does
+     * not have the specified property.
+     */
+    public abstract Object getValue(Object base, java.lang.Object property)
+        throws EvaluationException, PropertyNotFoundException;
+
+    public abstract boolean isReadOnly(Object base, int index)
+        throws EvaluationException, PropertyNotFoundException;
+
+    public abstract boolean isReadOnly(Object base, java.lang.Object property)
+        throws EvaluationException, PropertyNotFoundException;
+
+    /**
+     * Replace the object at the specified index within the base collection
+     * with the provided value.
+     * <p>
+     * Param base is expected to be an Array or List object.
+     * 
+     * @throws EvaluationException if the base object is not an Array or List.
+     * @throws PropertyNotFoundException if the index is "out of bounds".
+     */
+    public abstract void setValue(Object base, int index, java.lang.Object value)
+        throws EvaluationException, PropertyNotFoundException;
+
+    /**
+     * Set the named property on the base object to the provided value.
+     */
+    public abstract void setValue(Object base, Object property, java.lang.Object value)
         throws EvaluationException, PropertyNotFoundException;
-
-	public abstract boolean isReadOnly(Object base, int index)
-        throws EvaluationException, PropertyNotFoundException;
-
-	public abstract boolean isReadOnly(Object base, java.lang.Object property)
-        throws EvaluationException, PropertyNotFoundException;
-
-	public abstract void setValue(Object base, int index, java.lang.Object value)
-        throws EvaluationException, PropertyNotFoundException;
-
-	public abstract void setValue(Object base, Object property, java.lang.Object value)
-        throws EvaluationException, PropertyNotFoundException;
-
 }