|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.springframework.binding.value.support.AbstractPropertyChangePublisher
org.springframework.binding.form.support.DefaultFieldMetadata
public class DefaultFieldMetadata
Default implementation of FieldMetadata.
NOTE: This is a framework internal class and should not be instantiated in user code.
Field Summary |
---|
Fields inherited from class org.springframework.binding.value.support.AbstractPropertyChangePublisher |
---|
logger |
Fields inherited from interface org.springframework.binding.form.FieldMetadata |
---|
DIRTY_PROPERTY, ENABLED_PROPERTY, READ_ONLY_PROPERTY |
Constructor Summary | |
---|---|
DefaultFieldMetadata(FormModel formModel,
DirtyTrackingValueModel valueModel,
Class propertyType,
boolean forceReadOnly,
Map userMetadata)
Constructs a new instance of DefaultFieldMetadata. |
Method Summary | |
---|---|
void |
clearUserMetadata()
Clears all custom metadata associated with this property. |
Map |
getAllUserMetadata()
Returns all custom metadata associated with this property in the form of a Map. |
Class |
getPropertyType()
Return the type of this property. |
Object |
getUserMetadata(String key)
Returns custom metadata that may be associated with this property. |
boolean |
isDirty()
Returns whether or not the property is dirty. |
boolean |
isEnabled()
Returns whether or not the property is enabled. |
boolean |
isReadOnly()
Returns whether or not the property is read only. |
void |
setEnabled(boolean enabled)
Sets the enabled value for this property. |
void |
setReadOnly(boolean readOnly)
Sets whether or not this property is read only. |
void |
setUserMetadata(String key,
Object value)
Sets custom metadata to be associated with this property. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.springframework.binding.value.PropertyChangePublisher |
---|
addPropertyChangeListener, addPropertyChangeListener, removePropertyChangeListener, removePropertyChangeListener |
Constructor Detail |
---|
public DefaultFieldMetadata(FormModel formModel, DirtyTrackingValueModel valueModel, Class propertyType, boolean forceReadOnly, Map userMetadata)
formModel
- the form modelvalueModel
- the value model for the propertypropertyType
- the type of the propertyforceReadOnly
- should readOnly be forced to true; this is
required if the property can not be modified. e.g.
at the PropertyAccessStrategy level.userMetadata
- map using String keys containing user defined
metadata. As an example, tiger extensions
currently use this to expose JDK 1.5 annotations on
the backing object as property metadata. This
parameter may be null
.Method Detail |
---|
public void setReadOnly(boolean readOnly)
FieldMetadata
It's expected that controls bound to this form property will listen for changes to this value and if possible modify their display/behaviour to reflect the new state. e.g. When this property becomes true a text component would grey its self out and prevent any editing.
This value will be propagated up to any descendants.
setReadOnly
in interface FieldMetadata
readOnly
- should this property be read onlypublic boolean isReadOnly()
FieldMetadata
A property is read only if any of the following are true:
isReadOnly
in interface FieldMetadata
public void setEnabled(boolean enabled)
FieldMetadata
It's expected that controls bound to this form property will listen for changes to this value and if possible modify their display/behaviour to reflect the new state.
This value will be propagated up to any descendants.
setEnabled
in interface FieldMetadata
enabled
- should this property be enabledpublic boolean isEnabled()
FieldMetadata
A property is enabled if all of the following are true:
isEnabled
in interface FieldMetadata
public boolean isDirty()
FieldMetadata
isDirty
in interface FieldMetadata
public Class getPropertyType()
FieldMetadata
getPropertyType
in interface FieldMetadata
public Object getUserMetadata(String key)
FieldMetadata
getUserMetadata
in interface FieldMetadata
public Map getAllUserMetadata()
FieldMetadata
getAllUserMetadata
in interface FieldMetadata
public void setUserMetadata(String key, Object value)
value
differs from the
current value of the specified key
. The property change
event will use the value of key
as the property name in
the property change event.
key
- value
- public void clearUserMetadata()
key
that contained a
non-null value before this method was invoked. It is possible for a
PropertyChangeListener to mutate user metadata, by setting a key value
for example, in response to one of these property change events fired
during the course of the clear operation. Because of this, there is
no guarantee that all user metadata is in fact completely clear and
empty by the time this method returns.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |