|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
javax.faces.el Class PropertyResolver
java.lang.Object javax.faces.el.PropertyResolver
Deprecated. This has been replaced by
ELResolver
.
PropertyResolver 表示一种可插入的机制,用于访问底层 Java 对象实例的“属性”。不同的 PropertyResolver
实现可以支持不同 Java 类实例上的属性解析(如对 JavaBean 组件属性进行基于内省的访问,或者对 java.util.Map
实例调用 get()
和 put()
)。
所有实现必须遵守为每个方法定义的 JavaBean 组件、java.util.Map
、java.util.List
和数组实例的规则,但允许为其他类型添加自定义语义。
deprecated |
由 javax.el.ELResolver 取代。 |
public abstract class PropertyResolver
- extends Object
PropertyResolver represents a pluggable mechanism
for accessing a "property" of an underlying Java object instance.
Different PropertyResolver
implementations can support
property resolution on instances of different Java classes (such as
introspection-based access to properties of a JavaBeans component, or
get()
and put()
calls on a
java.util.Map
instance).
All implementations must respect the rules for JavaBeans component,
java.util.Map
, java.util.List
and array
instances defined for each method but are allowed to add custom
semantics for other types.
Constructor Summary | |
---|---|
PropertyResolver()
Deprecated. |
Method Summary | |
---|---|
abstract Class |
getType(Object base,
int index)
Deprecated. Return the java.lang.Class representing the type of
the specified index. |
abstract Class |
getType(Object base,
Object property)
Deprecated. Return the java.lang.Class representing the type
of the specified property. |
abstract Object |
getValue(Object base,
int index)
Deprecated. Return the value at the specified index of the specified base object. |
abstract Object |
getValue(Object base,
Object property)
Deprecated. Return the value of the specified property from the specified base object. |
abstract boolean |
isReadOnly(Object base,
int index)
Deprecated. Checks if the specified index is read-only. |
abstract boolean |
isReadOnly(Object base,
Object property)
Deprecated. Checks if the specified property is read-only. |
abstract void |
setValue(Object base,
int index,
Object value)
Deprecated. Set the value at the specified index of the specified base object. |
abstract void |
setValue(Object base,
Object property,
Object value)
Deprecated. Set the specified value of the specified property 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
PropertyResolver()
英文文档:
PropertyResolver
public PropertyResolver()
- Deprecated.
Method Detail |
---|
abstract public Object
getValue(Object base, Object property) throws EvaluationException, PropertyNotFoundException
返回指定 base 对象的指定属性的值。
对于 Bean base 的对象,属性将强制匹配为 String
,并用作属性名称。对于所有其他 base 对象类型(例如 Map),使用该属性时没有任何强制匹配。
base | 要返回其属性值的 base 对象 |
property | 要返回的属性 |
return |
属性值;如果 base 或 property 为 null ,或者属性不存在且 base 对象为 Map 实例,则返回 null |
Throws | EvaluationException:
如果获取属性值时抛出异常(抛出的异常必须作为此异常的 cause 属性包含在内) |
Throws | PropertyNotFoundException: 如果 Bean base 对象的指定属性不存在或不可读 |
getValue
public abstract Object getValue(Object base, Object property) throws EvaluationException, PropertyNotFoundException
- Deprecated.
Return the value of the specified property from the specified base object.
For a bean base object, the property is coerced to a
String
and used as the property name. For all other base object types (e.g., a Map), the property is used without any coercing.- Parameters:
base
- The base object whose property value is to be returnedproperty
- The property to be returned- Returns:
- The property value, or
null
ifbase
orproperty
isnull
, or if the property doesn't exist and the base object is aMap
instance - Throws:
EvaluationException
- if an exception is thrown while getting the property value (the thrown exception must be included as thecause
property of this exception)PropertyNotFoundException
- if the specified property for a bean base object does not exist or is not readable
abstract public Object
getValue(Object base, int index) throws EvaluationException, PropertyNotFoundException
返回指定 base 对象的指定索引处的值。
base | 要返回其属性值的 base 对象 |
index | 要返回的值的索引 |
return |
属性值;如果 base 为 null ,或者索引超出 base 对象的边界,则为 null |
Throws | EvaluationException:
如果获取属性值时抛出异常(抛出的异常必须作为此异常的 cause 属性包含在内) |
Throws | PropertyNotFoundException:
如果索引超出边界,或者 base 为 null |
getValue
public abstract Object getValue(Object base, int index) throws EvaluationException, PropertyNotFoundException
- Deprecated.
Return the value at the specified index of the specified base object.
- Parameters:
base
- The base object whose property value is to be returnedindex
- The index of the value to return- Returns:
- The property value, or
null
ifbase
isnull
, or if the index is out of bounds for the base object - Throws:
EvaluationException
- if an exception is thrown while getting the property value (the thrown exception must be included as thecause
property of this exception)PropertyNotFoundException
- if the index is out of bounds or ifbase
isnull
abstract public void
setValue(Object base, Object property, Object value) throws EvaluationException, PropertyNotFoundException
设置指定 base 对象上指定属性的指定值。
对于 Bean base 的对象,属性将强制匹配为 String
,并用作属性名称。对于所有其他 base 对象类型(例如 Map),使用该属性时没有任何强制匹配。
base | 要设置其属性值的 base 对象 |
property | 要设置的属性 |
value | 要设置的属性值 |
Throws | EvaluationException:
如果设置属性值期间抛出异常(抛出的异常必须作为此异常的 cause 属性包含在内) |
Throws | PropertyNotFoundException:
如果指定的 Bean base 对象不存在或不可写,或者 base 或 name 为 null |
setValue
public abstract void setValue(Object base, Object property, Object value) throws EvaluationException, PropertyNotFoundException
- Deprecated.
Set the specified value of the specified property on the specified base object.
For a bean base object, the property is coerced to a
String
and used as the property name. For all other base object types (e.g., a Map), the property is used without any coercing.- Parameters:
base
- The base object whose property value is to be setproperty
- The property to be setvalue
- The value of the property to be set- Throws:
EvaluationException
- if an exception is thrown while setting the property value (the thrown exception must be included as thecause
property of this exception)PropertyNotFoundException
- if the specified bean base object property does not exist or is not writeable, or ifbase
orname
isnull
abstract public void
setValue(Object base, int index, Object value) throws EvaluationException, PropertyNotFoundException
设置指定 base 对象的指定索引处的值。
base | 要设置其属性值的 base 对象 |
index | 要设置的值的索引 |
value | 要设置的值 |
Throws | EvaluationException:
如果设置属性值期间抛出异常(抛出的异常必须作为此异常的 cause 属性包含在内) |
Throws | PropertyNotFoundException:
如果索引超出边界,或者 base 为 null |
setValue
public abstract void setValue(Object base, int index, Object value) throws EvaluationException, PropertyNotFoundException
- Deprecated.
Set the value at the specified index of the specified base object.
- Parameters:
base
- The base object whose property value is to be setindex
- The index of the value to setvalue
- The value to be set- Throws:
EvaluationException
- if an exception is thrown while setting the property value (the thrown exception must be included as thecause
property of this exception)PropertyNotFoundException
- if the index is out of bounds or ifbase
isnull
abstract public boolean
isReadOnly(Object base, Object property) throws EvaluationException, PropertyNotFoundException
检查指定的属性是否为只读。
对于 Bean base 的对象,属性将强制匹配为 String
,并用作属性名称。对于所有其他 base 对象类型(例如 Map),使用该属性时没有任何强制匹配。
base | 要分析其属性的 base 对象 |
property | 要分析的属性 |
return |
如果已知指定 base 对象的指定属性不可变,则返回 true ;否则返回 false |
Throws | EvaluationException:
如果测试属性期间抛出异常(抛出的异常必须作为此异常的 cause 属性包含在内) |
Throws | PropertyNotFoundException:
如果指定的 Bean base 对象不存在,或者 base 或 property 为 null |
isReadOnly
public abstract boolean isReadOnly(Object base, Object property) throws EvaluationException, PropertyNotFoundException
- Deprecated.
Checks if the specified property is read-only.
For a bean base object, the property is coerced to a
String
and used as the property name. For all other base object types (e.g., a Map), the property is used without any coercing.- Parameters:
base
- The base object whose property is to be analyzedproperty
- The property to be analyzed- Returns:
true
if the specified property of the specified base object is known to be immutable; otherwisefalse
- Throws:
EvaluationException
- if an exception is thrown while testing the property (the thrown exception must be included as thecause
property of this exception)PropertyNotFoundException
- if the specified bean base object property does not exist or ifbase
orproperty
isnull
abstract public boolean
isReadOnly(Object base, int index) throws EvaluationException, PropertyNotFoundException
检查指定的索引是否为只读。
base | 要分析其属性的 base 对象 |
index | 要返回其类型的值的索引 |
return |
如果已知指定 base 对象的指定索引处的值不可变,则返回 true ;否则返回 false |
Throws | EvaluationException:
如果测试属性期间抛出异常(抛出的异常必须作为此异常的 cause 属性包含在内) |
Throws | PropertyNotFoundException:
如果索引超出边界,或者 base 为 null |
isReadOnly
public abstract boolean isReadOnly(Object base, int index) throws EvaluationException, PropertyNotFoundException
- Deprecated.
Checks if the specified index is read-only.
- Parameters:
base
- The base object whose property is to be analyzedindex
- The index of the value whose type is to be returned- Returns:
true
if the value at the specified index of the specified base object is known to be immutable; otherwise,false
- Throws:
EvaluationException
- if an exception is thrown while testing the property (the thrown exception must be included as thecause
property of this exception)PropertyNotFoundException
- if the index is out of bounds or ifbase
isnull
abstract public Class<T>
getType(Object base, Object property) throws EvaluationException, PropertyNotFoundException
返回表示指定属性类型的 java.lang.Class
。只要属性不是只读的,就可以将该类型的任何对象的实例设置为该属性的值。保证属性的实际值(如果不为 null)是此类型的实例或者此类型子类的实例。对于发现可以设置为该属性的值的对象类型,此方法也非常有用。
对于 Bean base 的对象,属性将强制匹配为 String
,并用作属性名称。对于所有其他 base 对象类型(例如 Map),使用该属性时没有任何强制匹配。
base | 要分析其属性的 base 对象 |
property | 要分析的属性 |
return |
java.lang.Class (如果可以确定),它表示指定 base 对象的指定属性的类型;否则返回 null |
Throws | EvaluationException:
如果测试属性期间抛出异常(抛出的异常必须作为此异常的 cause 属性包含在内) |
Throws | PropertyNotFoundException:
如果指定的 Bean base 对象不存在,或者 base 或 property 为 null |
getType
public abstract Class getType(Object base, Object property) throws EvaluationException, PropertyNotFoundException
- Deprecated.
Return the
java.lang.Class
representing the type of the specified property. An instance of any Object of that type my be set as the value of that property, as long as the property is not read-only. The actual value of the property, if non-null, is guaranteed to be an instance of this type, or an instance of a subclass of this type. This method is also useful for discovering the type of Objects that may be set as the value of the property.For a bean base object, the property is coerced to a
String
and used as the property name. For all other base object types (e.g., a Map), the property is used without any coercing.- Parameters:
base
- The base object whose property is to be analyzedproperty
- The property to be analyzed- Returns:
- the
java.lang.Class
representing the type of the specified property of the specified base object, if it can be determined; otherwisenull
- Throws:
EvaluationException
- if an exception is thrown while testing the property (the thrown exception must be included as thecause
property of this exception)PropertyNotFoundException
- if the specified bean base object property does not exist or ifbase
orproperty
isnull
abstract public Class<T>
getType(Object base, int index) throws EvaluationException, PropertyNotFoundException
返回表示指定索引类型的 java.lang.Class
。
base | 要分析其属性的 base 对象 |
index | 要返回其类型的值的索引 |
return |
java.lang.Class (如果可以确定),它表示指定 base 对象指定索引处的值的类型;否则返回 null |
Throws | EvaluationException:
如果测试属性期间抛出异常(抛出的异常必须作为此异常的 cause 属性包含在内) |
Throws | PropertyNotFoundException:
如果索引超出边界,或者 base 为 null |
getType
public abstract Class getType(Object base, int index) throws EvaluationException, PropertyNotFoundException
- Deprecated.
Return the
java.lang.Class
representing the type of the specified index.- Parameters:
base
- The base object whose property is to be analyzedindex
- The index of the value whose type is to be returned- Returns:
- The
java.lang.Class
representing the type of value at the specified index of the specified base object, if it can be determined; otherwisenull
- Throws:
EvaluationException
- if an exception is thrown while testing the property (the thrown exception must be included as thecause
property of this exception)PropertyNotFoundException
- if the index is out of bounds or ifbase
isnull
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Submit a bug or feature
Copyright 2007 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.
PS : 未经我党受权你也可自由散发此文档。 如有任何错误请自行修正;若因此而造成任何损失请直接找人民主席,请勿与本人联系。谢谢!