Class GroupTree
- java.lang.Object
-
- org.sonarsource.analyzer.commons.regex.ast.AbstractRegexSyntaxElement
-
- org.sonarsource.analyzer.commons.regex.ast.RegexTree
-
- org.sonarsource.analyzer.commons.regex.ast.GroupTree
-
- All Implemented Interfaces:
AutomatonState,RegexSyntaxElement
- Direct Known Subclasses:
AtomicGroupTree,CapturingGroupTree,ConditionalSubpatternTree,LookAroundTree,NonCapturingGroupTree,ReferenceConditionTree
public abstract class GroupTree extends RegexTree
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.sonarsource.analyzer.commons.regex.ast.RegexTree
RegexTree.Kind
-
Nested classes/interfaces inherited from interface org.sonarsource.analyzer.commons.regex.ast.AutomatonState
AutomatonState.TransitionType
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedGroupTree(RegexSource source, RegexTree.Kind kind, RegexTree element, IndexRange range, FlagSet activeFlags)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description RegexTreegetElement()Can only be null for non-capturing groupsRegexTokengetGroupHeader()The opening sequence of the group from the ( to the :.AutomatonState.TransitionTypeincomingTransitionType()RegexTree.Kindkind()voidsetContinuation(AutomatonState continuation)protected voidsetContinuation(AutomatonState continuation, RegexTree element)List<AutomatonState>successors()-
Methods inherited from class org.sonarsource.analyzer.commons.regex.ast.RegexTree
accept, activeFlags, continuation, is, toRegexTree
-
Methods inherited from class org.sonarsource.analyzer.commons.regex.ast.AbstractRegexSyntaxElement
getRange, getSource, getText
-
-
-
-
Field Detail
-
element
@Nullable protected final RegexTree element
Can only be null for non-capturing groups (by design). If non-null - it represents an empty group iff `element` is a SequenceTree with empty `items` list.
-
-
Constructor Detail
-
GroupTree
protected GroupTree(RegexSource source, RegexTree.Kind kind, @Nullable RegexTree element, IndexRange range, FlagSet activeFlags)
-
-
Method Detail
-
kind
public final RegexTree.Kind kind()
-
getGroupHeader
@Nullable public RegexToken getGroupHeader()
The opening sequence of the group from the ( to the :. Returns null for non-capturing groups without a colon/body.
-
getElement
@Nullable public RegexTree getElement()
Can only be null for non-capturing groups
-
successors
@Nonnull public List<AutomatonState> successors()
-
incomingTransitionType
@Nonnull public AutomatonState.TransitionType incomingTransitionType()
-
setContinuation
public void setContinuation(AutomatonState continuation)
- Overrides:
setContinuationin classRegexTree
-
setContinuation
protected void setContinuation(AutomatonState continuation, @Nullable RegexTree element)
-
-