Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK
11g Release 2 (11.1.2.2.0)

E17493-03


oracle.javatools.db.plsql
Class PlSqlInterrogator

java.lang.Object
  extended by oracle.javatools.db.plsql.PlSqlInterrogator


public class PlSqlInterrogator
extends java.lang.Object

The PL/SQL Interrogator provides a structured model of PL/SQL source, User Defined Types and Trigger definitions.


Method Summary
 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)
           
static PlSqlInterrogator findOrCreate(java.lang.String key, java.lang.String source)
           
 java.lang.String getCollectionType()
           
 java.util.List<java.lang.String> getExternalDeclarations()
           
 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()
           
 PlsqlError[] getPlSqlErrors()
           
 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()
           
 boolean isEvolvedType()
           
 boolean isWrapped()
           
 PlSqlToken skipToCodeToken(PlSqlFragment frag, PlSqlToken tk, java.lang.String... tkStrs)
           

 

Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Method Detail

findOrCreate

public static PlSqlInterrogator findOrCreate(java.lang.String source)

findOrCreate

public static PlSqlInterrogator findOrCreate(java.lang.String key,
                                             java.lang.String source)

getPlSqlIdentifier

public PlSqlIdentifier getPlSqlIdentifier(java.lang.String schemaName)
Returns a PlSqlIdentifier derived from the PL/SQL in source. The schema of the PlSqlIdentifier will be schemaName if not explicitly defined in the source.

getPlSqlIdentifier

public PlSqlIdentifier getPlSqlIdentifier(java.lang.String schemaName,
                                          boolean force)
Returns a PlSqlIdentifier derived from the PL/SQL in source. The schema of the PlSqlIdentifier will be schemaName if not explicitly defined in the source, or if force == true.

getRoot

public PlSqlFragment getRoot()
Returns:
The root PlSqlFragment representing the entire PL/SQL source.

getType

public java.lang.String getType()
Returns:
The type of the object created by the PL/SQL source, eg PACKAGE, FUNCTION, TRIGGER

getSchemaName

public java.lang.String getSchemaName()
Returns:
The name of the object's schema created by the PL/SQL source if defined. null othewise.

getName

public java.lang.String getName()
Returns:
The name of the object created by the PL/SQL source

getTypeCode

public java.lang.String getTypeCode()
Returns:
The type code (OBJECT/COLLECTION) of the object created by the PL/SQL source

getCollectionType

public java.lang.String getCollectionType()
Returns:
The collection type (TABLE/VARING ARRAY) of the object created by the PL/SQL source

isWrapped

public boolean isWrapped()
Returns:
is the source wrapped

getLineNumber

public int getLineNumber(int offset)

getFragmentAtOffset

public PlSqlFragment getFragmentAtOffset(int offset)

getTokenAtOffset

public PlSqlToken getTokenAtOffset(int offset)

getPlSqlErrors

public PlsqlError[] getPlSqlErrors()

hasParseErrors

public boolean hasParseErrors()

containsToDo

public boolean containsToDo()

getRenamedSource

public java.lang.String getRenamedSource(java.lang.String newName)

getRenamedSource

public java.lang.String getRenamedSource(java.lang.String newName,
                                         boolean includeSchema)

isEvolvedType

public boolean isEvolvedType()

getUpdatedSourceForRelationRename

public java.lang.String getUpdatedSourceForRelationRename(java.lang.String newRelationName)

getSource

public java.lang.String getSource(PlSqlToken start,
                                  PlSqlToken end)

skipToCodeToken

public PlSqlToken skipToCodeToken(PlSqlFragment frag,
                                  PlSqlToken tk,
                                  java.lang.String... tkStrs)

findExecutableLineNumber

public int findExecutableLineNumber(java.lang.String signature)
Returns the line number of the first executable line in the procedure or function identified by the signature. If more than one procedure or function match the signature the first will be used.
Parameters:
signature - See findFragmentsBySignature(java.lang.String) for details.
Returns:
line number, or zero if no match found

getMatchingOffset

public int getMatchingOffset(int offset)

findFragmentsBySignature

public java.util.List<PlSqlFragment> findFragmentsBySignature(java.lang.String signature)
Returns a list of PlSqlFragments representing procedures or functions matching the given signature. The signature must be of the following form: The following are all examples of valid signatures:

getExternalDeclarations

public java.util.List<java.lang.String> getExternalDeclarations()

getLocationOffsets

public java.util.List<java.lang.Integer> getLocationOffsets(java.lang.String text)
Finds the offsets in the original source for tokens matching the given text. This is desgned to find plsql tokens only, so any comments, string or numeric literals etc will be ignored. If the case of the input argument is not upper then only double quoted strings continaing text will match.

Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK
11g Release 2 (11.1.2.2.0)

E17493-03


Copyright © 1997, 2012, Oracle. All rights reserved.