Top Description Fields Constructors Methods
org.hibernate.sql.ordering.antlr

public Class OrderByFragmentParser

extends GeneratedOrderByFragmentParser
Class Inheritance
Imports
java.util.ArrayList, antlr.TokenStream, .CommonAST, antlr.collections.AST, org.hibernate.sql.Template, org.hibernate.dialect.function.SQLFunction, org.hibernate.util.StringHelper, org.slf4j.Logger, .LoggerFactory

Extension of the Antlr-generated parser for the purpose of adding our custom parsing behavior.
Author
Steve Ebersole

Field Summary

Modifier and TypeField and Description
private final TranslationContext
private static final Logger
private int
Inherited from org.hibernate.sql.ordering.antlr.GeneratedOrderByFragmentParser:
_tokenNames_tokenSet_0_tokenSet_1_tokenSet_2_tokenSet_3_tokenSet_4_tokenSet_5_tokenSet_6_tokenSet_7_tokenSet_8

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private SortSpecification
createSortSpecification(AST ident, CollationSpecification collationSpecification, OrderingSpecification orderingSpecification)

protected boolean
isFunctionName(AST
The node whose text we want to check.
ast
)

Overrides org.hibernate.sql.ordering.antlr.GeneratedOrderByFragmentParser.isFunctionName.

A check to see if the text of the given node represents a known function name.
protected AST
postProcessSortSpecification(AST
grammar-built sort specification subtree.
sortSpec
)

Overrides org.hibernate.sql.ordering.antlr.GeneratedOrderByFragmentParser.postProcessSortSpecification.

Allow post processing of each sort specification
protected AST
quotedIdentifier(AST
The quoted-identifier node.
ident
)

Overrides org.hibernate.sql.ordering.antlr.GeneratedOrderByFragmentParser.quotedIdentifier.

Process the given node as a quote identifier.
protected AST
quotedString(AST
The quoted string. This is used from within function param recognition, and represents a SQL-quoted string.
ident
)

Overrides org.hibernate.sql.ordering.antlr.GeneratedOrderByFragmentParser.quotedString.

Process the given node as a quote string.
protected AST
resolveFunction(AST
node representing the function invocation (including parameters as subtree components).
ast
)

Overrides org.hibernate.sql.ordering.antlr.GeneratedOrderByFragmentParser.resolveFunction.

Process the given node as a function.
protected AST
resolveIdent(AST
The node whose text represents either a column or property reference.
ident
)

Overrides org.hibernate.sql.ordering.antlr.GeneratedOrderByFragmentParser.resolveIdent.

Process the given node as an IDENT.
protected void
trace(String
The trace message.
msg
)

Overrides org.hibernate.sql.ordering.antlr.GeneratedOrderByFragmentParser.trace.

Method for logging execution trace information.
public void
public void
Inherited from org.hibernate.sql.ordering.antlr.GeneratedOrderByFragmentParser:
buildTokenTypeASTClassMapcollationNamecollationSpecificationexpressionextractTextfunctionCallfunctionCallCheckfunctionNamefunctionParameterfunctionParameterListorderByFragmentorderingSpecificationsimplePropertyPathsortKeysortSpecification

Field Detail

contextback to summary
private final TranslationContext context
logback to summary
private static final Logger log
traceDepthback to summary
private int traceDepth

Hides antlr.Parser.traceDepth.

Constructor Detail

OrderByFragmentParserback to summary
public OrderByFragmentParser(TokenStream lexer, TranslationContext context)

Method Detail

createSortSpecificationback to summary
private SortSpecification createSortSpecification(AST ident, CollationSpecification collationSpecification, OrderingSpecification orderingSpecification)
isFunctionNameback to summary
protected boolean isFunctionName(AST ast)

Overrides org.hibernate.sql.ordering.antlr.GeneratedOrderByFragmentParser.isFunctionName.

Doc from org.hibernate.sql.ordering.antlr.GeneratedOrderByFragmentParser.isFunctionName.

A check to see if the text of the given node represents a known function name.

Parameters
ast:AST

The node whose text we want to check.

Returns:boolean

True if the node's text is a known function name, false otherwise.

postProcessSortSpecificationback to summary
protected AST postProcessSortSpecification(AST sortSpec)

Overrides org.hibernate.sql.ordering.antlr.GeneratedOrderByFragmentParser.postProcessSortSpecification.

Doc from org.hibernate.sql.ordering.antlr.GeneratedOrderByFragmentParser.postProcessSortSpecification.

Allow post processing of each sort specification

Parameters
sortSpec:AST

grammar-built sort specification subtree.

Returns:AST

The processed sort specification subtree.

quotedIdentifierback to summary
protected AST quotedIdentifier(AST ident)

Overrides org.hibernate.sql.ordering.antlr.GeneratedOrderByFragmentParser.quotedIdentifier.

Doc from org.hibernate.sql.ordering.antlr.GeneratedOrderByFragmentParser.quotedIdentifier.

Process the given node as a quote identifier. These need to be quoted in the dialect-specific way.

Parameters
ident:AST

The quoted-identifier node.

Returns:AST

The processed node.

quotedStringback to summary
protected AST quotedString(AST ident)

Overrides org.hibernate.sql.ordering.antlr.GeneratedOrderByFragmentParser.quotedString.

Doc from org.hibernate.sql.ordering.antlr.GeneratedOrderByFragmentParser.quotedString.

Process the given node as a quote string.

Parameters
ident:AST

The quoted string. This is used from within function param recognition, and represents a SQL-quoted string.

Returns:AST

The processed node.

resolveFunctionback to summary
protected AST resolveFunction(AST ast)

Overrides org.hibernate.sql.ordering.antlr.GeneratedOrderByFragmentParser.resolveFunction.

Doc from org.hibernate.sql.ordering.antlr.GeneratedOrderByFragmentParser.resolveFunction.

Process the given node as a function.

Parameters
ast:AST

node representing the function invocation (including parameters as subtree components).

Returns:AST

The processed node.

resolveIdentback to summary
protected AST resolveIdent(AST ident)

Overrides org.hibernate.sql.ordering.antlr.GeneratedOrderByFragmentParser.resolveIdent.

Doc from org.hibernate.sql.ordering.antlr.GeneratedOrderByFragmentParser.resolveIdent.

Process the given node as an IDENT. May represent either a column reference or a property reference.

Parameters
ident:AST

The node whose text represents either a column or property reference.

Returns:AST

The processed node.

traceback to summary
protected void trace(String msg)

Overrides org.hibernate.sql.ordering.antlr.GeneratedOrderByFragmentParser.trace.

Doc from org.hibernate.sql.ordering.antlr.GeneratedOrderByFragmentParser.trace.

Method for logging execution trace information.

Parameters
msg:String

The trace message.

traceInback to summary
public void traceIn(String ruleName)

Overrides antlr.LLkParser.traceIn.

traceOutback to summary
public void traceOut(String ruleName)

Overrides antlr.LLkParser.traceOut.