java.lang.Object
org.firebirdsql.jdbc.metadata.MetadataPatternMatcher
Emulates behavior of a database metadata pattern.
This behaves similar to (but not 100% identical to) a SQL LIKE pattern with ESCAPE '\' clause.
This implementation is not thread-safe.
- Since:
- 4.0
- Author:
- Mark Rotteveel
-
Method Summary
Modifier and TypeMethodDescriptionstatic MetadataPatternMatcherfromPattern(MetadataPattern metadataPattern) Derives a metadata pattern matcher from a metadata pattern instance.abstract booleanChecks ifvaluematches the pattern of this matcher.static StringpatternToRegex(String metadataPattern) Creates a regular expression pattern equivalent to the provided database metadata pattern.
-
Method Details
-
fromPattern
Derives a metadata pattern matcher from a metadata pattern instance.- Parameters:
metadataPattern- Metadata pattern instance- Returns:
- Matcher for
metadataPattern
-
matches
Checks ifvaluematches the pattern of this matcher.This method is not thread-safe.
- Parameters:
value- Value to check- Returns:
trueifvaluematches this pattern,falseotherwise
-
patternToRegex
Creates a regular expression pattern equivalent to the provided database metadata pattern.- Parameters:
metadataPattern- database metadata pattern- Returns:
- Pattern for the provided like string.
-