Package org.sonar.api.server.rule
Class RuleDescriptionSectionBuilder
- java.lang.Object
-
- org.sonar.api.server.rule.RuleDescriptionSectionBuilder
-
public final class RuleDescriptionSectionBuilder extends java.lang.ObjectThis 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 RuleDescriptionSectionbuild()RuleDescriptionSectionBuildercontext(Context context)For context specific descriptions, the context key, must be unique across a given section of a rule.RuleDescriptionSectionBuilderhtmlClasspathResourceUrl(java.net.URL htmlClasspathResourceUrl)The classpath URL of the resource containing the rule section content in HTML format.RuleDescriptionSectionBuilderhtmlContent(java.lang.String htmlContent)The content, in HTML formatRuleDescriptionSectionBuildersectionKey(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()
-
-