Class MockSimpleBeanEditorDriver<T,E extends Editor<T>>
java.lang.Object
com.google.gwt.editor.client.testing.MockSimpleBeanEditorDriver<T,E>
- Type Parameters:
T
- the type being editedE
- the Editor type
- All Implemented Interfaces:
EditorDriver<T>
,SimpleBeanEditorDriver<T,
E>
public class MockSimpleBeanEditorDriver<T,E extends Editor<T>>
extends Object
implements SimpleBeanEditorDriver<T,E>
A no-op implementation of
SimpleBeanEditorDriver
that records its
inputs.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
accept
(EditorVisitor visitor) A no-op method.void
Recordsobject
.flush()
Returnsnull
or the last value provided toedit(T)
.Returnsnull
or the last value provided toinitialize(E)
.Returns an empty list.Returnsnull
or the last value provided toedit(T)
.boolean
Returnsfalse
.void
initialize
(E editor) Recordseditor
.boolean
isDirty()
Returnsfalse
.boolean
setConstraintViolations
(Iterable<ConstraintViolation<?>> violations) A no-op method that always returns false.
-
Constructor Details
-
MockSimpleBeanEditorDriver
public MockSimpleBeanEditorDriver()
-
-
Method Details
-
accept
A no-op method.- Specified by:
accept
in interfaceEditorDriver<T>
-
edit
Recordsobject
. -
flush
Returnsnull
or the last value provided toedit(T)
.- Specified by:
flush
in interfaceEditorDriver<T>
- Specified by:
flush
in interfaceSimpleBeanEditorDriver<T,
E extends Editor<T>> - Returns:
- the object passed into
SimpleBeanEditorDriver.edit(Object)
-
getEditor
Returnsnull
or the last value provided toinitialize(E)
. -
getErrors
Returns an empty list.- Specified by:
getErrors
in interfaceEditorDriver<T>
- Returns:
- a List of
EditorError
instances
-
getObject
Returnsnull
or the last value provided toedit(T)
. -
hasErrors
public boolean hasErrors()Returnsfalse
.- Specified by:
hasErrors
in interfaceEditorDriver<T>
- Returns:
true
if errors are present
-
initialize
Recordseditor
.- Specified by:
initialize
in interfaceSimpleBeanEditorDriver<T,
E extends Editor<T>> - Parameters:
editor
- the Editor to populate
-
isDirty
public boolean isDirty()Returnsfalse
.- Specified by:
isDirty
in interfaceEditorDriver<T>
- See Also:
-
setConstraintViolations
A no-op method that always returns false.- Specified by:
setConstraintViolations
in interfaceEditorDriver<T>
- Parameters:
violations
- an Iterable overConstraintViolation
instances- Returns:
true
if there were any unconsumed EditorErrors which can be retrieved fromEditorDriver.getErrors()
-