P
- the Proxy type being editedE
- the Editor typepublic class MockRequestFactoryEditorDriver<P,E extends Editor<P>> extends 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. |
List<EditorError> |
getErrors()
Returns an empty list.
|
EventBus |
getEventBus()
Returns
null or the last value recorded. |
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(Iterable<javax.validation.ConstraintViolation<?>> violations)
A no-op method that always returns false.
|
boolean |
setViolations(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 List<EditorError> getErrors()
getErrors
in interface EditorDriver<RequestContext>
EditorError
instancespublic EventBus getEventBus()
null
or the last value recorded.public 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)
RequestFactoryEditorDriver
EditorDelegate.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 EventBus
requestFactory
- a RequestFactory
instanceeditor
- an Editor
of type EEditorDelegate.subscribe()
,
ResettableEventBus
public void initialize(RequestFactory requestFactory, E editor)
RequestFactoryEditorDriver
initialize
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(Iterable<javax.validation.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(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()
Copyright © 2016. All rights reserved.