FileDocCategorySizeDatePackage
LiteralNode.javaAPI DocGlassfish v2 API4384Tue May 22 16:54:38 BST 2007oracle.toplink.essentials.internal.parsing

LiteralNode

public class LiteralNode extends Node
INTERNAL

Purpose: Superclass for literals (String, Integer, Float, Character, ...)

Responsibilities:

  • Maintain the literal being represented
  • Print to a string
  • Answer if the node is completely built
author
Jon Driscoll and Joel Lucuik
since
TopLink 4.0

Fields Summary
public Object
literal
Constructors Summary
public LiteralNode()
Return a new LiteralNode.

        super();
    
Methods Summary
public voidapplyToQuery(oracle.toplink.essentials.queryframework.ObjectLevelReadQuery theQuery, oracle.toplink.essentials.internal.parsing.GenerationContext context)
INTERNAL Apply this node to the passed query

        if (theQuery.isReportQuery()) {
            ReportQuery reportQuery = (ReportQuery)theQuery;
            reportQuery.addAttribute("CONSTANT", generateExpression(context));
        }
        
    
public oracle.toplink.essentials.expressions.ExpressiongenerateExpression(oracle.toplink.essentials.internal.parsing.GenerationContext context)
INTERNAL Generate the a new TopLink ConstantExpression for this node.

        Expression whereClause = new ConstantExpression(getLiteral(), new ExpressionBuilder());
        return whereClause;
    
public java.lang.StringgetAsString()
INTERNAL Return the literal

        return getLiteral().toString();
    
public java.lang.ObjectgetLiteral()
Insert the method's description here. Creation date: (12/21/00 10:51:48 AM)

return
java.lang.Object

        return literal;
    
public booleanisLiteralNode()
INTERNAL Is this a literal node

        return true;
    
public voidsetLiteral(java.lang.Object newLiteral)
Insert the method's description here. Creation date: (12/21/00 10:51:48 AM)

param
newLiteral java.lang.Object

        literal = newLiteral;
    
public java.lang.StringtoString(int indent)

        StringBuffer buffer = new StringBuffer();
        toStringIndent(indent, buffer);
        buffer.append(toStringDisplayName() + "[" + getLiteral() + "]");
        return buffer.toString();