Class BasicCheck

    • Constructor Detail

      • BasicCheck

        public BasicCheck()
        Constructs an instance of the check
    • Method Detail

      • check

        public final void check​(Object object,
                                ICheckResultAcceptor resultRegistrar,
                                ICheckParameters parameters,
                                org.eclipse.core.runtime.IProgressMonitor progressMonitor)
        Description copied from interface: ICheck
        All checked objects must be registered in resultAcceptor. Each checked object should be in the result, regardless of whether there are any issues in it. Adding objects that do not have errors in result is necessary to clear issues that were not previously defined in the object. Validation may be cancelled by user. Complex implemantation should take this into account and checks IProgressMonitor.isCanceled() between long time operations.
        Specified by:
        check in interface ICheck
        Parameters:
        object - the checking object, not null
        resultRegistrar - the result acceptor, not null
        parameters - check execution parameters from settings, not null
        progressMonitor - progress monitor, not null
      • configureContextCollector

        public final void configureContextCollector​(ICheckDefinition definition)
        Description copied from interface: ICheck
        The first phase of the check performing is the check context prepartion. The check should react to the system events and mark situations when the check launch is required. The CheckDefinition defines the logic of check context collection, see it for more details
        Specified by:
        configureContextCollector in interface ICheck
      • isCheckApplicable

        public boolean isCheckApplicable​(IBmObject topObject,
                                         ICheckParameters parameters)
        Description copied from interface: ITopObjectFilter
        Checks if the given top object is a potential target of the current check. This method is being called by the check engine during the validation cycle, effectively preventing the check from execution in case of false decision
        Specified by:
        isCheckApplicable in interface ITopObjectFilter
        Parameters:
        topObject - The top object to check. May not be null
        parameters - The set of the check parameter. May not be null
        Returns:
        True if the top object is potential target for the check. False overwise.
      • check

        protected abstract void check​(Object object,
                                      BasicCheck.ResultAcceptor resultAcceptor,
                                      ICheckParameters parameters,
                                      org.eclipse.core.runtime.IProgressMonitor progressMonitor)
        The method that performs the check. Check results (issues) need to be placed into the result acceptor. Validation may be cancelled by a user. Complex implemantations should take this into the account and check IProgressMonitor.isCanceled() periodically during long-running operations.
        Parameters:
        object - The object to check, not null
        resultAcceptor - Result acceptor, not null
        parameters - The set of check execution parameters taken from check settings, not null
        progressMonitor - Current check progress monitor, not null
      • configureCheck

        protected abstract void configureCheck​(BasicCheck.CheckConfigurer configurationBuilder)
        The check is performed in case of changes of the tracjed object model/language module changes. In order to define the rules of the check performing, the developer should define the set of EClass'es and their features those changes are being tracked/or be targets of the validation
        Parameters:
        checkConfigurer - The check configuration builder. May not be null