Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * $Id: PropertyResolver.java,v 1.15 2007/04/27 22:00:08 ofung Exp $
   */
  
  /*
   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
   * 
   * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
   * 
  * The contents of this file are subject to the terms of either the GNU
  * General Public License Version 2 only ("GPL") or the Common Development
  * and Distribution License("CDDL") (collectively, the "License").  You
  * may not use this file except in compliance with the License. You can obtain
  * a copy of the License at https://glassfish.dev.java.net/public/CDDL+GPL.html
  * or glassfish/bootstrap/legal/LICENSE.txt.  See the License for the specific
  * language governing permissions and limitations under the License.
  * 
  * When distributing the software, include this License Header Notice in each
  * file and include the License file at glassfish/bootstrap/legal/LICENSE.txt.
  * Sun designates this particular file as subject to the "Classpath" exception
  * as provided by Sun in the GPL Version 2 section of the License file that
  * accompanied this code.  If applicable, add the following below the License
  * Header, with the fields enclosed by brackets [] replaced by your own
  * identifying information: "Portions Copyrighted [year]
  * [name of copyright owner]"
  * 
  * Contributor(s):
  * 
  * If you wish your version of this file to be governed by only the CDDL or
  * only the GPL Version 2, indicate your decision by adding "[Contributor]
  * elects to include this software in this distribution under the [CDDL or GPL
  * Version 2] license."  If you don't indicate a single choice of license, a
  * recipient has the option to distribute your version of this file under
  * either the CDDL, the GPL Version 2 or to extend the choice of license to
  * its licensees as provided above.  However, if you add GPL Version 2 code
  * and therefore, elected the GPL Version 2 license, then the option applies
  * only if the new code is made subject to such option by the copyright
  * holder.
  */
 
 
 package javax.faces.el;


PropertyResolver represents a pluggable mechanism for accessing a "property" of an underlying Java object instance. Different PropertyResolver implementations can support property resolution on instances of different Java classes (such as introspection-based access to properties of a JavaBeans component, or get() and put() calls on a java.util.Map instance).

All implementations must respect the rules for JavaBeans component, java.util.Map, java.util.List and array instances defined for each method but are allowed to add custom semantics for other types.

Deprecated:
This has been replaced by javax.el.ELResolver.
 
 
 public abstract class PropertyResolver {


    

Return the value of the specified property from the specified base object.

For a bean base object, the property is coerced to a String and used as the property name. For all other base object types (e.g., a Map), the property is used without any coercing.

Parameters:
base The base object whose property value is to be returned
property The property to be returned
Returns:
The property value, or null if base or property is null, or if the property doesn't exist and the base object is a Map instance
Throws:
EvaluationException if an exception is thrown while getting the property value (the thrown exception must be included as the cause property of this exception)
PropertyNotFoundException if the specified property for a bean base object does not exist or is not readable
 
     public abstract Object getValue(Object baseObject property)
         throws EvaluationExceptionPropertyNotFoundException;


    

Return the value at the specified index of the specified base object.

Parameters:
base The base object whose property value is to be returned
index The index of the value to return
Returns:
The property value, or null if base is null, or if the index is out of bounds for the base object
Throws:
EvaluationException if an exception is thrown while getting the property value (the thrown exception must be included as the cause property of this exception)
PropertyNotFoundException if the index is out of bounds or if base is null
    public abstract Object getValue(Object baseint index)
        throws EvaluationExceptionPropertyNotFoundException;


    

Set the specified value of the specified property on the specified base object.

For a bean base object, the property is coerced to a String and used as the property name. For all other base object types (e.g., a Map), the property is used without any coercing.

Parameters:
base The base object whose property value is to be set
property The property to be set
value The value of the property to be set
Throws:
EvaluationException if an exception is thrown while setting the property value (the thrown exception must be included as the cause property of this exception)
PropertyNotFoundException if the specified bean base object property does not exist or is not writeable, or if base or name is null
    public abstract void setValue(Object baseObject propertyObject value)
        throws EvaluationExceptionPropertyNotFoundException;


    

Set the value at the specified index of the specified base object.

Parameters:
base The base object whose property value is to be set
index The index of the value to set
value The value to be set
Throws:
EvaluationException if an exception is thrown while setting the property value (the thrown exception must be included as the cause property of this exception)
PropertyNotFoundException if the index is out of bounds or if base is null
    public abstract void setValue(Object baseint indexObject value)
        throws EvaluationExceptionPropertyNotFoundException;


    

Checks if the specified property is read-only.

For a bean base object, the property is coerced to a String and used as the property name. For all other base object types (e.g., a Map), the property is used without any coercing.

Parameters:
base The base object whose property is to be analyzed
property The property to be analyzed
Returns:
true if the specified property of the specified base object is known to be immutable; otherwise false
Throws:
EvaluationException if an exception is thrown while testing the property (the thrown exception must be included as the cause property of this exception)
PropertyNotFoundException if the specified bean base object property does not exist or if base or property is null
    public abstract boolean isReadOnly(Object baseObject property)
        throws EvaluationExceptionPropertyNotFoundException;


    

Checks if the specified index is read-only.

Parameters:
base The base object whose property is to be analyzed
index The index of the value whose type is to be returned
Returns:
true if the value at the specified index of the specified base object is known to be immutable; otherwise, false
Throws:
EvaluationException if an exception is thrown while testing the property (the thrown exception must be included as the cause property of this exception)
PropertyNotFoundException if the index is out of bounds or if base is null
    public abstract boolean isReadOnly(Object baseint index)
        throws EvaluationExceptionPropertyNotFoundException;


    

Return the java.lang.Class representing the type of the specified property. An instance of any Object of that type my be set as the value of that property, as long as the property is not read-only. The actual value of the property, if non-null, is guaranteed to be an instance of this type, or an instance of a subclass of this type. This method is also useful for discovering the type of Objects that may be set as the value of the property.

For a bean base object, the property is coerced to a String and used as the property name. For all other base object types (e.g., a Map), the property is used without any coercing.

Parameters:
base The base object whose property is to be analyzed
property The property to be analyzed
Returns:
the java.lang.Class representing the type of the specified property of the specified base object, if it can be determined; otherwise null
Throws:
EvaluationException if an exception is thrown while testing the property (the thrown exception must be included as the cause property of this exception)
PropertyNotFoundException if the specified bean base object property does not exist or if base or property is null
    public abstract Class getType(Object baseObject property)
        throws EvaluationExceptionPropertyNotFoundException;


    

Return the java.lang.Class representing the type of the specified index.

Parameters:
base The base object whose property is to be analyzed
index The index of the value whose type is to be returned
Returns:
The java.lang.Class representing the type of value at the specified index of the specified base object, if it can be determined; otherwise null
Throws:
EvaluationException if an exception is thrown while testing the property (the thrown exception must be included as the cause property of this exception)
PropertyNotFoundException if the index is out of bounds or if base is null
    public abstract Class getType(Object baseint index)
New to GrepCode? Check out our FAQ X