org.apache.struts.faces.application
Class PropertyResolverImpl

java.lang.Object
  extended by javax.faces.el.PropertyResolver
      extended by org.apache.struts.faces.application.PropertyResolverImpl

public class PropertyResolverImpl
extends javax.faces.el.PropertyResolver

Custom PropertyResolver implementation that adds support for DynaBean property access to the facilities of the default PropertyResolver provided by JavaServer Faces.

This class implements the following specific rules:

Version:
$Rev: 471754 $ $Date: 2006-11-06 08:55:09 -0600 (Mon, 06 Nov 2006) $

Constructor Summary
PropertyResolverImpl(javax.faces.el.PropertyResolver resolver)
          Construct a new PropertyResolver instance, wrapping the specified instance using the Decorator pattern such that this class need implement only the new functionality it supports, and not need to re-implement the basic facilities.
 
Method Summary
 Class getType(Object base, int index)
          Return the java.lang.Class representing the type of value at the specified index of the specified base object, or null if this value is null.
 Class getType(Object base, Object name)
          Return the java.lang.Class representing the type of the specified property of the specified base object, if it can be determined; otherwise return null.
 Object getValue(Object base, int index)
          Return the value at the specified index of the specified base object.
 Object getValue(Object base, Object name)
          Return the value of the property with the specified name from the specified base object.
 boolean isReadOnly(Object base, int index)
          Return true if the value at the specified index of the specified base object is known to be immutable; otherwise, return false.
 boolean isReadOnly(Object base, Object name)
          Return true if the specified property of the specified base object is known to be immutable; otherwise, return false.
 void setValue(Object base, int index, Object value)
          Set the value at the specified index of the specified base object.
 void setValue(Object base, Object name, Object value)
          Set the specified value of the property with the specified name on the specified base object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PropertyResolverImpl

public PropertyResolverImpl(javax.faces.el.PropertyResolver resolver)

Construct a new PropertyResolver instance, wrapping the specified instance using the Decorator pattern such that this class need implement only the new functionality it supports, and not need to re-implement the basic facilities.

Parameters:
resolver - The original resolver to be wrapped
Throws:
NullPointerException - if resolver is null
Method Detail

getValue

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

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

Specified by:
getValue in class javax.faces.el.PropertyResolver
Parameters:
base - The base object whose property value is to be returned
name - Name of the property to be returned
Throws:
NullPointerException - if base or name is null
javax.faces.el.PropertyNotFoundException - if the specified property name does not exist, or is not readable

getValue

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

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

Specified by:
getValue in class javax.faces.el.PropertyResolver
Parameters:
base - The base object whose property value is to be returned
index - Index of the value to return
Throws:
IndexOutOfBoundsException - if thrown by the underlying access to the base object
NullPointerException - if base is null
javax.faces.el.PropertyNotFoundException - if some other exception occurs

setValue

public void setValue(Object base,
                     Object name,
                     Object value)
              throws javax.faces.el.PropertyNotFoundException

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

Specified by:
setValue in class javax.faces.el.PropertyResolver
Parameters:
base - The base object whose property value is to be set
name - Name of the property to be set
value - Value of the property to be set
Throws:
NullPointerException - if base or name is null
javax.faces.el.PropertyNotFoundException - if the specified property name does not exist, or is not writeable

setValue

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

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

Specified by:
setValue in class javax.faces.el.PropertyResolver
Parameters:
base - The base object whose property value is to be set
index - Index of the value to set
value - Value to be set
Throws:
IndexOutOfBoundsException - if thrown by the underlying access to the base object
NullPointerException - if base is null
javax.faces.el.PropertyNotFoundException - if some other exception occurs

isReadOnly

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

Return true if the specified property of the specified base object is known to be immutable; otherwise, return false.

Specified by:
isReadOnly in class javax.faces.el.PropertyResolver
Parameters:
base - The base object whose property is to analyzed
name - Name of the property to be analyzed
Throws:
NullPointerException - if base or name is null
javax.faces.el.PropertyNotFoundException - if the specified property name does not exist

isReadOnly

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

Return true if the value at the specified index of the specified base object is known to be immutable; otherwise, return false.

Specified by:
isReadOnly in class javax.faces.el.PropertyResolver
Parameters:
base - The base object whose property is to analyzed
index - Index of the value whose type is to be returned
Throws:
IndexOutOfBoundsException - if thrown by the underlying accessed to the indexed property
NullPointerException - if base is null
javax.faces.el.PropertyNotFoundException - if some other exception occurs

getType

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

Return the java.lang.Class representing the type of the specified property of the specified base object, if it can be determined; otherwise return null.

Specified by:
getType in class javax.faces.el.PropertyResolver
Parameters:
base - The base object whose property is to analyzed
name - Name of the property to be analyzed
Throws:
NullPointerException - if base or name is null
javax.faces.el.PropertyNotFoundException - if the specified property name does not exist

getType

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

Return the java.lang.Class representing the type of value at the specified index of the specified base object, or null if this value is null.

Specified by:
getType in class javax.faces.el.PropertyResolver
Parameters:
base - The base object whose property is to analyzed
index - Index of the value whose type is to be returned
Throws:
IndexOutOfBoundsException - if thrown by the underlying accessed to the indexed property
NullPointerException - if base is null
javax.faces.el.PropertyNotFoundException - if some other exception occurs


Copyright © 2000-2008 Apache Software Foundation. All Rights Reserved.