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:
javax.naming.Name
) suitable for passing
to the lookup()
method of the Context
.
The Context has no way to describe whether it is read only or not,
so isReadOnly()
returns false
.map
- Delegates to the original resolver's handling
of the map
property. This is for backwards compatibility
with applications depending on this behavior from the 1.0.0
version of the class.Locale
from the current
view for selecting the appropriate translation.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 and Description |
---|
ShalePropertyResolver(javax.faces.el.PropertyResolver original)
Construct a new
ShalePropertyResolver instance. |
Modifier and Type | Method and Description |
---|---|
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 . |
public ShalePropertyResolver(javax.faces.el.PropertyResolver original)
Construct a new ShalePropertyResolver
instance.
original
- Original resolver to delegate to.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:
map
, call the corresponding
property getter and return that value.Map
that
is returned by the getMap()
call.getValue
in class javax.faces.el.PropertyResolver
base
- Base object from which to return a propertyproperty
- Property to be returnedjavax.faces.el.EvaluationException
- if an evaluation error occursjavax.faces.el.PropertyNotFoundException
- if there is no such named
object in this contextpublic 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.
setValue
in class javax.faces.el.PropertyResolver
base
- Base object in which to store a propertyproperty
- Property to be storedvalue
- Value to be storedjavax.faces.el.EvaluationException
- if an evaluation error occursjavax.faces.el.PropertyNotFoundException
- if there is no such named
object in this contextpublic 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.
isReadOnly
in class javax.faces.el.PropertyResolver
base
- Base object from which to return read only stateproperty
- Property to be checkedjavax.faces.el.EvaluationException
- if an evaluation error occursjavax.faces.el.PropertyNotFoundException
- if there is no such named
object in this contextpublic 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.
getType
in class javax.faces.el.PropertyResolver
base
- Base object from which to return a property typeproperty
- Property whose type is to be returnedjavax.faces.el.EvaluationException
- if an evaluation error occursjavax.faces.el.PropertyNotFoundException
- if there is no such named
object in this contextpublic Object getValue(Object base, int index) throws javax.faces.el.EvaluationException, javax.faces.el.PropertyNotFoundException
Convert an index into a corresponding string, and delegate.
getValue
in class javax.faces.el.PropertyResolver
base
- Base object from which to return a propertyindex
- Index to be returnedjavax.faces.el.EvaluationException
- if an evaluation error occursjavax.faces.el.PropertyNotFoundException
- if there is no such named
object in this contextpublic 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.
setValue
in class javax.faces.el.PropertyResolver
base
- Base object into which to store a propertyindex
- Index to be storedvalue
- Value to be storedjavax.faces.el.EvaluationException
- if an evaluation error occursjavax.faces.el.PropertyNotFoundException
- if there is no such named
object in this contextpublic boolean isReadOnly(Object base, int index) throws javax.faces.el.EvaluationException, javax.faces.el.PropertyNotFoundException
Convert an index into a corresponding string, and delegate.
isReadOnly
in class javax.faces.el.PropertyResolver
base
- Base object from which to check a propertyindex
- Index to be checkedjavax.faces.el.EvaluationException
- if an evaluation error occursjavax.faces.el.PropertyNotFoundException
- if there is no such named
object in this contextpublic Class getType(Object base, int index) throws javax.faces.el.EvaluationException, javax.faces.el.PropertyNotFoundException
Convert an index into a corresponding string, and delegate.
getType
in class javax.faces.el.PropertyResolver
base
- Base object from which to return a property typeindex
- Index whose type is to be returnedjavax.faces.el.EvaluationException
- if an evaluation error occursjavax.faces.el.PropertyNotFoundException
- if there is no such named
object in this contextCopyright © 2004-2013 Apache Software Foundation. All Rights Reserved.