Package org.sonar.api.server.rule
Class RuleDescriptionSectionBuilder
- java.lang.Object
-
- org.sonar.api.server.rule.RuleDescriptionSectionBuilder
-
public final class RuleDescriptionSectionBuilder extends java.lang.Object
This builder allows to build the right implementation ofRuleDescriptionSection
, depending on the provided arguments- Since:
- 9.6
-
-
Constructor Summary
Constructors Constructor Description RuleDescriptionSectionBuilder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description RuleDescriptionSection
build()
RuleDescriptionSectionBuilder
context(Context context)
For context specific descriptions, the context key, must be unique across a given section of a rule.RuleDescriptionSectionBuilder
htmlClasspathResourceUrl(java.net.URL htmlClasspathResourceUrl)
The classpath URL of the resource containing the rule section content in HTML format.RuleDescriptionSectionBuilder
htmlContent(java.lang.String htmlContent)
The content, in HTML formatRuleDescriptionSectionBuilder
sectionKey(java.lang.String sectionKey)
Identifier of the section, must be unique across sections of a given rule Section keys must follow the format defined inStringPatternValidator.COMMON_PATTERN_FOR_KEYS
-
-
-
Method Detail
-
sectionKey
public RuleDescriptionSectionBuilder sectionKey(java.lang.String sectionKey)
Identifier of the section, must be unique across sections of a given rule Section keys must follow the format defined inStringPatternValidator.COMMON_PATTERN_FOR_KEYS
-
htmlContent
public RuleDescriptionSectionBuilder htmlContent(java.lang.String htmlContent)
The content, in HTML format
-
htmlClasspathResourceUrl
public RuleDescriptionSectionBuilder htmlClasspathResourceUrl(java.net.URL htmlClasspathResourceUrl)
The classpath URL of the resource containing the rule section content in HTML format. Example :htmlClasspathResourceUrl(getClass().getResource("/myrepo/Rule1234_section_intro.html")
-
context
public RuleDescriptionSectionBuilder context(@Nullable Context context)
For context specific descriptions, the context key, must be unique across a given section of a rule.- Since:
- 9.7
-
build
public RuleDescriptionSection build()
-
-