|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sun.data.provider.impl.ObjectFieldKeySupport
public class ObjectFieldKeySupport
Support class for DataProvider implementations that need to
instrospect Java classes to discover properties (and optionally public
fields) and return FieldKey instances for them.
| Constructor Summary | |
|---|---|
ObjectFieldKeySupport(java.lang.Class clazz,
boolean includeFields)
Construct a new support instance wrapping the specified class, with the specified flag for including public fields. |
|
| Method Summary | |
|---|---|
FieldKey |
getFieldKey(java.lang.String fieldId)
Return the FieldKey associated with the specified canonical
identifier, if any; otherwise, return null. |
FieldKey[] |
getFieldKeys()
Return an array of all supported FieldKeys. |
java.lang.Class |
getType(FieldKey fieldKey)
Return the type of the field associated with the specified FieldKey, if it can be determined; otherwise, return
null. |
java.lang.Object |
getValue(FieldKey fieldKey,
java.lang.Object base)
Return the value for the specified FieldKey, from the
specified base object. |
boolean |
isAssignable(FieldKey fieldKey,
java.lang.Object value)
Return true if the specified value may be
successfully assigned to the specified field. |
boolean |
isReadOnly(FieldKey fieldKey)
Return the read only state of the field associated with the specified FieldKey, if it can be determined, otherwise,
return true. |
void |
setValue(FieldKey fieldKey,
java.lang.Object base,
java.lang.Object value)
Set the value for the specified FieldKey, 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 ObjectFieldKeySupport(java.lang.Class clazz,
boolean includeFields)
Construct a new support instance wrapping the specified class, with the specified flag for including public fields.
WARNING - Instances of this class will not be
Serializable, so callers should not attempt to save
fields containing such instances.
clazz - Class whose properties should be exposedincludeFields - Flag indicating whether public fields should
also be included| Method Detail |
|---|
public FieldKey getFieldKey(java.lang.String fieldId)
throws DataProviderException
Return the FieldKey associated with the specified canonical
identifier, if any; otherwise, return null.
fieldId - Canonical identifier of the required field
DataProviderException
public FieldKey[] getFieldKeys()
throws DataProviderException
Return an array of all supported FieldKeys.
DataProviderException
public java.lang.Class getType(FieldKey fieldKey)
throws DataProviderException
Return the type of the field associated with the specified
FieldKey, if it can be determined; otherwise, return
null.
fieldKey - FieldKey to return the type for
DataProviderException
public java.lang.Object getValue(FieldKey fieldKey,
java.lang.Object base)
throws DataProviderException
Return the value for the specified FieldKey, from the
specified base object.
fieldKey - FieldKey for the requested fieldbase - Base object to be used
DataProviderException
public boolean isAssignable(FieldKey fieldKey,
java.lang.Object value)
throws DataProviderException
Return true if the specified value may be
successfully assigned to the specified field.
fieldKey - FieldKey to check assignability forvalue - Proposed value
DataProviderException
public boolean isReadOnly(FieldKey fieldKey)
throws DataProviderException
Return the read only state of the field associated with the
specified FieldKey, if it can be determined, otherwise,
return true.
fieldKey - FieldKey to return read only state for
DataProviderException
public void setValue(FieldKey fieldKey,
java.lang.Object base,
java.lang.Object value)
throws DataProviderException
Set the value for the specified FieldKey, on the
specified base object.
fieldKey - FieldKey for the requested fieldbase - Base object to be usedvalue - Value to be set
java.lang.IllegalArgumentException - if a type mismatch occurs
java.lang.IllegalStateException - if setting a read only field
is attempted
DataProviderException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||