public class PlSqlInterrogator
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
void |
cancelCurrentBuild()
If this PlSqlInterrogator is currently interrogating the PLSQL to build the tree of PlSqlFragments
this will cause that process to be cancelled.
|
boolean |
containsToDo() |
int |
findExecutableLineNumber(java.lang.String signature)
Returns the line number of the first executable line in the
procedure or function identified by the signature.
|
java.util.List<PlSqlFragment> |
findFragmentsBySignature(java.lang.String signature)
Returns a list of PlSqlFragments representing procedures or functions
matching the given signature.
|
static PlSqlInterrogator |
findOrCreate(java.lang.String source)
Return a PlSqlInterrogator for the given source.
|
static PlSqlInterrogator |
findOrCreate(java.lang.String key,
java.lang.String source)
Return a PlSqlInterrogator for the given source.
|
static PlSqlInterrogator |
findOrCreate(java.lang.String key,
java.lang.String source,
Holder<PlSqlInterrogator> holder)
Return a PlSqlInterrogator for the given source.
|
java.lang.String |
getCollectionType() |
java.util.List<java.lang.String> |
getExternalDeclarations()
Deprecated.
|
PlSqlFragment |
getFragmentAtOffset(int offset) |
int |
getLineNumber(int offset) |
java.util.List<java.lang.Integer> |
getLocationOffsets(java.lang.String text)
Finds the offsets in the original source for tokens matching the given text.
|
int |
getMatchingOffset(int offset) |
java.lang.String |
getName() |
int |
getNameOffset() |
PlsqlError[] |
getPlSqlErrors()
Deprecated.
Use PlSqlParserHelper.getIssues(String text) instead.
|
PlSqlIdentifier |
getPlSqlIdentifier(java.lang.String schemaName)
Returns a PlSqlIdentifier derived from the PL/SQL in source.
|
PlSqlIdentifier |
getPlSqlIdentifier(java.lang.String schemaName,
boolean force)
Returns a PlSqlIdentifier derived from the PL/SQL in source.
|
java.lang.String |
getRenamedSource(java.lang.String newName) |
java.lang.String |
getRenamedSource(java.lang.String newName,
boolean includeSchema) |
PlSqlFragment |
getRoot() |
java.lang.String |
getSchemaName() |
java.lang.String |
getSource(PlSqlToken start,
PlSqlToken end) |
PlSqlToken |
getTokenAtOffset(int offset) |
java.lang.String |
getType() |
java.lang.String |
getTypeCode() |
java.lang.String |
getUpdatedSourceForRelationRename(java.lang.String newRelationName) |
boolean |
hasParseErrors()
Deprecated.
Use PlSqlParserHelper.getIssues(String text), and check
!list.isEmpty() instead.
|
boolean |
isCurrentBuildCancelled()
Has the building of PlSqlFragments for tyhis PlSqlInterrogator been cancelled.
|
boolean |
isEvolvedType() |
boolean |
isWrapped() |
PlSqlToken |
skipToCodeToken(PlSqlFragment frag,
PlSqlToken tk,
java.lang.String... tkStrs) |
public static PlSqlInterrogator findOrCreate(java.lang.String source)
If the thread is interruped while parsing, processing will stop and a PlSqlInterrogator
with only basic properties defined (and no PlSqlFragment tree) will be returned.
The interrupt status of the current thread will remain set and #isThreadInterrupted
will return true.
source
- PL/SQL source code.public static PlSqlInterrogator findOrCreate(java.lang.String key, java.lang.String source)
If the thread is interruped while parsing, processing will stop and a PlSqlInterrogator
with only basic properties defined (and no PlSqlFragment tree) will be returned.
The interrupt status of the current thread will remain set and #isThreadInterrupted
will return true.
Note: It is the callers responsibility to ensure a 1:1 mapping between key and source.
key
- a unique key to identify a cached PlSqlInterrogatorsource
- PL/SQL source code.public static PlSqlInterrogator findOrCreate(java.lang.String key, java.lang.String source, Holder<PlSqlInterrogator> holder)
If the thread is interruped while parsing, processing will stop and a PlSqlInterrogator
with only basic properties defined (and no PlSqlFragment tree) will be returned.
The interrupt status of the current thread will remain set and #isThreadInterrupted
will return true.
Note: It is the callers responsibility to ensure a 1:1 mapping between key and source.
key
- a unique key to identify a cached PlSqlInterrogatorsource
- PL/SQL source code.holder
- A Holder object into which the PlSqlInterrogator will be placed before the
interrogation starts.public PlSqlIdentifier getPlSqlIdentifier(java.lang.String schemaName)
public PlSqlIdentifier getPlSqlIdentifier(java.lang.String schemaName, boolean force)
public void cancelCurrentBuild()
public boolean isCurrentBuildCancelled()
public PlSqlFragment getRoot()
PlSqlFragment
representing the entire
PL/SQL source.public java.lang.String getType()
public java.lang.String getSchemaName()
public java.lang.String getName()
public int getNameOffset()
public java.lang.String getTypeCode()
public java.lang.String getCollectionType()
public boolean isWrapped()
public int getLineNumber(int offset)
public PlSqlFragment getFragmentAtOffset(int offset)
public PlSqlToken getTokenAtOffset(int offset)
@Deprecated public PlsqlError[] getPlSqlErrors()
@Deprecated public boolean hasParseErrors()
public boolean containsToDo()
public java.lang.String getRenamedSource(java.lang.String newName)
public java.lang.String getRenamedSource(java.lang.String newName, boolean includeSchema)
public boolean isEvolvedType()
public java.lang.String getUpdatedSourceForRelationRename(java.lang.String newRelationName)
public java.lang.String getSource(PlSqlToken start, PlSqlToken end)
public PlSqlToken skipToCodeToken(PlSqlFragment frag, PlSqlToken tk, java.lang.String... tkStrs)
public int findExecutableLineNumber(java.lang.String signature)
signature
- See findFragmentsBySignature(java.lang.String)
for details.public int getMatchingOffset(int offset)
public java.util.List<PlSqlFragment> findFragmentsBySignature(java.lang.String signature)
@Deprecated public java.util.List<java.lang.String> getExternalDeclarations()
public java.util.List<java.lang.Integer> getLocationOffsets(java.lang.String text)