|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.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 | |
---|---|
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 |
---|
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
NullPointerException
- if resolver
is null
Method Detail |
---|
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.
getValue
in class javax.faces.el.PropertyResolver
base
- The base object whose property value is to be returnedname
- Name of the property to be returned
NullPointerException
- if base
or
name
is null
javax.faces.el.PropertyNotFoundException
- if the specified property name
does not exist, or is not readablepublic Object getValue(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.PropertyResolver
base
- The base object whose property value is to be returnedindex
- Index of the value to return
IndexOutOfBoundsException
- if thrown by the underlying
access to the base object
NullPointerException
- if base
is null
javax.faces.el.PropertyNotFoundException
- if some other exception occurspublic 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.
setValue
in class javax.faces.el.PropertyResolver
base
- The base object whose property value is to be setname
- Name of the property to be setvalue
- Value of the property to be set
NullPointerException
- if base
or
name
is null
javax.faces.el.PropertyNotFoundException
- if the specified property name
does not exist, or is not writeablepublic 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.
setValue
in class javax.faces.el.PropertyResolver
base
- The base object whose property value is to be setindex
- Index of the value to setvalue
- Value to be set
IndexOutOfBoundsException
- if thrown by the underlying
access to the base object
NullPointerException
- if base
is null
javax.faces.el.PropertyNotFoundException
- if some other exception occurspublic 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
.
isReadOnly
in class javax.faces.el.PropertyResolver
base
- The base object whose property is to analyzedname
- Name of the property to be analyzed
NullPointerException
- if base
or
name
is null
javax.faces.el.PropertyNotFoundException
- if the specified property name
does not existpublic 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
.
isReadOnly
in class javax.faces.el.PropertyResolver
base
- The base object whose property is to analyzedindex
- Index of the value whose type is to be returned
IndexOutOfBoundsException
- if thrown by the underlying
accessed to the indexed property
NullPointerException
- if base
is null
javax.faces.el.PropertyNotFoundException
- if some other exception occurspublic 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
.
getType
in class javax.faces.el.PropertyResolver
base
- The base object whose property is to analyzedname
- Name of the property to be analyzed
NullPointerException
- if base
or
name
is null
javax.faces.el.PropertyNotFoundException
- if the specified property name
does not existpublic 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
.
getType
in class javax.faces.el.PropertyResolver
base
- The base object whose property is to analyzedindex
- Index of the value whose type is to be returned
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
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |