|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.springframework.binding.value.support.AbstractPropertyChangePublisher
org.springframework.binding.form.support.AbstractFormModel
org.springframework.binding.form.support.DefaultFormModel
public class DefaultFormModel
Default form model implementation. Is configurable, hierarchical and validating.
If you need this form model to use validation rules that are specific to a
given context (such as a specific form), then you will need to call
setValidator(Validator) with a validator configured with the
required context id. Like this:
RulesValidator validator = myValidatingFormModel.getValidator();
validator.setRulesContextId( "mySpecialFormId" );
Along with this you will need to register your rules using the context id.
See DefaultRulesSource.addRules(String, org.springframework.rules.Rules).
| Nested Class Summary | |
|---|---|
protected class |
DefaultFormModel.ValidatingFormValueModel
|
| Nested classes/interfaces inherited from class org.springframework.binding.form.support.AbstractFormModel |
|---|
AbstractFormModel.ChildStateChangeHandler, AbstractFormModel.ConvertingValueModelKey, AbstractFormModel.ParentStateChangeHandler |
| Field Summary |
|---|
| Fields inherited from class org.springframework.binding.form.support.AbstractFormModel |
|---|
childStateChangeHandler, parentStateChangeHandler |
| Fields inherited from class org.springframework.binding.value.support.AbstractPropertyChangePublisher |
|---|
logger |
| Fields inherited from interface org.springframework.binding.form.ValidatingFormModel |
|---|
VALIDATING_PROPERTY |
| Fields inherited from interface org.springframework.binding.form.FormModel |
|---|
COMMITTABLE_PROPERTY, DIRTY_PROPERTY, ENABLED_PROPERTY, READONLY_PROPERTY |
| Fields inherited from interface org.springframework.richclient.core.Authorizable |
|---|
AUTHORIZED_PROPERTY |
| Constructor Summary | |
|---|---|
DefaultFormModel()
|
|
DefaultFormModel(MutablePropertyAccessStrategy domainObjectAccessStrategy)
|
|
DefaultFormModel(MutablePropertyAccessStrategy domainObjectAccessStrategy,
boolean bufferChanges)
|
|
DefaultFormModel(Object domainObject)
|
|
DefaultFormModel(Object domainObject,
boolean buffered)
|
|
DefaultFormModel(ValueModel domainObjectHolder)
|
|
DefaultFormModel(ValueModel domainObjectHolder,
boolean buffered)
|
|
| Method Summary | |
|---|---|
void |
addChild(HierarchicalFormModel child)
Add child to this FormModel. |
protected void |
childStateChanged(PropertyChangeEvent evt)
Events from the child form model or value models that have side-effects on this form model should be handled here. |
protected void |
clearBindingError(DefaultFormModel.ValidatingFormValueModel valueModel)
|
void |
clearValidationMessage(ValidationMessage validationMessage)
Clear validation messages that are generated by a process separate from the standard Validator. |
protected void |
formPropertyValueChanged(String formProperty)
|
protected ValidationMessage |
getBindingErrorMessage(String propertyName,
Object valueBeingSet,
Exception e)
|
boolean |
getHasErrors()
Does this ValidatingFormModel or any of its children contain errors? |
ValidationResultsModel |
getValidationResults()
Returns the ValidationResultsModel which encapsulates the set of validation messages currently active against this form model. |
Validator |
getValidator()
Get the validator that will be used to validate the form model. |
protected void |
hasErrorsUpdated()
|
protected void |
init()
Initialization of DefaultFormModel. |
boolean |
isCommittable()
Returns true if the changes held by this form are able to be committed. |
boolean |
isValidating()
Is this form model currently validating? |
protected void |
parentStateChanged(PropertyChangeEvent evt)
Events from the parent form model that have side-effects on this form model should be handled here. |
protected void |
postProcessNewConvertingValueModel(String formProperty,
Class targetClass,
ValueModel valueModel)
Provides a hook for subclasses to perform some processing after a new converting value model has been added to this form model. |
protected void |
postProcessNewValueModel(String formProperty,
ValueModel valueModel)
Provides a hook for subclasses to perform some processing after a new value model has been added to this form model. |
protected ValueModel |
preProcessNewConvertingValueModel(String formProperty,
Class targetClass,
ValueModel formValueModel)
Provides a hook for subclasses to optionally decorate a new converting value model added to this form model. |
protected ValueModel |
preProcessNewValueModel(String formProperty,
ValueModel formValueModel)
Provides a hook for subclasses to optionally decorate a new value model added to this form model. |
protected void |
raiseBindingError(DefaultFormModel.ValidatingFormValueModel valueModel,
Object valueBeingSet,
Exception e)
|
void |
raiseValidationMessage(ValidationMessage validationMessage)
Provide validation messages that are generated by a process separate from the standard Validator. |
void |
removeChild(HierarchicalFormModel child)
Remove a child FormModel. |
void |
removeParent()
Remove the parent form model |
void |
setBindingErrorMessageProvider(BindingErrorMessageProvider bindingErrorMessageProvider)
|
void |
setParent(HierarchicalFormModel parent)
Sets the parent form model. |
void |
setValidating(boolean validating)
Sets whether or not validation is currently enabled for this form model. |
void |
setValidator(Validator validator)
Set the validator that will be used to validate the form model. |
String |
toString()
|
void |
validate()
Forces the form model to validate its self. |
protected void |
validateAfterPropertyChanged(String formProperty)
|
protected void |
validatingUpdated()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.springframework.binding.form.ConfigurableFormModel |
|---|
add, add, add, addMethod, addMethod, setEnabled, setId, setReadOnly |
| Methods inherited from interface org.springframework.binding.form.HierarchicalFormModel |
|---|
getChildren, getParent |
| Methods inherited from interface org.springframework.binding.form.FormModel |
|---|
addCommitListener, commit, getFieldFace, getFieldMetadata, getFieldNames, getFormObject, getFormObjectHolder, getId, getValueModel, getValueModel, hasValueModel, isBuffered, isDirty, isEnabled, isReadOnly, registerPropertyConverter, removeCommitListener, reset, revert, setFormObject |
| Methods inherited from interface org.springframework.binding.value.PropertyChangePublisher |
|---|
addPropertyChangeListener, addPropertyChangeListener, removePropertyChangeListener, removePropertyChangeListener |
| Methods inherited from interface org.springframework.richclient.core.Authorizable |
|---|
isAuthorized, setAuthorized |
| Constructor Detail |
|---|
public DefaultFormModel()
public DefaultFormModel(Object domainObject)
public DefaultFormModel(Object domainObject,
boolean buffered)
public DefaultFormModel(ValueModel domainObjectHolder)
public DefaultFormModel(ValueModel domainObjectHolder,
boolean buffered)
public DefaultFormModel(MutablePropertyAccessStrategy domainObjectAccessStrategy)
public DefaultFormModel(MutablePropertyAccessStrategy domainObjectAccessStrategy,
boolean bufferChanges)
| Method Detail |
|---|
protected void init()
public boolean isValidating()
isValidating in interface ValidatingFormModelpublic void setValidating(boolean validating)
ValidatingFormModel
setValidating in interface ValidatingFormModelprotected void validatingUpdated()
public void addChild(HierarchicalFormModel child)
AbstractFormModel
addChild in interface HierarchicalFormModeladdChild in class AbstractFormModelchild - FormModel to add as child.public void removeChild(HierarchicalFormModel child)
AbstractFormModel
removeChild in interface HierarchicalFormModelremoveChild in class AbstractFormModelchild - FormModel to remove from childlist.protected void childStateChanged(PropertyChangeEvent evt)
AbstractFormModel.parentStateChanged(PropertyChangeEvent).
Additionally the DefaultFormModel adds the event:
ValidationResultsModel as a child model of
the DefaultFormModel as the result model is bundled together with
the value models.
childStateChanged in class AbstractFormModelpublic void setParent(HierarchicalFormModel parent)
AbstractFormModel
setParent in interface HierarchicalFormModelsetParent in class AbstractFormModelprotected void parentStateChanged(PropertyChangeEvent evt)
DefaultFormModel adds the event:
parentStateChanged in class AbstractFormModelpublic void removeParent()
HierarchicalFormModel
removeParent in interface HierarchicalFormModelremoveParent in class AbstractFormModelpublic ValidationResultsModel getValidationResults()
ValidatingFormModel
getValidationResults in interface ValidatingFormModelpublic boolean getHasErrors()
ValidatingFormModel
getHasErrors in interface ValidatingFormModelprotected void hasErrorsUpdated()
public void validate()
ValidatingFormModel
validate in interface ValidatingFormModelpublic Validator getValidator()
ValidatingFormModel
getValidator in interface ValidatingFormModelpublic void setValidator(Validator validator)
Setting a validator will trigger a validate of the current object.
setValidator in interface ValidatingFormModelpublic boolean isCommittable()
FormModel
isCommittable in interface FormModelisCommittable in class AbstractFormModel
protected ValueModel preProcessNewValueModel(String formProperty,
ValueModel formValueModel)
AbstractFormModel
preProcessNewValueModel in class AbstractFormModel
protected void postProcessNewValueModel(String formProperty,
ValueModel valueModel)
AbstractFormModel
postProcessNewValueModel in class AbstractFormModel
protected ValueModel preProcessNewConvertingValueModel(String formProperty,
Class targetClass,
ValueModel formValueModel)
AbstractFormModel
preProcessNewConvertingValueModel in class AbstractFormModel
protected void postProcessNewConvertingValueModel(String formProperty,
Class targetClass,
ValueModel valueModel)
AbstractFormModel
postProcessNewConvertingValueModel in class AbstractFormModelprotected void formPropertyValueChanged(String formProperty)
protected void validateAfterPropertyChanged(String formProperty)
formProperty - the name of the only property that has changed since
the last call to validateAfterPropertyChange or null if
this is not known/available.
protected void raiseBindingError(DefaultFormModel.ValidatingFormValueModel valueModel,
Object valueBeingSet,
Exception e)
protected void clearBindingError(DefaultFormModel.ValidatingFormValueModel valueModel)
public void raiseValidationMessage(ValidationMessage validationMessage)
ValidatingFormModel
All error messages that are raised using this method must be cleared
using the method #cleanValdationMessage(ValidationMessage) before
the form model can be commited.
raiseValidationMessage in interface ValidatingFormModelvalidationMessage - the message to raisepublic void clearValidationMessage(ValidationMessage validationMessage)
ValidatingFormModel
clearValidationMessage in interface ValidatingFormModelvalidationMessage - the message to clear
protected ValidationMessage getBindingErrorMessage(String propertyName,
Object valueBeingSet,
Exception e)
public void setBindingErrorMessageProvider(BindingErrorMessageProvider bindingErrorMessageProvider)
public String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||