Class BasicCheck.CheckParameterBuilder
- java.lang.Object
-
- com.e1c.g5.v8.dt.check.components.BasicCheck.CheckParameterBuilder
-
- Enclosing class:
- BasicCheck
public static final class BasicCheck.CheckParameterBuilder extends Object
Check parameter builder. Defines the context of the check parameters definition. See documentation of methods for the usage instructions. This builder is not intended for the direct creation by check developers
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BasicCheck.CheckConfigurer
complexity(CheckComplexity complexity)
Defines the complexity of the check.BasicCheck.CheckParameterBuilder
description(String description)
Sets the simple description for the check.BasicCheck.CheckParameterBuilder
issueType(IssueType issueType)
Defines the type of issues provided by this checkBasicCheck.ModuleConfigurationBuilder
module()
Declares the participation of the check into the language module check process.BasicCheck.CheckParameterBuilder
parameter(String name, Class<?> type, String defaultValue, String title)
Defines a parameter of the check.BasicCheck.CheckConfigurer
severity(IssueSeverity severity)
Defines the default severity of issues provided by this checkBasicCheck.CheckConfigurer
title(String title)
Defines the check title.BasicCheck.TopObjectConfigurationBuilder
topObject(org.eclipse.emf.ecore.EClass topObjectEClass)
Defines the check running rule on change of model top object data.
-
-
-
Method Detail
-
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 benull
- Returns:
- The
BasicCheck.CheckConfigurer
for configuration chaining. May not benull
-
description
public BasicCheck.CheckParameterBuilder 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 theICheck
description for details and typically is used as a fallback for non-supported languages- Parameters:
description
- The description to set. May not benull
- Returns:
- The
BasicCheck.CheckConfigurer
for configuration chaining. May not benull
-
issueType
public BasicCheck.CheckParameterBuilder issueType(IssueType issueType)
Defines the type of issues provided by this check- Parameters:
issueType
- The type to set. May not benull
- Returns:
- The
BasicCheck.CheckConfigurer
for configuration chaining. May not benull
-
module
public BasicCheck.ModuleConfigurationBuilder module()
Declares the participation of the check into the language module check process. Use the returned builder to configure details of the check pariticipation. SeeBasicCheck.ModuleConfigurationBuilder
for details- Returns:
- The
BasicCheck.ModuleConfigurationBuilder
for the further configuration. Nevernull
-
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 theICheckParameters
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 benull
. 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 definitiontype
- The type of the parameter. May not benull
. 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 benull
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 benull
or empty- Returns:
- The
BasicCheck.CheckParameterBuilder
for configuration chaining. May not benull
-
severity
public BasicCheck.CheckConfigurer severity(IssueSeverity severity)
Defines the default severity of issues provided by this check- Parameters:
severity
- The severity to set. May not benull
- Returns:
- The
BasicCheck.CheckConfigurer
for configuration chaining. May not benull
-
title
public BasicCheck.CheckConfigurer title(String title)
Defines the check title. The title is being displayed in the check tree for easier navigation- Parameters:
title
- The title to set. May not benull
- Returns:
- The
BasicCheck.CheckConfigurer
for configuration chaining. May not benull
-
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 correspondingEClass
.
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
- TheEClass
of the target top object. May not benull
- Returns:
BasicCheck.TopObjectConfigurationBuilder
bound to the context of the selectedEClass
and ready for further configuration. May not benull
-
-