T
- the type being editedE
- the Editor typepublic class MockSimpleBeanEditorDriver<T,E extends Editor<T>> extends java.lang.Object implements SimpleBeanEditorDriver<T,E>
SimpleBeanEditorDriver
that records its
inputs.Constructor and Description |
---|
MockSimpleBeanEditorDriver() |
Modifier and Type | Method and Description |
---|---|
void |
accept(EditorVisitor visitor)
A no-op method.
|
void |
edit(T object)
Records
object . |
T |
flush()
Returns
null or the last value provided to edit(T) . |
E |
getEditor()
Returns
null or the last value provided to initialize(E)
. |
java.util.List<EditorError> |
getErrors()
Returns an empty list.
|
T |
getObject()
Returns
null or the last value provided to edit(T) . |
boolean |
hasErrors()
Returns
false . |
void |
initialize(E editor)
Records
editor . |
boolean |
isDirty()
Returns
false . |
boolean |
setConstraintViolations(java.lang.Iterable<ConstraintViolation<?>> violations)
A no-op method that always returns false.
|
public void accept(EditorVisitor visitor)
accept
in interface EditorDriver<T>
public void edit(T object)
object
.public T flush()
null
or the last value provided to edit(T)
.flush
in interface EditorDriver<T>
flush
in interface SimpleBeanEditorDriver<T,E extends Editor<T>>
SimpleBeanEditorDriver.edit(Object)
public E getEditor()
null
or the last value provided to initialize(E)
.public java.util.List<EditorError> getErrors()
getErrors
in interface EditorDriver<T>
EditorError
instancespublic boolean hasErrors()
false
.hasErrors
in interface EditorDriver<T>
true
if errors are presentpublic void initialize(E editor)
editor
.initialize
in interface SimpleBeanEditorDriver<T,E extends Editor<T>>
editor
- the Editor to populatepublic boolean isDirty()
false
.isDirty
in interface EditorDriver<T>
EditorDelegate.setDirty(boolean)
public boolean setConstraintViolations(java.lang.Iterable<ConstraintViolation<?>> violations)
setConstraintViolations
in interface EditorDriver<T>
violations
- an Iterable over ConstraintViolation
instancestrue
if there were any unconsumed EditorErrors which
can be retrieved from EditorDriver.getErrors()