The script modelling environment is responsible for discovering the script file subjects for modelling, and serving as a common container for build script models.
The currently discovered script file paths can be retrieved by calling getTrackedScriptPaths(). The discovery mechanism is implementation dependent for the build scripts. (E.g. it can be implemented by file system watchers, or can require manual handling)
The behaviour for creating models by the environment is implementation dependent. It can use lazy or eager instantiation as it sees fit.
The configuration of the modelling environment can change during its lifetime, and clients should handle that gracefully according to the recommended behaviour suggested by getConfiguration().
public void | close() Closes this modelling environment. |
public ScriptModellingEnvironmentConfiguration | Gets the configuration for this modelling environment. |
public ScriptSyntaxModel | Gets a script model for the file at the given path. |
public NavigableSet< | Gets a snapshot of tracked script paths by this environment. |
Closing will release all resources of this modelling environment. Further calls to this environment are to return
empty collections and null
when appropriate.
Subsequent calls to this method are no-op. I.e. this method is idempotent.
The configuration can change during the lifetime of the modelling environment without any notification to the callers. Clients should not retain reference to the returned configuration instance, but query it every time from the modelling environment if access to related data is required.
This method doesn't always return non-null
, some possible scenarios are the following:
- No script configuration was defined for the file at the given path.
- The path is configured to be excluded.
- The environment failed to load the scripting language for the file.
- The path is not a valid path for the current path configuration.
null
if the file doesn't exist, but the
creation of the model might fail due to the file not being
found.null
if not applicable.The returned collection is a snapshot, after calling this method the environment might have discovered new script files.