Interface Editor<T,A>
-
- Type Parameters:
T- The edited entity type.A- The edited member type for this editor/sub-editor.
- All Superinterfaces:
Viewer<T>
- All Known Subinterfaces:
GroupEditor,RoleEditor,UserAssignedGroupsEditor,UserAssignedGroupsExplorer,UserAssignedRolesEditor,UserAssignedRolesExplorer,UserAttributesEditor,UserEditor
public interface Editor<T,A> extends Viewer<T>
A client side editor.
Editors should implement this interface in order to isolate the editor components from the editing logic (provided by drivers) and the instance edited.
Editor sub-types should add more interface methods to describe the whole editor hierarchy for the instance of type
T.The most common edition workflow consist of:
- Create the editor implementation instance and call
edit()using the edited instance as argument. - Let the user interact with the editors and update their states.
- Flush the whole editors hierarchy to ensure editor's states are up to date.
- Obtain the edited instance member values from each editor in the hierarchy by calling
getValue(). - Validate the edited instance using any JSR303 validators for it.
- Set the resulting violations, if any, into the editors hierarchy to display the validation errors.
- Since:
- 0.8.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidedit(T instance)Initialize the editor hierarchy using the instance given.voidflush()Flush editor's state.AgetValue()Get edited value.voidsetViolations(Set<javax.validation.ConstraintViolation<T>> violations)Set validation violations into the editor hierarchy.
-