public class PlSqlSearch
extends java.lang.Object
TokenPattern class which supercedes PlSqlSearch.
PlSqlSearch itself is not thread safe as subsequent calls to matches(java.lang.String)
or isWithin(java.lang.String) will reset the internals of the search, affecting any
other thread that was calling getNamedMatch(String) etc.| Constructor and Description |
|---|
PlSqlSearch(java.lang.String expression)
Constructs a PlSqlSearch with the given expression.
|
| Modifier and Type | Method and Description |
|---|---|
PlSqlToken |
getEndToken() |
java.lang.String |
getNamedMatch(java.lang.String name) |
java.lang.String |
getNamedMatch(java.lang.String name,
boolean format)
Returns the results of a named search clause.
|
PlSqlToken |
getNamedMatchEndToken(java.lang.String name) |
PlSqlToken |
getNamedMatchStartToken(java.lang.String name) |
java.lang.String[] |
getNames() |
PlSqlToken |
getStartToken() |
int |
getTokenCount() |
boolean |
isWithin(PlSqlToken startToken) |
boolean |
isWithin(PlSqlToken startToken,
PlSqlToken endToken) |
boolean |
isWithin(java.lang.String source) |
boolean |
matches(PlSqlToken startToken) |
boolean |
matches(PlSqlToken startToken,
PlSqlToken endToken) |
boolean |
matches(java.lang.String source) |
public PlSqlSearch(java.lang.String expression)
expression - java.lang.IllegalArgumentExceptionpublic final boolean matches(java.lang.String source)
PlSqlSearch matches the source, false otherwise.public final boolean matches(PlSqlToken startToken)
PlSqlSearch matches the list of PlSqlTokens
starting at startToken, false otherwise.public final boolean matches(PlSqlToken startToken, PlSqlToken endToken)
PlSqlSearch matches the list of PlSqlTokens
starting at startToken and not extending past endToken, false otherwise.public final boolean isWithin(java.lang.String source)
PlSqlSearch is found within the given source, false otherwise.public final boolean isWithin(PlSqlToken startToken)
PlSqlSearch is found within the list of PlSqlTokens
starting at startToken, false otherwise.public final boolean isWithin(PlSqlToken startToken, PlSqlToken endToken)
PlSqlSearch is found within the list of PlSqlTokens
starting at startToken and not extending past endToken, false otherwise.public final java.lang.String getNamedMatch(java.lang.String name)
PlSqlSearch
if that clause matched.
See getNamedMatch(String name, boolean format)public final java.lang.String getNamedMatch(java.lang.String name,
boolean format)
name - The search clause name.format - how the match should be returned
PlSqlSearch
if that clause matched. If named clause did not produce a match, or the
name cannot be found, null is returned.public final PlSqlToken getNamedMatchStartToken(java.lang.String name)
public final PlSqlToken getNamedMatchEndToken(java.lang.String name)
public PlSqlToken getStartToken()
public PlSqlToken getEndToken()
public java.lang.String[] getNames()
public int getTokenCount()