org.apache.shale.faces
Class ShalePropertyResolver

java.lang.Object
  extended by javax.faces.el.PropertyResolver
      extended by org.apache.shale.faces.ShalePropertyResolver

public class ShalePropertyResolver
extends javax.faces.el.PropertyResolver

Shale-specific PropertyResolver for evaluating JavaServer Faces value binding and method binding expressions. The following special processing is performed, based on recognizing the type of the base object:

All other evaluations are delegated to the previous implementation that was passed to our constructor.

$Id: ShalePropertyResolver.java 464373 2006-10-16 04:21:54Z rahul $


Constructor Summary
ShalePropertyResolver(javax.faces.el.PropertyResolver original)
          Construct a new ShalePropertyResolver instance.
 
Method Summary
 Class getType(Object base, int index)
          Convert an index into a corresponding string, and delegate.
 Class getType(Object base, Object property)
          For a Context, look up and return the type of the named object corresponding to the specified property name from this Context.
 Object getValue(Object base, int index)
          Convert an index into a corresponding string, and delegate.
 Object getValue(Object base, Object property)
          For a base object of type Context, look up and return the named object corresponding to the specified property name from this Context.
 boolean isReadOnly(Object base, int index)
          Convert an index into a corresponding string, and delegate.
 boolean isReadOnly(Object base, Object property)
          For a Context base object, arbitrarily return false because we cannot determine if a Context is read only or not.
 void setValue(Object base, int index, Object value)
          Convert an index into a corresponding string, and delegate.
 void setValue(Object base, Object property, Object value)
          For a base object of type Context, replace any previous binding for the named object corresponding to the specified property name into this Context.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ShalePropertyResolver

public ShalePropertyResolver(javax.faces.el.PropertyResolver original)

Construct a new ShalePropertyResolver instance.

Parameters:
original - Original resolver to delegate to.
Method Detail

getValue

public Object getValue(Object base,
                       Object property)
                throws javax.faces.el.EvaluationException,
                       javax.faces.el.PropertyNotFoundException

For a base object of type Context, look up and return the named object corresponding to the specified property name from this Context.

(Since 1.0.1) For a base object of type LoadBundle, treat the property expression as follows:

Specified by:
getValue in class javax.faces.el.PropertyResolver
Parameters:
base - Base object from which to return a property
property - Property to be returned
Throws:
javax.faces.el.EvaluationException - if an evaluation error occurs
javax.faces.el.PropertyNotFoundException - if there is no such named object in this context

setValue

public void setValue(Object base,
                     Object property,
                     Object value)

For a base object of type Context, replace any previous binding for the named object corresponding to the specified property name into this Context.

(Since 1.0.1) For a base object of type LoadBundle, throw an exception since all properties of this object are read only.

Specified by:
setValue in class javax.faces.el.PropertyResolver
Parameters:
base - Base object in which to store a property
property - Property to be stored
value - Value to be stored
Throws:
javax.faces.el.EvaluationException - if an evaluation error occurs
javax.faces.el.PropertyNotFoundException - if there is no such named object in this context

isReadOnly

public boolean isReadOnly(Object base,
                          Object property)
                   throws javax.faces.el.EvaluationException,
                          javax.faces.el.PropertyNotFoundException

For a Context base object, arbitrarily return false because we cannot determine if a Context is read only or not.

(Since 1.0.1) For a LoadBundle base object, return true because all pseudo-properties of this bundle are considered to be read only.

Specified by:
isReadOnly in class javax.faces.el.PropertyResolver
Parameters:
base - Base object from which to return read only state
property - Property to be checked
Throws:
javax.faces.el.EvaluationException - if an evaluation error occurs
javax.faces.el.PropertyNotFoundException - if there is no such named object in this context

getType

public Class getType(Object base,
                     Object property)
              throws javax.faces.el.EvaluationException,
                     javax.faces.el.PropertyNotFoundException

For a Context, look up and return the type of the named object corresponding to the specified property name from this Context.

(Since 1.0.1) For a LoadBundle, look up and return the corresponding object type at runtime, or return Object for the type to be looked up at design time.

Specified by:
getType in class javax.faces.el.PropertyResolver
Parameters:
base - Base object from which to return a property type
property - Property whose type is to be returned
Throws:
javax.faces.el.EvaluationException - if an evaluation error occurs
javax.faces.el.PropertyNotFoundException - if there is no such named object in this context

getValue

public Object getValue(Object base,
                       int index)
                throws javax.faces.el.EvaluationException,
                       javax.faces.el.PropertyNotFoundException

Convert an index into a corresponding string, and delegate.

Specified by:
getValue in class javax.faces.el.PropertyResolver
Parameters:
base - Base object from which to return a property
index - Index to be returned
Throws:
javax.faces.el.EvaluationException - if an evaluation error occurs
javax.faces.el.PropertyNotFoundException - if there is no such named object in this context

setValue

public void setValue(Object base,
                     int index,
                     Object value)
              throws javax.faces.el.EvaluationException,
                     javax.faces.el.PropertyNotFoundException

Convert an index into a corresponding string, and delegate.

Specified by:
setValue in class javax.faces.el.PropertyResolver
Parameters:
base - Base object into which to store a property
index - Index to be stored
value - Value to be stored
Throws:
javax.faces.el.EvaluationException - if an evaluation error occurs
javax.faces.el.PropertyNotFoundException - if there is no such named object in this context

isReadOnly

public boolean isReadOnly(Object base,
                          int index)
                   throws javax.faces.el.EvaluationException,
                          javax.faces.el.PropertyNotFoundException

Convert an index into a corresponding string, and delegate.

Specified by:
isReadOnly in class javax.faces.el.PropertyResolver
Parameters:
base - Base object from which to check a property
index - Index to be checked
Throws:
javax.faces.el.EvaluationException - if an evaluation error occurs
javax.faces.el.PropertyNotFoundException - if there is no such named object in this context

getType

public Class getType(Object base,
                     int index)
              throws javax.faces.el.EvaluationException,
                     javax.faces.el.PropertyNotFoundException

Convert an index into a corresponding string, and delegate.

Specified by:
getType in class javax.faces.el.PropertyResolver
Parameters:
base - Base object from which to return a property type
index - Index whose type is to be returned
Throws:
javax.faces.el.EvaluationException - if an evaluation error occurs
javax.faces.el.PropertyNotFoundException - if there is no such named object in this context


Copyright © 2004-2007 Apache Software Foundation. All Rights Reserved.