Package org.sonar.iac.common.checkdsl
Class ContextualTree<S extends ContextualTree<S,T>,T extends Tree>
- java.lang.Object
-
- org.sonar.iac.common.checkdsl.ContextualTree<S,T>
-
- Direct Known Subclasses:
ContextualListTree,ContextualPropertyTree
public abstract class ContextualTree<S extends ContextualTree<S,T>,T extends Tree> extends Object
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedContextualTree(CheckContext ctx, T tree, String name, ContextualTree<? extends ContextualTree<?,?>,? extends Tree> parent)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidifPresent(Consumer<T> action)booleanisAbsent()booleanisPresent()Sreport(String message, List<SecondaryLocation> secondaries)Sreport(String message, SecondaryLocation... secondaryLocations)SreportIfAbsent(String message, List<SecondaryLocation> secondaries)SreportIfAbsent(String message, SecondaryLocation... secondaries)protected HasTextRangetoHighlight()SecondaryLocationtoSecondary(String message)
-
-
-
Field Detail
-
ctx
public final CheckContext ctx
-
name
@Nullable public final String name
-
-
Constructor Detail
-
ContextualTree
protected ContextualTree(CheckContext ctx, @Nullable T tree, @Nullable String name, @Nullable ContextualTree<? extends ContextualTree<?,?>,? extends Tree> parent)
-
-
Method Detail
-
reportIfAbsent
public S reportIfAbsent(String message, SecondaryLocation... secondaries)
-
reportIfAbsent
public S reportIfAbsent(String message, List<SecondaryLocation> secondaries)
-
report
public S report(String message, SecondaryLocation... secondaryLocations)
-
report
public S report(String message, List<SecondaryLocation> secondaries)
-
toSecondary
@CheckForNull public SecondaryLocation toSecondary(String message)
-
toHighlight
@CheckForNull protected HasTextRange toHighlight()
-
isPresent
public boolean isPresent()
-
isAbsent
public boolean isAbsent()
-
-