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 java.lang.Object implements SimpleBeanEditorDriver<T,E>
A no-op implementation ofSimpleBeanEditorDriver
that records its inputs.
-
-
Constructor Summary
Constructors Constructor Description MockSimpleBeanEditorDriver()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
accept(EditorVisitor visitor)
A no-op method.void
edit(T object)
Recordsobject
.T
flush()
Returnsnull
or the last value provided toedit(T)
.E
getEditor()
Returnsnull
or the last value provided toinitialize(E)
.java.util.List<EditorError>
getErrors()
Returns an empty list.T
getObject()
Returnsnull
or the last value provided toedit(T)
.boolean
hasErrors()
Returnsfalse
.void
initialize(E editor)
Recordseditor
.boolean
isDirty()
Returnsfalse
.boolean
setConstraintViolations(java.lang.Iterable<ConstraintViolation<?>> violations)
A no-op method that always returns false.
-
-
-
Method Detail
-
accept
public void accept(EditorVisitor visitor)
A no-op method.- Specified by:
accept
in interfaceEditorDriver<T>
-
edit
public void edit(T object)
Recordsobject
.
-
flush
public T 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
public E getEditor()
Returnsnull
or the last value provided toinitialize(E)
.
-
getErrors
public java.util.List<EditorError> getErrors()
Returns an empty list.- Specified by:
getErrors
in interfaceEditorDriver<T>
- Returns:
- a List of
EditorError
instances
-
hasErrors
public boolean hasErrors()
Returnsfalse
.- Specified by:
hasErrors
in interfaceEditorDriver<T>
- Returns:
true
if errors are present
-
initialize
public void initialize(E editor)
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:
EditorDelegate.setDirty(boolean)
-
setConstraintViolations
public boolean setConstraintViolations(java.lang.Iterable<ConstraintViolation<?>> violations)
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()
-
-