Class MockRequestFactoryEditorDriver<P,E extends Editor<P>>
- java.lang.Object
-
- com.google.web.bindery.requestfactory.gwt.client.testing.MockRequestFactoryEditorDriver<P,E>
-
- Type Parameters:
P- the Proxy type being editedE- the Editor type
- All Implemented Interfaces:
EditorDriver<RequestContext>,RequestFactoryEditorDriver<P,E>
public class MockRequestFactoryEditorDriver<P,E extends Editor<P>> extends java.lang.Object implements RequestFactoryEditorDriver<P,E>
A no-op implementation ofRequestFactoryEditorDriverthat records its inputs.
-
-
Constructor Summary
Constructors Constructor Description MockRequestFactoryEditorDriver()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaccept(EditorVisitor visitor)A no-op method.voiddisplay(P proxy)Records its arguments.voidedit(P proxy, RequestContext saveRequest)Records its arguments.RequestContextflush()Returnsnullor the last value recorded.EgetEditor()Returnsnullor the last value recorded.java.util.List<EditorError>getErrors()Returns an empty list.EventBusgetEventBus()Returnsnullor the last value recorded.java.lang.String[]getPaths()Returns a zero-length array.PgetProxy()Returnsnullor the last value recorded.RequestFactorygetRequestFactory()Returnsnullor the last value recorded.RequestContextgetSaveRequest()Returnsnullor the last value recorded.booleanhasErrors()Returnsfalse.voidinitialize(EventBus eventBus, RequestFactory requestFactory, E editor)Records its arguments.voidinitialize(RequestFactory requestFactory, E editor)Initializes a driver with the editor it will run, and a RequestFactory to use for subscription services.voidinitialize(E editor)Initializes a driver that will not be able to support subscriptions.booleanisDirty()Returnsfalse.booleansetConstraintViolations(java.lang.Iterable<ConstraintViolation<?>> violations)A no-op method that always returns false.booleansetViolations(java.lang.Iterable<Violation> errors)A no-op method that always returns false.
-
-
-
Method Detail
-
accept
public void accept(EditorVisitor visitor)
A no-op method.- Specified by:
acceptin interfaceEditorDriver<P>
-
display
public void display(P proxy)
Records its arguments.
-
edit
public void edit(P proxy, RequestContext saveRequest)
Records its arguments.- Specified by:
editin interfaceRequestFactoryEditorDriver<P,E extends Editor<P>>- Parameters:
proxy- the proxy to be editedsaveRequest- the request context that will accumulate edits and is returned formRequestFactoryEditorDriver.flush()
-
flush
public RequestContext flush()
Returnsnullor the last value recorded.- Specified by:
flushin interfaceEditorDriver<P>- Specified by:
flushin interfaceRequestFactoryEditorDriver<P,E extends Editor<P>>- Returns:
- the RequestContext passed into
RequestFactoryEditorDriver.edit(Object, RequestContext)
-
getEditor
public E getEditor()
Returnsnullor the last value recorded.
-
getErrors
public java.util.List<EditorError> getErrors()
Returns an empty list.- Specified by:
getErrorsin interfaceEditorDriver<P>- Returns:
- a List of
EditorErrorinstances
-
getEventBus
public EventBus getEventBus()
Returnsnullor the last value recorded.
-
getPaths
public java.lang.String[] getPaths()
Returns a zero-length array.
-
getProxy
public P getProxy()
Returnsnullor the last value recorded.
-
getRequestFactory
public RequestFactory getRequestFactory()
Returnsnullor the last value recorded.
-
getSaveRequest
public RequestContext getSaveRequest()
Returnsnullor the last value recorded.
-
hasErrors
public boolean hasErrors()
Returnsfalse.- Specified by:
hasErrorsin interfaceEditorDriver<P>- Returns:
trueif errors are present
-
initialize
public void initialize(E editor)
Description copied from interface:RequestFactoryEditorDriverInitializes a driver that will not be able to support subscriptions. Calls toEditorDelegate.subscribe()will do nothing.- Specified by:
initializein interfaceRequestFactoryEditorDriver<P,E extends Editor<P>>- Parameters:
editor- anEditorof type E
-
initialize
public void initialize(EventBus eventBus, RequestFactory requestFactory, E editor)
Records its arguments.- Specified by:
initializein interfaceRequestFactoryEditorDriver<P,E extends Editor<P>>- Parameters:
eventBus- theEventBusrequestFactory- aRequestFactoryinstanceeditor- anEditorof type E- See Also:
EditorDelegate.subscribe(),ResettableEventBus
-
initialize
public void initialize(RequestFactory requestFactory, E editor)
Description copied from interface:RequestFactoryEditorDriverInitializes a driver with the editor it will run, and a RequestFactory to use for subscription services.- Specified by:
initializein interfaceRequestFactoryEditorDriver<P,E extends Editor<P>>- Parameters:
requestFactory- aRequestFactoryinstanceeditor- anEditorof type E- See Also:
EditorDelegate.subscribe()
-
isDirty
public boolean isDirty()
Returnsfalse.- Specified by:
isDirtyin interfaceEditorDriver<P>- See Also:
EditorDelegate.setDirty(boolean)
-
setConstraintViolations
public boolean setConstraintViolations(java.lang.Iterable<ConstraintViolation<?>> violations)
A no-op method that always returns false.- Specified by:
setConstraintViolationsin interfaceEditorDriver<P>- Parameters:
violations- an Iterable overConstraintViolationinstances- Returns:
trueif there were any unconsumed EditorErrors which can be retrieved fromEditorDriver.getErrors()
-
setViolations
public boolean setViolations(java.lang.Iterable<Violation> errors)
A no-op method that always returns false.- Specified by:
setViolationsin interfaceRequestFactoryEditorDriver<P,E extends Editor<P>>- Parameters:
errors- an Iterable overViolationinstances- Returns:
trueif there were any unconsumed EditorErrors which can be retrieved fromEditorDriver.getErrors()
-
-