Top Description Fields Constructors Methods
org.hibernate.hql.internal.ast.util

public Class ASTAppender

extends Object
Class Inheritance
Imports
antlr.ASTFactory, antlr.collections.AST

Appends child nodes to a parent efficiently.
Author
Joshua Davis

Field Summary

Modifier and TypeField and Description
private ASTFactory
private AST
private AST

Constructor Summary

AccessConstructor and Description
public
ASTAppender(ASTFactory
The AST factory
factory
,
AST
The AST parent
parent
)

Builds an appender using the given factory and parent

Method Summary

Modifier and TypeMethod and Description
public AST

Returns:

The generated AST node; may return null
append
(int
The node type
type
,
String
The node text
text
,
boolean
Should we do the append if the text is empty?
appendIfEmpty
)

Append a new child to parent using the given node type and text, but only if the text is non-empty

public AST

Returns:

Returns what was passed in.
append
(AST
The child to append
child
)

Append the given AST node as a child of parent.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

factoryback to summary
private ASTFactory factory
lastback to summary
private AST last
parentback to summary
private AST parent

Constructor Detail

ASTAppenderback to summary
public ASTAppender(ASTFactory factory, AST parent)

Builds an appender using the given factory and parent

Parameters
factory:ASTFactory

The AST factory

parent:AST

The AST parent

Method Detail

appendback to summary
public AST append(int type, String text, boolean appendIfEmpty)

Append a new child to parent using the given node type and text, but only if the text is non-empty

Parameters
type:int

The node type

text:String

The node text

appendIfEmpty:boolean

Should we do the append if the text is empty?

Returns:AST

The generated AST node; may return null

appendback to summary
public AST append(AST child)

Append the given AST node as a child of parent.

Parameters
child:AST

The child to append

Returns:AST

Returns what was passed in.