P - the Proxy type being editedE - the Editor typepublic class MockRequestFactoryEditorDriver<P,E extends Editor<P>> extends java.lang.Object implements RequestFactoryEditorDriver<P,E>
RequestFactoryEditorDriver that records its
inputs.| Constructor and Description |
|---|
MockRequestFactoryEditorDriver() |
| Modifier and Type | Method and Description |
|---|---|
void |
accept(EditorVisitor visitor)
A no-op method.
|
void |
display(P proxy)
Records its arguments.
|
void |
edit(P proxy,
RequestContext saveRequest)
Records its arguments.
|
RequestContext |
flush()
Returns
null or the last value recorded. |
E |
getEditor()
Returns
null or the last value recorded. |
java.util.List<EditorError> |
getErrors()
Returns an empty list.
|
EventBus |
getEventBus()
Returns
null or the last value recorded. |
java.lang.String[] |
getPaths()
Returns a zero-length array.
|
P |
getProxy()
Returns
null or the last value recorded. |
RequestFactory |
getRequestFactory()
Returns
null or the last value recorded. |
RequestContext |
getSaveRequest()
Returns
null or the last value recorded. |
boolean |
hasErrors()
Returns
false. |
void |
initialize(E editor)
Initializes a driver that will not be able to support subscriptions.
|
void |
initialize(EventBus eventBus,
RequestFactory requestFactory,
E editor)
Records its arguments.
|
void |
initialize(RequestFactory requestFactory,
E editor)
Initializes a driver with the editor it will run, and a RequestFactory to
use for subscription services.
|
boolean |
isDirty()
Returns
false. |
boolean |
setConstraintViolations(java.lang.Iterable<ConstraintViolation<?>> violations)
A no-op method that always returns false.
|
boolean |
setViolations(java.lang.Iterable<Violation> errors)
A no-op method that always returns false.
|
public void accept(EditorVisitor visitor)
accept in interface EditorDriver<RequestContext>public void display(P proxy)
public void edit(P proxy, RequestContext saveRequest)
edit in interface RequestFactoryEditorDriver<P,E extends Editor<P>>proxy - the proxy to be editedsaveRequest - the request context that will accumulate edits and is
returned form RequestFactoryEditorDriver.flush()public RequestContext flush()
null or the last value recorded.flush in interface EditorDriver<RequestContext>flush in interface RequestFactoryEditorDriver<P,E extends Editor<P>>RequestFactoryEditorDriver.edit(Object, RequestContext)public E getEditor()
null or the last value recorded.public java.util.List<EditorError> getErrors()
getErrors in interface EditorDriver<RequestContext>EditorError instancespublic EventBus getEventBus()
null or the last value recorded.public java.lang.String[] getPaths()
public P getProxy()
null or the last value recorded.public RequestFactory getRequestFactory()
null or the last value recorded.public RequestContext getSaveRequest()
null or the last value recorded.public boolean hasErrors()
false.hasErrors in interface EditorDriver<RequestContext>true if errors are presentpublic void initialize(E editor)
RequestFactoryEditorDriverEditorDelegate.subscribe() will do
nothing.initialize in interface RequestFactoryEditorDriver<P,E extends Editor<P>>editor - an Editor of type Epublic void initialize(EventBus eventBus, RequestFactory requestFactory, E editor)
initialize in interface RequestFactoryEditorDriver<P,E extends Editor<P>>eventBus - the EventBusrequestFactory - a RequestFactory instanceeditor - an Editor of type EEditorDelegate.subscribe(),
ResettableEventBuspublic void initialize(RequestFactory requestFactory, E editor)
RequestFactoryEditorDriverinitialize in interface RequestFactoryEditorDriver<P,E extends Editor<P>>requestFactory - a RequestFactory instanceeditor - an Editor of type EEditorDelegate.subscribe()public boolean isDirty()
false.isDirty in interface EditorDriver<RequestContext>EditorDelegate.setDirty(boolean)public boolean setConstraintViolations(java.lang.Iterable<ConstraintViolation<?>> violations)
setConstraintViolations in interface EditorDriver<RequestContext>violations - an Iterable over ConstraintViolation instancestrue if there were any unconsumed EditorErrors which
can be retrieved from EditorDriver.getErrors()public boolean setViolations(java.lang.Iterable<Violation> errors)
setViolations in interface RequestFactoryEditorDriver<P,E extends Editor<P>>errors - an Iterable over
Violation
instancestrue if there were any unconsumed EditorErrors which
can be retrieved from EditorDriver.getErrors()