Class BasicCheck.TopObjectConfigurationBuilder

  • Enclosing class:
    BasicCheck

    public static final class BasicCheck.TopObjectConfigurationBuilder
    extends Object
    Top object configuration builder. Defines the context of the model check launching rules. See documentation of methods for the usage instructions. This builder is not intended for the direct creation by check developers
    • Method Detail

      • checkTop

        public BasicCheck.TopObjectConfigurationBuilder checkTop()
        As the check allows to validate several objects by the same check, it's possible to state that both defined containments and top object should be a target of the validation. Otherwise only defined containments will be targets of the check performing

        Example: check Catalog object as well as CatalogAttribute's:
        ...
          builder.topObject(CATALOG).
            checkTop().
            containment(CATALOG__ATTRIBUTES).
        ...
        Returns:
        The BasicCheck.TopObjectConfigurationBuilder for configuration chaining. May not be null
      • complexity

        public BasicCheck.CheckConfigurer complexity​(CheckComplexity complexity)
        Defines the complexity of the check. The check subsystem takes this setting into the account while planning the check process to achieve maximum operativeness of checks
        Parameters:
        complexity - The complexity to set. May not be null
        Returns:
        The BasicCheck.TopObjectConfigurationBuilder for configuration chaining. May not be null
      • containment

        public BasicCheck.ContainmentConfigurationBuilder containment​(org.eclipse.emf.ecore.EClass containmentEClass)
        Defines the feature path to the containment object of a current top object to track. The feature path is a sequence of model features (single and many features) which leads to the target containment object from the top object.

        Example: track the tabular section attribute of the Catalog:
        ...
          builder.topObject(CATALOG).
            containment(CATALOG__TABULAR_SECTIONS, DB_OBJECT_TABULAR_SECTION__ATTRIBUTES).
        ...
        Parameters:
        containmentFeaturePath - The feature path. May not be null or empty
        Returns:
        The BasicCheck.ContainmentConfigurationBuilder for configuration chaining. May not be null
      • description

        public BasicCheck.TopObjectConfigurationBuilder description​(String description)
        Sets the simple description for the check. This description may be overriden by the external description definition for the check (if defined), see the ICheck description for details and typically is used as a fallback for non-supported languages
        Parameters:
        description - The description to set. May not be null
        Returns:
        The BasicCheck.CheckConfigurer for configuration chaining. May not be null
      • features

        public BasicCheck.TopObjectFeatureConfigurationBuilder features​(org.eclipse.emf.ecore.EStructuralFeature... observedFeatures)
        Configures the change tracking for the set of top object features. The check will be called in case if any of these features will be changed.

        Example: track changes of the Catalog name:
        ...
          builder.topObject(CATALOG).
            features(MD_OBJECT__NAME).
        ...
        Parameters:
        observedFeatures - The set of features of the corresponding top object to track changes for. May not be null or empty
        Returns:
        The BasicCheck.TopObjectFeatureConfigurationBuilder for configuration chaining. May not be null
      • parameter

        public BasicCheck.CheckParameterBuilder parameter​(String name,
                                                          Class<?> type,
                                                          String defaultValue,
                                                          String title)
        Defines a parameter of the check. The parameter will be available on the check preferences page for the editing and its value will be accessible during the check via the ICheckParameters Example: add Integer parameter to the check:
        ...
          builder.topObject(CATALOG).
            MIN_LENGTH_PARAMETER_NAME, Integer.class, "8", Messages.CatalogCodeLengthCheck_MinLengthParameter_Title).
        ...
        Parameters:
        name - The name of the parameter. May not be null. Must be unique among other parameters being defined for this check. In case if the name is not unqiue any arbitrary parameter definition may be selected as final parameter definition
        type - The type of the parameter. May not be null. The following set of the parameter types are supported:
        • Boolean - supported values are: True, False, TRUE, FALSE
        • Integer - matches requirements of the Integer.valueOf(String)
        • Long - - matches requirements of the Long.valueOf(String)
        • Double - supports dot separated format (XXXX.YYYY)
        • String - any generic string
        defaultValue - The default value (as String). May be null or empty. See the type parameter for the available values.
        title - The title of the parameter to display to the user in the check preferences page. May be null or empty
        Returns:
        The BasicCheck.CheckParameterBuilder for configuration chaining. May not be null
      • topObject

        public BasicCheck.TopObjectConfigurationBuilder topObject​(org.eclipse.emf.ecore.EClass topObjectEClass)
        Defines the check running rule on change of model top object data. The object is defined by the corresponding EClass.
        The rest of check launching configuration for this object should be done via the object being returned by this method

        Example: Start the configuration of check running rules for the Catalog object:
        ...
          builder.topObject(CATALOG).
        ... Please note, that calling of this method will effectively finish the configuration of the currently selected top object and begins the configuration of a new one. It's impossible to proceed with the configuration of the previous top object after the call of this method
        Parameters:
        topObjectEClass - The EClass of the target top object. May not be null
        Returns:
        BasicCheck.TopObjectConfigurationBuilder bound to the context of the selected EClass and ready for further configuration. May not be null