All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.hibernate.sql.ordering.antlr.Factory Maven / Gradle / Ivy

There is a newer version: 7.0.0.Alpha1
Show newest version
/*
 * Hibernate, Relational Persistence for Idiomatic Java
 *
 * License: GNU Lesser General Public License (LGPL), version 2.1 or later.
 * See the lgpl.txt file in the root directory or .
 */
package org.hibernate.sql.ordering.antlr;

import antlr.ASTFactory;

/**
 * Acts as a {@link ASTFactory} for injecting our specific AST node classes into the Antlr generated trees.
 *
 * @author Steve Ebersole
 */
public class Factory extends ASTFactory implements OrderByTemplateTokenTypes {
	@Override
	public Class getASTNodeType(int i) {
		switch ( i ) {
			case ORDER_BY:
				return OrderByFragment.class;
			case SORT_SPEC:
				return SortSpecification.class;
			case ORDER_SPEC:
				return OrderingSpecification.class;
			case COLLATE:
				return CollationSpecification.class;
			case SORT_KEY:
				return SortKey.class;
			default:
				return NodeSupport.class;
		}
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy