FileDocCategorySizeDatePackage
Node.javaAPI DocHibernate 3.2.51541Tue Jun 27 21:53:40 BST 2006org.hibernate.hql.ast.tree

Node

public class Node extends antlr.CommonAST
Base node class for use by Hibernate within its AST trees.
author
Joshua Davis
author
Steve Ebersole

Fields Summary
private String
filename
private int
line
private int
column
private int
textLength
Constructors Summary
public Node()

		super();
	
public Node(antlr.Token tok)

		super(tok);  // This will call initialize(tok)!
	
Methods Summary
public intgetColumn()

		return column;
	
public java.lang.StringgetFilename()

		return filename;
	
public intgetLine()

		return line;
	
public java.lang.StringgetRenderText(org.hibernate.engine.SessionFactoryImplementor sessionFactory)
Retrieve the text to be used for rendering this particular node.

param
sessionFactory The session factory
return
The text to use for rendering

		// The basic implementation is to simply use the node's text
		return getText();
	
public intgetTextLength()

		return textLength;
	
public voidinitialize(antlr.Token tok)

		super.initialize(tok);
		filename = tok.getFilename();
		line = tok.getLine();
		column = tok.getColumn();
		String text = tok.getText();
		textLength = StringHelper.isEmpty(text) ? 0 : text.length();
	
public voidinitialize(antlr.collections.AST t)

		super.initialize( t );
		if ( t instanceof Node ) {
			Node n = (Node)t;
			filename = n.filename;
			line = n.line;
			column = n.column;
			textLength = n.textLength;
		}