Package com.e1c.g5.v8.dt.check.settings
Interface ICheckRepository
- All Superinterfaces:
ICheckMetadataManager
- All Known Implementing Classes:
CheckRepository
Unified check repository. Provides access to all registered checks and their metadata (settings, parameters, etc)
It's a public service and may be used as a standard EDT lifecycle-aware service
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds check settings change listenervoid
applyChanges
(Collection<ICheckSettings> checkSettings, org.eclipse.core.resources.IProject project) Apply changes to the currently active settings profilevoid
deleteSettingsProfile
(String profileName, org.eclipse.core.resources.IProject project) Deletes the settings profile with the given name (if exists).void
duplicateSettingsProfile
(String profileName, String newProfileName, org.eclipse.core.resources.IProject project) Duplicates the settings profile.void
exportSettingsProfile
(String profileName, Path destinationPath, org.eclipse.core.resources.IProject project) Export check settings profile as a file to an external destinationgetActiveSettingsProfile
(org.eclipse.core.resources.IProject project) Gets an active settings profile name for the given projectgetApplicableDelegates
(Class<?> targetObjectClass, Object sourceObject, IDtProject dtProject) Gets applicable delegate checks for the given context, if anygetAvailableSettingsProfiles
(org.eclipse.core.resources.IProject project) Gets the set of available check settings profiles for the projectgetCheck
(CheckUid checkId, IDtProject dtProject) Gets the check using its UID and corresponding project settingsgetCheck
(String checkId, IDtProject project) Gets the set of checks using their public identifier.getCheckParameters
(CheckUid checkId, org.eclipse.core.resources.IProject project) Returns the immutable view of check execution parameters by names.Gets the check process preferencesgetChecks
(Predicate<ICheckDescription> filter) Deprecated.default Map<CheckUid,
ICheckDescription> Gets the map of UIDs and check descriptions of all registered checksGets the map of UIDs and check descriptions of registered checks being filtered by the provided predicategetCheckUidForCheckId
(String checkId, org.eclipse.core.resources.IProject project) Gets all applicable check unique identifiers by the check id and the given projectGets all applicable check unique identifiers per project.getChildren
(INamedElement parent, org.eclipse.core.resources.IProject project) Returns children elements of the check tree.getCustomizedSettingsFromProfile
(String profileName, org.eclipse.core.resources.IProject project) Gets the user-changed settings of the given profile.getDefaultSettings
(CheckUid checkUid, org.eclipse.core.resources.IProject project) Get default settings for the given check (as defined in the check itself)getDefaultSettingsForProfile
(String value, org.eclipse.core.resources.IProject project) Get alll default settings for all registereds check (as defined in the check itself)getPath
(INamedElement element) Returns path formINamedElement
getRootElements
(org.eclipse.core.resources.IProject project) Returns top level elements.getSettings
(CheckUid checkUid, org.eclipse.core.resources.IProject project) Returns check settings using for given project, taking the current active provide user-changed settings into the accountgetShortUid
(CheckUid checkUid) Gets the short UID for the givenCheckUid
per project.getShortUid
(CheckUid checkUid, IDtProject dtProject) Gets the short UID for the givenCheckUid
and the projectgetShortUid
(CheckUid checkUid, org.eclipse.core.resources.IProject project) Gets the short UID for the givenCheckUid
and the projectgetUidForShortUid
(String shortUid, IDtProject project) Converts short check UID into the full check UID for the given project based on the previously registered checksgetUidForShortUid
(String shortUid, org.eclipse.core.resources.IProject project) Converts short check UID into the full check UID for the given project based on the previously registered checksvoid
importSettingsProfile
(Path path, org.eclipse.core.resources.IProject project) Imports an external settings profile into the project's set of profilesboolean
isMassiveCheckProcessDisabled
(org.eclipse.core.resources.IProject project) Checks if the massive automatic check pre-computation process is disableddefault void
registerChecks
(ICheckProvider checkProvider) Registers newICheck
s provided byICheckProvider
.void
Removes check settings change listener.void
renameSettingsProfile
(String currentProfileName, String newProfileName, org.eclipse.core.resources.IProject project) Renames the settings profile using the provided name.void
setActiveSettingsProfile
(String profileName, Collection<ICheckSettings> checkSettings, org.eclipse.core.resources.IProject project) Sets an active profile for the given project.void
setCheckProvider
(ICheckProvider checkProvider) Sets the external check provider Used by the testing ifrastructure, shouln't be used by clientsvoid
setMassiveCheckProcessDisabled
(boolean massiveCheckProcessDisabled, org.eclipse.core.resources.IProject project) Sets/resets massive check modeTranslates check-provided identifier into the internal unique identifier of check.default void
unregisterChecks
(ICheckProvider checkProvider) UnregistersICheck
s provided byICheckProvider
.validateParameterValue
(String value, String parameterName, ICheckSettings checkSettings) Validates the given value for the appliance to the chosen parameter.boolean
validateProfileName
(String newProfileName) Validates that the profile name matches the standardMethods inherited from interface com.e1c.g5.v8.dt.internal.check.ICheckMetadataManager
getApplicableEClasses, getCheckComplexities, getCheckContextDefinitions, getDescription, getLanguageChecks, getLanguageCheckTargetEClasses, getLanguageResourceChangesContextCollectors, getModelRebuildDefinitions
-
Field Details
-
SERVICE_NAME
- See Also:
-
-
Method Details
-
addChangeListener
Adds check settings change listener- Parameters:
listener
- The listener to add, notnull
-
applyChanges
void applyChanges(Collection<ICheckSettings> checkSettings, org.eclipse.core.resources.IProject project) Apply changes to the currently active settings profile- Parameters:
checkSettings
- The set of changed settings to apply. May not benull
project
- The target project for the profile settings update. May not benull
-
deleteSettingsProfile
Deletes the settings profile with the given name (if exists). In case of active profile removal - select the firts available profile as active one. The last profile may be removed as well. In this case the default one will be recreated- Parameters:
profileName
- The name of the profile to remove. May not benull
project
- The target projet for the profile removal. May not benull
-
duplicateSettingsProfile
void duplicateSettingsProfile(String profileName, String newProfileName, org.eclipse.core.resources.IProject project) Duplicates the settings profile. Creates a new profile with same settings as provided with a given name- Parameters:
profileName
- The source profile name to duplicate. May not benull
newProfileName
- The name for the a new profile. May not benull
project
- The target projet for the profile duplcication. May not benull
-
exportSettingsProfile
void exportSettingsProfile(String profileName, Path destinationPath, org.eclipse.core.resources.IProject project) Export check settings profile as a file to an external destination- Parameters:
profileName
- The name of the profile to export. May not benull
destinationPath
- The destination path to export file to. May not benull
project
- The project which profile should be exported. May not benull
-
getActiveSettingsProfile
Gets an active settings profile name for the given project- Parameters:
project
- The project to get the settings profile name for. May not benull
- Returns:
- The name of the profile. Never
null
-
getApplicableDelegates
Collection<CheckUid> getApplicableDelegates(Class<?> targetObjectClass, Object sourceObject, IDtProject dtProject) Gets applicable delegate checks for the given context, if any- Parameters:
targetObjectClass
- The target objectClass
to get delegates for. May not benull
sourceObject
- Source object which check was delegated in a form of some derived delegated model. Used to filter out all inapproprite data sources. May not benull
dtProject
- The target project. May not benull
- Returns:
- The set of applicables checks. May not be
null
-
getAvailableSettingsProfiles
Gets the set of available check settings profiles for the project- Parameters:
project
- The project to get settings profiles for. May not benull
- Returns:
- The collection of available profile names. May not be
null
-
getChecks
Deprecated.Gets UIDs of registered checks being filtered by the provided predicate- Parameters:
filter
- The filter based onICheckDescription
data. May not benull
. Checks that match the predicate are being returned- Returns:
- The collection of matching check uids. May not be
null
. May be empty
-
getChecksWithDescriptions
Gets the map of UIDs and check descriptions of registered checks being filtered by the provided predicate- Parameters:
filter
- The filter based onICheckDescription
data. Can benull
. Checks that match the predicate are being returned- Returns:
- The collection of matching check uids and check descriptions. May not be
null
. May be empty
-
getChecksWithDescriptions
Gets the map of UIDs and check descriptions of all registered checks- Returns:
- The collection of matching check uids and check descriptions. May not be
null
. May be empty
-
getCheck
Gets the check using its UID and corresponding project settings- Parameters:
checkId
- The check UID to get the check by. May not benull
dtProject
- The target project. May not benull
- Returns:
- The target check if exists. May not be
null
-
getCheck
Gets the set of checks using their public identifier. In case if there is no conflicts in check ids the only check will be returned- Parameters:
checkId
- The identifier of the check. May not benull
- Returns:
- The checks mapped to their internal unique identifier, if exists. May not be
null
- Throws:
IllegalStateException
- In case if the required check isn't registered in the repository
-
getCheckParameters
Returns the immutable view of check execution parameters by names.- Parameters:
project
- The target project. May not benull
checkId
- check id, notnull
- Returns:
- check execution parameters by names, not
null
.
-
getCheckProcessPreferences
ICheckProcessPreferences getCheckProcessPreferences()Gets the check process preferences- Returns:
- The set of user-defined preferences that affects the check process. May not be
null
-
getCheckUidForCheckId
Gets all applicable check unique identifiers by the check id and the given project- Parameters:
checkId
- The identifier of the check. May not benull
project
- The target project. May not benull
- Returns:
- The set of check UIDs. May not be
null
-
getCheckUids
Map<IDtProject,Set<CheckUid>> getCheckUids()Gets all applicable check unique identifiers per project.- Returns:
- a per project map of all applicable check unique identifiers. Never
null
.
-
getChildren
Collection<INamedElement> getChildren(INamedElement parent, org.eclipse.core.resources.IProject project) Returns children elements of the check tree. The element may be eitherICheckDescription
orICheckCategory
- Parameters:
parent
- Parent element, notnull
- Returns:
- Children elements, not
null
-
getCustomizedSettingsFromProfile
Map<CheckUid,ICheckSettings> getCustomizedSettingsFromProfile(String profileName, org.eclipse.core.resources.IProject project) Gets the user-changed settings of the given profile. All default settings are ignored- Parameters:
profileName
- The target profile name. May not benull
project
- The target project. May not benull
- Returns:
- The user-changed settings mapped to respective check identifiers. May not be
null
-
getDefaultSettings
Get default settings for the given check (as defined in the check itself)- Parameters:
checkUid
- The identifier of the target check. May not benull
project
- The target project. May not benull
- Returns:
- The default settings of the check. May be
null
in case if the check is absent
-
getDefaultSettingsForProfile
Map<CheckUid,ICheckSettings> getDefaultSettingsForProfile(String value, org.eclipse.core.resources.IProject project) Get alll default settings for all registereds check (as defined in the check itself)- Parameters:
project
- The target project. May not benull
- Returns:
- The default settings of checks mapped to their check identifiers. May not be
null
-
getPath
Returns path formINamedElement
- Parameters:
element
- element, notnull
- Returns:
- list of parents, not
null
-
getRootElements
Returns top level elements.- Returns:
- top level elements, not
null
-
getSettings
Returns check settings using for given project, taking the current active provide user-changed settings into the account- Parameters:
checkUid
- check id, notnull
project
- project,null
if none- Returns:
- check settings, not
null
- Throws:
NoSuchElementException
- if none.
-
getShortUid
Gets the short UID for the givenCheckUid
and the project- Parameters:
checkUid
- The target check UID. May not benull
dtProject
- The target project. May not benull
- Returns:
- The short UID of the check. May not be
null
- Throws:
IllegalStateException
- In case if the given CheckUID isn't registered
-
getShortUid
Gets the short UID for the givenCheckUid
and the project- Parameters:
checkUid
- The target check UID. May not benull
project
- The target project. May not benull
- Returns:
- The short UID of the check. May be
null
if the given CheckUID isn't registered
-
getShortUid
Gets the short UID for the givenCheckUid
per project.- Parameters:
checkUid
- The target check UID. May not benull
.- Returns:
- The per-project map of short UIDs of the check. Never
null
. Only projects with thisCheckUid
registered are included.
-
getUidForShortUid
Converts short check UID into the full check UID for the given project based on the previously registered checks- Parameters:
shortUid
- The short UID to convert. May not benull
project
- The target project. May not benull
- Returns:
- The full UID of the check. May be
null
in case if the short UID is a stale one or non-uid
-
getUidForShortUid
Converts short check UID into the full check UID for the given project based on the previously registered checks- Parameters:
shortUid
- The short UID to convert. May not benull
project
- The target DT project. May not benull
- Returns:
- The full UID of the check. May be
null
in case if the short UID is a stale one or non-uid
-
importSettingsProfile
Imports an external settings profile into the project's set of profiles- Parameters:
path
- The path to the profile. May not benull
project
- The target project. May not benull
-
removeChangeListener
Removes check settings change listener.- Parameters:
listener
- the listener, notnull
-
renameSettingsProfile
void renameSettingsProfile(String currentProfileName, String newProfileName, org.eclipse.core.resources.IProject project) Renames the settings profile using the provided name.- Parameters:
currentProfileName
- Current name of the profile. May not benull
newName
- The new name of the profile. May not benull
project
- The target project. May not benull
-
setActiveSettingsProfile
void setActiveSettingsProfile(String profileName, Collection<ICheckSettings> checkSettings, org.eclipse.core.resources.IProject project) Sets an active profile for the given project. The name should be received via thegetAvailableSettingsProfiles(IProject)
. Does nothing in case of supplying of arbitrary name- Parameters:
profileName
- The name of the profile. May not benull
project
- The target project. May not benull
-
isMassiveCheckProcessDisabled
boolean isMassiveCheckProcessDisabled(org.eclipse.core.resources.IProject project) Checks if the massive automatic check pre-computation process is disabled- Parameters:
project
- A target project. Cannot benull
- Returns:
- True if the process is disabled
-
setMassiveCheckProcessDisabled
void setMassiveCheckProcessDisabled(boolean massiveCheckProcessDisabled, org.eclipse.core.resources.IProject project) Sets/resets massive check mode- Parameters:
massiveCheckProcessDisabled
- The mode to setproject
- A target project. Cannot benull
-
setCheckProvider
Sets the external check provider Used by the testing ifrastructure, shouln't be used by clients- Parameters:
checkProvider
- The check provider to set. May not benull
-
toUid
Translates check-provided identifier into the internal unique identifier of check. Could return more then one identifier in case of the check id conflict.- Parameters:
checkId
- The check identifier. May not benull
project
- The project to get the check UID for. May not benull
- Returns:
- The set of UIDs, may not be
null
-
validateParameterValue
Validates the given value for the appliance to the chosen parameter.- Parameters:
value
- The value to validate. May benull
parameterName
- The parameter name. May not benull
checkSettings
- The target check settings. May not benull
- Returns:
- The validation message if any.
null
if the parameter value is a valid one
-
validateProfileName
Validates that the profile name matches the standard- Parameters:
newProfileName
- The name to validate. May not benull
- Returns:
- True if the profile name is valid
-
registerChecks
Registers newICheck
s provided byICheckProvider
.- Parameters:
checkProvider
-ICheckProvider
for gettingICheck
s for adding toICheckRepository
, cannot benull
-
unregisterChecks
UnregistersICheck
s provided byICheckProvider
.- Parameters:
checkProvider
-ICheckProvider
for gettingICheck
s for deleting fromICheckRepository
, cannot benull
-
getChecksWithDescriptions(java.util.function.Predicate<com.e1c.g5.v8.dt.check.settings.ICheckDescription>)
instead