Interface ModelAccessProvider
-
- All Known Subinterfaces:
ConnectorInputTypeTranslator<T,S>,ConnectorOutputTypeTranslator<S,T>
- All Known Implementing Classes:
AbstractConnectorInputTypeTranslator,AbstractConnectorOutputTypeTranslator,ChanneledConnectorOutputTypeAdapter,ConnectorInputTypeAdapter,ConnectorOutputTypeAdapter
public interface ModelAccessProviderRefines theTypeTranslatorfor the use with machine connectors.- Author:
- Holger Eichelberger, SSE
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfaceModelAccessProvider.IOModelAccessFunctionA simple (optional) function that may throw anIOException.static interfaceModelAccessProvider.IOVoidFunctionA simple (optional) function that may throw anIOException.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description ModelAccessgetModelAccess()Returns the model access instance to be used during type translations.static booleanoptional(ModelAccess modelAccess, ModelAccessProvider.IOVoidFunction func)Executesfuncbut consumesIOExceptionas execution is considered optional.static ModelAccessoptionalStep(ModelAccess modelAccess, ModelAccessProvider.IOModelAccessFunction func)Executesfuncbut consumesIOExceptionas execution is considered optional.voidsetModelAccess(ModelAccess modelAccess)Defines the model access.
-
-
-
Method Detail
-
getModelAccess
ModelAccess getModelAccess()
Returns the model access instance to be used during type translations.- Returns:
- the model access instance, may be null (see
MachineConnector.hasModel())
-
setModelAccess
void setModelAccess(ModelAccess modelAccess)
Defines the model access. Handle with care, shall be called (indirectly) by the connector only.- Parameters:
modelAccess- the model access
-
optional
static boolean optional(ModelAccess modelAccess, ModelAccessProvider.IOVoidFunction func)
Executesfuncbut consumesIOExceptionas execution is considered optional.- Parameters:
modelAccess- the model access to be passed intofuncfunc- the function to execute- Returns:
truefor success without exception,falsefor failed with caught exception
-
optionalStep
static ModelAccess optionalStep(ModelAccess modelAccess, ModelAccessProvider.IOModelAccessFunction func)
Executesfuncbut consumesIOExceptionas execution is considered optional.- Parameters:
modelAccess- the model access to be passed intofuncfunc- the function to execute- Returns:
modelAccessor some nested model access function to continue with
-
-