Class AbstractStringPattern
java.lang.Object
org.elasticsearch.xpack.esql.core.expression.predicate.regex.AbstractStringPattern
- All Implemented Interfaces:
StringPattern,NodeStringRenderable
- Direct Known Subclasses:
RLikePattern,RLikePatternList,WildcardPattern,WildcardPatternList
public abstract class AbstractStringPattern
extends Object
implements StringPattern, NodeStringRenderable
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal org.apache.lucene.util.automaton.AutomatoncreateAutomaton(boolean ignoreCase) protected abstract org.apache.lucene.util.automaton.AutomatondoCreateAutomaton(boolean ignoreCase) Returns the match if this pattern is exact, that is has no wildcard or other patterns inside.Returns the longest string that prefixes every string accepted by this pattern, using Lucene'sOperations.getCommonPrefix(org.apache.lucene.util.automaton.Automaton).Returns the longest string that suffixes every string accepted by this pattern.booleanHint method on whether this pattern matches everything or not.voidnodeString(StringBuilder sb, Node.NodeStringFormat format, NodeStringMapper mapper) Default-safe rendering: quote the whole pattern and route it through the mapper as a single identifier token.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.elasticsearch.xpack.esql.core.expression.predicate.regex.StringPattern
asJavaRegex, pattern
-
Constructor Details
-
AbstractStringPattern
public AbstractStringPattern()
-
-
Method Details
-
nodeString
Default-safe rendering: quote the whole pattern and route it through the mapper as a single identifier token. Subclasses override to preserve structure (wildcard / regex metacharacters, list shape). UnderNodeStringMapper.IDENTITYthis is the raw quoted pattern.- Specified by:
nodeStringin interfaceNodeStringRenderable
-
createAutomaton
public final org.apache.lucene.util.automaton.Automaton createAutomaton(boolean ignoreCase) -
doCreateAutomaton
protected abstract org.apache.lucene.util.automaton.Automaton doCreateAutomaton(boolean ignoreCase) -
matchesAll
public boolean matchesAll()Description copied from interface:StringPatternHint method on whether this pattern matches everything or not.- Specified by:
matchesAllin interfaceStringPattern
-
exactMatch
Description copied from interface:StringPatternReturns the match if this pattern is exact, that is has no wildcard or other patterns inside. If the pattern is not exact, null is returned.- Specified by:
exactMatchin interfaceStringPattern
-
extractPrefix
Returns the longest string that prefixes every string accepted by this pattern, using Lucene'sOperations.getCommonPrefix(org.apache.lucene.util.automaton.Automaton). Returnsnullif the common prefix is empty (e.g. the pattern starts with a wildcard). -
extractSuffix
Returns the longest string that suffixes every string accepted by this pattern. Computed by reversing the automaton and extracting the common prefix of the reversed language, then reversing the result. Returnsnullif the common suffix is empty or the reversed automaton is too complex to determinize.
-