Class MetaStatement

java.lang.Object
org.pgcodekeeper.core.schema.meta.MetaStatement
All Implemented Interfaces:
Serializable, IStatement
Direct Known Subclasses:
MetaCast, MetaCompositeType, MetaConstraint, MetaFunction, MetaOperator, MetaRelation

public class MetaStatement extends Object implements IStatement, Serializable
Base class for all database metadata statement objects. Provides common functionality for accessing object location, names, and comments.
See Also:
  • Constructor Details

    • MetaStatement

      public MetaStatement(PgObjLocation object)
      Creates a new metadata statement with location information.
      Parameters:
      object - the object location information
    • MetaStatement

      public MetaStatement(GenericColumn column)
      Creates a new metadata statement from a generic column.
      Parameters:
      column - the generic column information
  • Method Details

    • getName

      public String getName()
      Description copied from interface: IStatement
      Gets the name of this statement.
      Specified by:
      getName in interface IStatement
      Returns:
      the statement name
    • getBareName

      public String getBareName()
      Description copied from interface: IStatement
      Gets the bare name without qualifiers or arguments.
      Specified by:
      getBareName in interface IStatement
      Returns:
      the bare name
    • getStatementType

      public DbObjType getStatementType()
      Description copied from interface: IStatement
      Gets the type of this database object.
      Specified by:
      getStatementType in interface IStatement
      Returns:
      the database object type
    • getGenericColumn

      public GenericColumn getGenericColumn()
      Returns the generic column information for this statement.
      Returns:
      the generic column
    • getObject

      public PgObjLocation getObject()
      Returns the object location information.
      Returns:
      the object location
    • getQualifiedName

      public String getQualifiedName()
      Description copied from interface: IStatement
      Gets the fully qualified name of this statement.
      Specified by:
      getQualifiedName in interface IStatement
      Returns:
      the qualified name
    • getComment

      public String getComment()
      Description copied from interface: IStatement
      Gets the comment associated with this statement.
      Specified by:
      getComment in interface IStatement
      Returns:
      the comment, or null if no comment is set
    • setComment

      public void setComment(String comment)
    • getObjLength

      public int getObjLength()
      Returns the length of the object in the source file.
      Returns:
      the object length
    • getOffset

      public int getOffset()
      Returns the offset of the object in the source file.
      Returns:
      the object offset
    • getFilePath

      public String getFilePath()
      Returns the file path where this object is defined.
      Returns:
      the file path
    • getLineNumber

      public int getLineNumber()
      Returns the line number where this object is defined.
      Returns:
      the line number
    • getParent

      public MetaStatement getParent()
      Returns the parent statement of this object. This operation is not supported for metadata statements.
      Specified by:
      getParent in interface IStatement
      Returns:
      never returns normally
      Throws:
      IllegalStateException - always thrown as this operation is unsupported
    • getDatabase

      public AbstractDatabase getDatabase()
      Returns the database containing this statement. This operation is not supported for metadata statements.
      Specified by:
      getDatabase in interface IStatement
      Returns:
      never returns normally
      Throws:
      IllegalStateException - always thrown as this operation is unsupported