Class PgObjLocation

java.lang.Object
org.pgcodekeeper.core.ContextLocation
org.pgcodekeeper.core.schema.PgObjLocation
All Implemented Interfaces:
Serializable

public class PgObjLocation extends ContextLocation
Represents the location of a database object in source code. Contains position information, object details, and context for parsing and analysis.
See Also:
  • Method Details

    • equals

      public boolean equals(Object obj)
      Description copied from class: ContextLocation
      Compares this location with another object for equality.
      Overrides:
      equals in class ContextLocation
      Parameters:
      obj - the object to compare with
      Returns:
      true if the other object is a ContextLocation with identical file path, offset, line number and character position
    • hashCode

      public int hashCode()
      Description copied from class: ContextLocation
      Computes a hash code based on all location attributes.
      Overrides:
      hashCode in class ContextLocation
      Returns:
      a hash code value for this location
    • setWarning

      public void setWarning(DangerStatement danger)
    • isDanger

      public boolean isDanger()
      Checks if this location has a danger warning.
      Returns:
      true if there is a danger warning
    • getDanger

      public DangerStatement getDanger()
    • getObj

      public GenericColumn getObj()
    • getObjLength

      public int getObjLength()
    • getAction

      public String getAction()
    • getSql

      public String getSql()
    • getLocationType

      public PgObjLocation.LocationType getLocationType()
    • isGlobal

      public boolean isGlobal()
      Checks if this location represents a global reference.
      Returns:
      true if the location is a definition or reference type
    • getObjName

      public String getObjName()
      Gets the object name.
      Returns:
      object name or empty string if no object
    • getSchema

      public String getSchema()
      Gets the schema name.
      Returns:
      schema name or null if no object
    • getTable

      public String getTable()
      Gets the table name.
      Returns:
      table name or null if no object
    • getColumn

      public String getColumn()
      Gets the column name.
      Returns:
      column name or null if no object
    • getType

      public DbObjType getType()
      Gets the database object type.
      Returns:
      object type or null if no object
    • getQualifiedName

      public String getQualifiedName()
      Gets the fully qualified name of the object.
      Returns:
      qualified name or null if no object
    • getBareName

      public String getBareName()
      Returns:
      name stripped of arguments for function signatures
    • compare

      public final boolean compare(PgObjLocation loc)
      Compares this location with another location for equality.
      Parameters:
      loc - the location to compare with
      Returns:
      true if the locations refer to the same object
    • copyWithOffset

      public PgObjLocation copyWithOffset(int offset, int lineOffset, int inLineOffset, String filePath)
      Creates a copy of this location with adjusted position offsets.
      Parameters:
      offset - the offset adjustment
      lineOffset - the line number adjustment
      inLineOffset - the character position adjustment
      filePath - the new file path
      Returns:
      a new PgObjLocation with adjusted position
    • toString

      public String toString()
      Overrides:
      toString in class Object