Package org.eclipse.scanning.api
Interface IValidator<T>
- All Known Subinterfaces:
IMalcolmDevice,IPausableDevice<T>,IRunnableDevice<T>,IRunnableEventDevice<T>,IScanDevice,IWritableDetector<T>
- All Known Implementing Classes:
AbstractAreaDetectorRunnableDevice,AbstractMalcolmDevice,AbstractMapModelValidator,AbstractRunnableDevice,AreaDetectorRunnableDevice,AreaDetectorRunnableDeviceProxy,AreaDetectorRunnableDeviceWaitForArray,AreaDetectorWritingFilesRunnableDevice,ConstantVelocityDevice,DarkImageDetector,DummyMalcolmDevice,DummyMalcolmTriggeredDetector,ElectronAnalyserRunnableDevice,MalcolmDevice,MalcolmDeviceProxy,MandelbrotDetector,PosDetector,ProcessingMalcolmDevice,RandomIntDetector,RandomLineDevice,RunnableDeviceProxy,XmapRunnableDevice,XmapRunnableDeviceBase,XmapWritingFilesRunnableDevice,ZebraRunnableDevice
public interface IValidator<T>
This is supposed to fit any object which takes a model and
can notify the user if the a given model is valid or not.
For instance IRunnableDevice, IPointGenerator.
IMPORTANT: A model should not be an IValidator. Models should be
maintained as vanilla as possible.
-
Method Summary
Modifier and TypeMethodDescriptiondefault voidsetService(IValidatorService vservice) The validation server will set itself on any validator incase that validator want to validate sub-parts of a complex model.If the given model is considered "invalid", this method may either throw a ModelValidationException explaining why it is considered invalid or return a modified version of the model that does pass validation.
-
Method Details
-
setService
The validation server will set itself on any validator incase that validator want to validate sub-parts of a complex model.- Parameters:
vservice-
-
validate
If the given model is considered "invalid", this method may either throw a ModelValidationException explaining why it is considered invalid or return a modified version of the model that does pass validation. If the model is valid, it is returned. A model should be considered invalid if its parameters would cause the generator implementation to hang or crash.- Parameters:
model- - a model of type T to validate- Returns:
- a valid model
-