| org.apache.struts.faces.application.PropertyResolverImpl
PropertyResolverImpl | public class PropertyResolverImpl extends PropertyResolver (Code) | | 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:
- Indexed variants of each call are directly passed through to the
PropertyResolver instance that we are wrapping.
- If the specified base object is an instance of
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 .
- If the specified base object is an instance of
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.
- Named variant calls with any other type of base object are
passed through to the
PropertyResolver that we
are wrapping.
version: $Rev: 471754 $ $Date: 2006-11-06 08:55:09 -0600 (Mon, 06 Nov 2006) $ |
Constructor Summary | |
public | PropertyResolverImpl(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 | |
public Class | getType(Object base, Object name) | public Class | getType(Object base, int index) | public Object | getValue(Object base, Object name) | public Object | getValue(Object base, int index) | public boolean | isReadOnly(Object base, Object name) | public boolean | isReadOnly(Object base, int index) | public void | setValue(Object base, Object name, Object value) | public void | setValue(Object base, int index, Object value) |
PropertyResolverImpl | public PropertyResolverImpl(PropertyResolver resolver)(Code) | | 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 exception: NullPointerException - if resolver is null |
getType | public Class getType(Object base, Object name) throws PropertyNotFoundException(Code) | | 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 .
Parameters: base - The base object whose property is to analyzed Parameters: name - Name of the property to be analyzed exception: NullPointerException - if base orname is null exception: PropertyNotFoundException - if the specified property namedoes not exist |
getType | public Class getType(Object base, int index) throws PropertyNotFoundException(Code) | | 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 .
Parameters: base - The base object whose property is to analyzed Parameters: index - Index of the value whose type is to be returned exception: IndexOutOfBoundsException - if thrown by the underlyingaccessed to the indexed property exception: NullPointerException - if base is null exception: PropertyNotFoundException - if some other exception occurs |
getValue | public Object getValue(Object base, Object name) throws PropertyNotFoundException(Code) | | Return the value of the property with the specified name from
the specified base object.
Parameters: base - The base object whose property value is to be returned Parameters: name - Name of the property to be returned exception: NullPointerException - if base orname is null exception: PropertyNotFoundException - if the specified property namedoes not exist, or is not readable |
getValue | public Object getValue(Object base, int index) throws PropertyNotFoundException(Code) | | Return the value at the specified index of the specified
base object.
Parameters: base - The base object whose property value is to be returned Parameters: index - Index of the value to return exception: IndexOutOfBoundsException - if thrown by the underlyingaccess to the base object exception: NullPointerException - if base is null exception: PropertyNotFoundException - if some other exception occurs |
isReadOnly | public boolean isReadOnly(Object base, Object name) throws PropertyNotFoundException(Code) | | Return true if the specified property of the specified
base object is known to be immutable; otherwise, return
false .
Parameters: base - The base object whose property is to analyzed Parameters: name - Name of the property to be analyzed exception: NullPointerException - if base orname is null exception: PropertyNotFoundException - if the specified property namedoes not exist |
isReadOnly | public boolean isReadOnly(Object base, int index) throws PropertyNotFoundException(Code) | | Return true if the value at the specified index of
the specified base object is known to be immutable; otherwise,
return false .
Parameters: base - The base object whose property is to analyzed Parameters: index - Index of the value whose type is to be returned exception: IndexOutOfBoundsException - if thrown by the underlyingaccessed to the indexed property exception: NullPointerException - if base is null exception: PropertyNotFoundException - if some other exception occurs |
setValue | public void setValue(Object base, Object name, Object value) throws PropertyNotFoundException(Code) | | Set the specified value of the property with the specified name on
the specified base object.
Parameters: base - The base object whose property value is to be set Parameters: name - Name of the property to be set Parameters: value - Value of the property to be set exception: NullPointerException - if base orname is null exception: PropertyNotFoundException - if the specified property namedoes not exist, or is not writeable |
setValue | public void setValue(Object base, int index, Object value) throws PropertyNotFoundException(Code) | | Set the value at the specified index of the specified
base object.
Parameters: base - The base object whose property value is to be set Parameters: index - Index of the value to set Parameters: value - Value to be set exception: IndexOutOfBoundsException - if thrown by the underlyingaccess to the base object exception: NullPointerException - if base is null exception: PropertyNotFoundException - if some other exception occurs |
|
|