|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjavax.faces.el.PropertyResolver
org.apache.struts.faces.application.PropertyResolverImpl
public class PropertyResolverImpl
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:
PropertyResolver instance that we are wrapping.DynaActionForm, and the requested property name is
map, maintain compatibility with the way that JSP and
JSTL expressions can access this property:
getValue() will return the result of calling
getMap() on the base object.setValue() will throw an exception, because the
map of property values is a read-only property of the
DynaActionForm class.isReadOnly() returns true.getType() returns the Class object
for java.util.Map.DynaBean, provide access to its named properties
as follows:
getValue() will return the result of calling
get() on the base object.setValue() will call set()
on the base object.isReadOnly() returns false (because
the DynaBean APIs provide no mechanism to make this determination,
but most implementations will provide mutable properties).getType() returns the Class object
for the underlying dynamic property.PropertyResolver that we
are wrapping.
| 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 | |
|---|---|
java.lang.Class |
getType(java.lang.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. |
java.lang.Class |
getType(java.lang.Object base,
java.lang.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. |
java.lang.Object |
getValue(java.lang.Object base,
int index)
Return the value at the specified index of the specified base object. |
java.lang.Object |
getValue(java.lang.Object base,
java.lang.Object name)
Return the value of the property with the specified name from the specified base object. |
boolean |
isReadOnly(java.lang.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(java.lang.Object base,
java.lang.Object name)
Return true if the specified property of the specified
base object is known to be immutable; otherwise, return
false. |
void |
setValue(java.lang.Object base,
int index,
java.lang.Object value)
Set the value at the specified index of the specified base object. |
void |
setValue(java.lang.Object base,
java.lang.Object name,
java.lang.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 |
|---|
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.
resolver - The original resolver to be wrapped
java.lang.NullPointerException - if resolver
is null| Method Detail |
|---|
public java.lang.Object getValue(java.lang.Object base,
java.lang.Object name)
throws javax.faces.el.PropertyNotFoundException
Return the value of the property with the specified name from the specified base object.
getValue in class javax.faces.el.PropertyResolverbase - The base object whose property value is to be returnedname - Name of the property to be returned
java.lang.NullPointerException - if base or
name is null
javax.faces.el.PropertyNotFoundException - if the specified property name
does not exist, or is not readable
public java.lang.Object getValue(java.lang.Object base,
int index)
throws javax.faces.el.PropertyNotFoundException
Return the value at the specified index of the specified base object.
getValue in class javax.faces.el.PropertyResolverbase - The base object whose property value is to be returnedindex - Index of the value to return
java.lang.IndexOutOfBoundsException - if thrown by the underlying
access to the base object
java.lang.NullPointerException - if base
is null
javax.faces.el.PropertyNotFoundException - if some other exception occurs
public void setValue(java.lang.Object base,
java.lang.Object name,
java.lang.Object value)
throws javax.faces.el.PropertyNotFoundException
Set the specified value of the property with the specified name on the specified base object.
setValue in class javax.faces.el.PropertyResolverbase - The base object whose property value is to be setname - Name of the property to be setvalue - Value of the property to be set
java.lang.NullPointerException - if base or
name is null
javax.faces.el.PropertyNotFoundException - if the specified property name
does not exist, or is not writeable
public void setValue(java.lang.Object base,
int index,
java.lang.Object value)
throws javax.faces.el.PropertyNotFoundException
Set the value at the specified index of the specified base object.
setValue in class javax.faces.el.PropertyResolverbase - The base object whose property value is to be setindex - Index of the value to setvalue - Value to be set
java.lang.IndexOutOfBoundsException - if thrown by the underlying
access to the base object
java.lang.NullPointerException - if base
is null
javax.faces.el.PropertyNotFoundException - if some other exception occurs
public boolean isReadOnly(java.lang.Object base,
java.lang.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.
isReadOnly in class javax.faces.el.PropertyResolverbase - The base object whose property is to analyzedname - Name of the property to be analyzed
java.lang.NullPointerException - if base or
name is null
javax.faces.el.PropertyNotFoundException - if the specified property name
does not exist
public boolean isReadOnly(java.lang.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.
isReadOnly in class javax.faces.el.PropertyResolverbase - The base object whose property is to analyzedindex - Index of the value whose type is to be returned
java.lang.IndexOutOfBoundsException - if thrown by the underlying
accessed to the indexed property
java.lang.NullPointerException - if base
is null
javax.faces.el.PropertyNotFoundException - if some other exception occurs
public java.lang.Class getType(java.lang.Object base,
java.lang.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.
getType in class javax.faces.el.PropertyResolverbase - The base object whose property is to analyzedname - Name of the property to be analyzed
java.lang.NullPointerException - if base or
name is null
javax.faces.el.PropertyNotFoundException - if the specified property name
does not exist
public java.lang.Class getType(java.lang.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.
getType in class javax.faces.el.PropertyResolverbase - The base object whose property is to analyzedindex - Index of the value whose type is to be returned
java.lang.IndexOutOfBoundsException - if thrown by the underlying
accessed to the indexed property
java.lang.NullPointerException - if base
is null
javax.faces.el.PropertyNotFoundException - if some other exception occurs
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||