Class QNameParser<T extends org.antlr.v4.runtime.ParserRuleContext>
java.lang.Object
org.pgcodekeeper.core.database.base.parser.QNameParser<T>
- Type Parameters:
T- the type of parser context being processed
Utility class for parsing and processing qualified names (schema.object names)
in SQL statements. Supports extracting individual name components from
schema-qualified identifiers.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGets the first name component from this qualified name.static <T extends org.antlr.v4.runtime.ParserRuleContext>
StringgetFirstName(List<T> ids) Gets the first (leftmost) name component from a list of identifiers.static <T extends org.antlr.v4.runtime.ParserRuleContext>
TgetFirstNameCtx(List<T> ids) Gets the context for the first name component.getIds()Gets the schema name from this qualified name.static <T extends org.antlr.v4.runtime.ParserRuleContext>
StringgetSchemaName(List<T> ids) Gets the schema name from a qualified identifier.static <T extends org.antlr.v4.runtime.ParserRuleContext>
TgetSchemaNameCtx(List<T> ids) Gets the context for the schema name component.Gets the second name component from this qualified name.static <T extends org.antlr.v4.runtime.ParserRuleContext>
StringgetSecondName(List<T> ids) Gets the second name component from a list of identifiers.static <T extends org.antlr.v4.runtime.ParserRuleContext>
TgetSecondNameCtx(List<T> ids) Gets the context for the second name component.Gets the third name component from this qualified name.static <T extends org.antlr.v4.runtime.ParserRuleContext>
StringgetThirdName(List<T> ids) Gets the third name component from a list of identifiers.static <T extends org.antlr.v4.runtime.ParserRuleContext>
TgetThirdNameCtx(List<T> ids) Gets the context for the third name component.booleanChecks if any errors occurred during parsing.
-
Constructor Details
-
QNameParser
-
-
Method Details
-
getFirstName
Gets the first (leftmost) name component from a list of identifiers.- Parameters:
ids- list of identifier contexts- Returns:
- first name component or null if not available
-
getSecondName
Gets the second name component from a list of identifiers.- Parameters:
ids- list of identifier contexts- Returns:
- second name component or null if not available
-
getThirdName
Gets the third name component from a list of identifiers.- Parameters:
ids- list of identifier contexts- Returns:
- third name component or null if not available
-
getFirstNameCtx
Gets the context for the first name component.- Parameters:
ids- list of identifier contexts- Returns:
- parser context for first name or null
-
getSecondNameCtx
Gets the context for the second name component.- Parameters:
ids- list of identifier contexts- Returns:
- parser context for second name or null
-
getThirdNameCtx
Gets the context for the third name component.- Parameters:
ids- list of identifier contexts- Returns:
- parser context for third name or null
-
getSchemaName
Gets the schema name from a qualified identifier.- Parameters:
ids- list of identifier contexts- Returns:
- schema name or null if not qualified
-
getSchemaNameCtx
Gets the context for the schema name component.- Parameters:
ids- list of identifier contexts- Returns:
- parser context for schema name or null
-
getIds
-
getFirstName
Gets the first name component from this qualified name.- Returns:
- first name component or null
-
getSecondName
Gets the second name component from this qualified name.- Returns:
- second name component or null
-
getThirdName
Gets the third name component from this qualified name.- Returns:
- third name component or null
-
getSchemaName
Gets the schema name from this qualified name.- Returns:
- schema name or null if not qualified
-
hasErrors
public boolean hasErrors()Checks if any errors occurred during parsing.- Returns:
- true if parsing errors were encountered
-