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

PlusNode

public class PlusNode extends BinaryOperatorNode
INTERNAL

Purpose: Represent a '+' in EJBQL

Responsibilities:

  • Generate the correct expression for a '+'
author
Jon Driscoll and Joel Lucuik
since
July 2003

Fields Summary
Constructors Summary
public PlusNode()

        super();
    
Methods Summary
public oracle.toplink.essentials.expressions.ExpressiongenerateExpression(oracle.toplink.essentials.internal.parsing.GenerationContext context)
INTERNAL Generate the expression. The steps are: 1. Generate the expression for the left node 2. Add the .plus to the where clause returned from step 1 3. Generate the expression for the right side and use it as the parameter for the .plus() 4. Return the completed where clause to the caller

        Expression whereClause = getLeft().generateExpression(context);
        whereClause = ExpressionMath.add(whereClause, getRight().generateExpression(context));
        return whereClause;
    
public booleanisPlusNode()

        return true;
    
public voidvalidate(oracle.toplink.essentials.internal.parsing.ParseTreeContext context)
INTERNAL Validate node and calculates its type.

        super.validate(context);
        if ((left != null) && (right != null)) {
            TypeHelper typeHelper = context.getTypeHelper();
            setType(typeHelper.extendedBinaryNumericPromotion(
                    left.getType(), right.getType()));
        }