org.springframework.binding.form
Interface FieldMetadata

All Superinterfaces:
PropertyChangePublisher
All Known Implementing Classes:
DefaultFieldMetadata, ReadOnlyFieldMetadata

public interface FieldMetadata
extends PropertyChangePublisher

Encapsulates the state of an individual property of a form model.

Author:
Oliver Hutchison

Field Summary
static String DIRTY_PROPERTY
          The name of the bound property dirty.
static String ENABLED_PROPERTY
          The name of the bound property enabled.
static String READ_ONLY_PROPERTY
          The name of the bound property readOnly.
 
Method Summary
 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.
 
Methods inherited from interface org.springframework.binding.value.PropertyChangePublisher
addPropertyChangeListener, addPropertyChangeListener, removePropertyChangeListener, removePropertyChangeListener
 

Field Detail

ENABLED_PROPERTY

static final String ENABLED_PROPERTY
The name of the bound property enabled.

See Also:
Constant Field Values

READ_ONLY_PROPERTY

static final String READ_ONLY_PROPERTY
The name of the bound property readOnly.

See Also:
Constant Field Values

DIRTY_PROPERTY

static final String DIRTY_PROPERTY
The name of the bound property dirty.

See Also:
Constant Field Values
Method Detail

getPropertyType

Class getPropertyType()
Return the type of this property.


getUserMetadata

Object getUserMetadata(String key)
Returns custom metadata that may be associated with this property.


getAllUserMetadata

Map getAllUserMetadata()
Returns all custom metadata associated with this property in the form of a Map.

Returns:
Map containing String keys

setReadOnly

void setReadOnly(boolean readOnly)
Sets whether or not this property is read only.

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.

Parameters:
readOnly - should this property be read only

isReadOnly

boolean isReadOnly()
Returns whether or not the property is read only.

A property is read only if any of the following are true:


setEnabled

void setEnabled(boolean enabled)
Sets the enabled value for this property.

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.

Parameters:
enabled - should this property be enabled

isEnabled

boolean isEnabled()
Returns whether or not the property is enabled.

A property is enabled if all of the following are true:


isDirty

boolean isDirty()
Returns whether or not the property is dirty.



Copyright © 2004-2008 The Spring Framework. All Rights Reserved.