|
Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference 11g Release 1 (11.1.1.9.0) E52944-01 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
oracle.javatools.db.plsql.PlSqlSearch
public class PlSqlSearch
PlSqlSearch works in colaboration with the PlSqlTokenizer
(and/or PlSqlInterrogator
) to provide a search mechanism for PL/SQL (including Triggers and User Defined Types).
Searches are applied using a regular expression like syntax, and applied only to the code, ignoring whitespace and comments.
Search Clause Syntax
A search expression is made up of one or more seach clauses, where a search clause is defined as one of the following:
Wildcards
A question mark ( ? ) can be placed in the expression, and this will match any single token. By combining the wildcard with the other search clause syntax, more complex strings can be matched. Using these combinations, two shortcuts are available:
Named Clauses
The results of any part of a match can be queried by naming search clauses within the overall expression. This is done by preceeding the search clause with the required name and enclosing the name and clause with < and > For example "procedure <name ?.>" would be found in both
create or replace procedure updateSalary is...
and
create or replace procedure hr.updateSalary is...
the value of name in the first case being UPDATESALARY and in the second HR.UPDATESALARY. See getNamedMatch(String name, boolean format)
for details.
Constructor Summary | |
---|---|
PlSqlSearch(java.lang.String expression) Constructs a PlSqlSearch with the given expression. |
Method Summary | |
---|---|
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. |
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) |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PlSqlSearch(java.lang.String expression) throws PlSqlSearchException
expression
-PlSqlSearchException
Method Detail |
---|
public 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 PlSqlToken getStartToken()
public PlSqlToken getEndToken()
public java.lang.String[] getNames()
public int getTokenCount()
|
Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference 11g Release 1 (11.1.1.9.0) E52944-01 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |