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 TypeMethodDescriptionvoidAdds check settings change listenervoidapplyChanges(Collection<ICheckSettings> checkSettings, org.eclipse.core.resources.IProject project) Apply changes to the currently active settings profilevoiddeleteSettingsProfile(String profileName, org.eclipse.core.resources.IProject project) Deletes the settings profile with the given name (if exists).voidduplicateSettingsProfile(String profileName, String newProfileName, org.eclipse.core.resources.IProject project) Duplicates the settings profile.voidexportSettingsProfile(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 formINamedElementgetRootElements(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 givenCheckUidper project.getShortUid(CheckUid checkUid, IDtProject dtProject) Gets the short UID for the givenCheckUidand the projectgetShortUid(CheckUid checkUid, org.eclipse.core.resources.IProject project) Gets the short UID for the givenCheckUidand 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 checksvoidimportSettingsProfile(Path path, org.eclipse.core.resources.IProject project) Imports an external settings profile into the project's set of profilesbooleanisMassiveCheckProcessDisabled(org.eclipse.core.resources.IProject project) Checks if the massive automatic check pre-computation process is disableddefault voidregisterChecks(ICheckProvider checkProvider) Registers newIChecks provided byICheckProvider.voidRemoves check settings change listener.voidrenameSettingsProfile(String currentProfileName, String newProfileName, org.eclipse.core.resources.IProject project) Renames the settings profile using the provided name.voidsetActiveSettingsProfile(String profileName, Collection<ICheckSettings> checkSettings, org.eclipse.core.resources.IProject project) Sets an active profile for the given project.voidsetCheckProvider(ICheckProvider checkProvider) Sets the external check provider Used by the testing ifrastructure, shouln't be used by clientsvoidsetMassiveCheckProcessDisabled(boolean massiveCheckProcessDisabled, org.eclipse.core.resources.IProject project) Sets/resets massive check modeTranslates check-provided identifier into the internal unique identifier of check.default voidunregisterChecks(ICheckProvider checkProvider) UnregistersIChecks provided byICheckProvider.validateParameterValue(String value, String parameterName, ICheckSettings checkSettings) Validates the given value for the appliance to the chosen parameter.booleanvalidateProfileName(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 benullproject- 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 benullproject- 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 benullnewProfileName- The name for the a new profile. May not benullproject- 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 benulldestinationPath- The destination path to export file to. May not benullproject- 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 objectClassto get delegates for. May not benullsourceObject- Source object which check was delegated in a form of some derived delegated model. Used to filter out all inapproprite data sources. May not benulldtProject- 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 onICheckDescriptiondata. 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 onICheckDescriptiondata. 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 benulldtProject- 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 benullcheckId- 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 benullproject- 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 eitherICheckDescriptionorICheckCategory- 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 benullproject- 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 benullproject- The target project. May not benull- Returns:
- The default settings of the check. May be
nullin 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, notnullproject- project,nullif none- Returns:
- check settings, not
null - Throws:
NoSuchElementException- if none.
-
getShortUid
Gets the short UID for the givenCheckUidand the project- Parameters:
checkUid- The target check UID. May not benulldtProject- 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 givenCheckUidand the project- Parameters:
checkUid- The target check UID. May not benullproject- The target project. May not benull- Returns:
- The short UID of the check. May be
nullif the given CheckUID isn't registered
-
getShortUid
Gets the short UID for the givenCheckUidper 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 thisCheckUidregistered 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 benullproject- The target project. May not benull- Returns:
- The full UID of the check. May be
nullin 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 benullproject- The target DT project. May not benull- Returns:
- The full UID of the check. May be
nullin 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 benullproject- 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 benullnewName- The new name of the profile. May not benullproject- 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 benullproject- 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 benullproject- 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 benullparameterName- The parameter name. May not benullcheckSettings- The target check settings. May not benull- Returns:
- The validation message if any.
nullif 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 newIChecks provided byICheckProvider.- Parameters:
checkProvider-ICheckProviderfor gettingIChecks for adding toICheckRepository, cannot benull
-
unregisterChecks
UnregistersIChecks provided byICheckProvider.- Parameters:
checkProvider-ICheckProviderfor gettingIChecks for deleting fromICheckRepository, cannot benull
-
getChecksWithDescriptions(java.util.function.Predicate<com.e1c.g5.v8.dt.check.settings.ICheckDescription>)instead