com.akiban.sql.parser
Class JavaValueNode

java.lang.Object
  extended by com.akiban.sql.parser.QueryTreeNode
      extended by com.akiban.sql.parser.JavaValueNode
All Implemented Interfaces:
Visitable
Direct Known Subclasses:
GetCurrentConnectionNode, MethodCallNode, SQLToJavaValueNode, StaticClassFieldReferenceNode

public abstract class JavaValueNode
extends QueryTreeNode

This abstract node class represents a data value in the Java domain.


Field Summary
protected  boolean forCallStatement
           
protected  JSQLType jsqlType
           
 
Fields inherited from class com.akiban.sql.parser.QueryTreeNode
AUTOINCREMENT_CREATE_MODIFY, AUTOINCREMENT_INC_INDEX, AUTOINCREMENT_IS_AUTOINCREMENT_INDEX, AUTOINCREMENT_START_INDEX
 
Constructor Summary
JavaValueNode()
           
 
Method Summary
 void castToPrimitive(boolean booleanValue)
          Toggles whether the code generator should add a cast to extract a primitive value from an object.
 void copyFrom(QueryTreeNode node)
          Fill this node with a deep copy of the given node.
 String getJavaTypeName()
           
 JSQLType getJSQLType()
          Get the JSQLType that corresponds to this node.
 String getPrimitiveTypeName()
           
 DataTypeDescriptor getType()
          Get the resolved data type of this node.
 boolean isPrimitiveType()
           
 TypeId mapToTypeID(JSQLType jsqlType)
          Map a JSQLType to a compilation type id.
 void markForCallStatement()
          Mark this node as being for a CALL Statement.
protected  void markReturnValueDiscarded()
          Tell this node that nothing is done with the returned value
 boolean mustCastToPrimitive()
          Reports whether the code generator should add a cast to extract a primitive value from an object.
protected  boolean returnValueDiscarded()
          Tell whether the return value from this node is discarded
protected  void returnValueToSQLDomain()
          Inform this node that it returns its value to the SQL domain
 void setJavaTypeName(String javaTypeName)
           
protected  boolean valueReturnedToSQLDomain()
          Tell whether this node returns its value to the SQL domain
 
Methods inherited from class com.akiban.sql.parser.QueryTreeNode
accept, convertDefaultNode, debugFlush, debugPrint, formatNodeString, getBeginOffset, getDebugOutput, getEndOffset, getNodeFactory, getNodeType, getNullNode, getParserContext, getStatementType, getUserData, init, init, init, init, init, init, init, init, init, init, init, init, init, init, isInstanceOf, makeTableName, makeTableName, nodeHeader, printLabel, printSubNodes, setBeginOffset, setDebugOutput, setEndOffset, setNodeType, setParserContext, setUserData, stackPrint, toString, treePrint, treePrint, treePrint
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

forCallStatement

protected boolean forCallStatement

jsqlType

protected JSQLType jsqlType
Constructor Detail

JavaValueNode

public JavaValueNode()
Method Detail

copyFrom

public void copyFrom(QueryTreeNode node)
              throws StandardException
Fill this node with a deep copy of the given node.

Overrides:
copyFrom in class QueryTreeNode
Throws:
StandardException

getType

public DataTypeDescriptor getType()
                           throws StandardException
Get the resolved data type of this node. May be overridden by descendants.

Throws:
StandardException

isPrimitiveType

public boolean isPrimitiveType()
                        throws StandardException
Throws:
StandardException

getJavaTypeName

public String getJavaTypeName()
                       throws StandardException
Throws:
StandardException

setJavaTypeName

public void setJavaTypeName(String javaTypeName)

getPrimitiveTypeName

public String getPrimitiveTypeName()
                            throws StandardException
Throws:
StandardException

castToPrimitive

public void castToPrimitive(boolean booleanValue)
Toggles whether the code generator should add a cast to extract a primitive value from an object.

Parameters:
booleanValue - true if we want the code generator to add a cast false otherwise

mustCastToPrimitive

public boolean mustCastToPrimitive()
Reports whether the code generator should add a cast to extract a primitive value from an object.

Returns:
true if we want the code generator to add a cast false otherwise

getJSQLType

public JSQLType getJSQLType()
                     throws StandardException
Get the JSQLType that corresponds to this node. Could be a SQLTYPE, a Java primitive, or a Java class.

Returns:
the corresponding JSQLType
Throws:
StandardException

mapToTypeID

public TypeId mapToTypeID(JSQLType jsqlType)
                   throws StandardException
Map a JSQLType to a compilation type id.

Parameters:
jsqlType - the universal type to map
Returns:
the corresponding compilation type id
Throws:
StandardException

markForCallStatement

public void markForCallStatement()
Mark this node as being for a CALL Statement. (void methods are only okay for CALL Statements)


returnValueToSQLDomain

protected void returnValueToSQLDomain()
Inform this node that it returns its value to the SQL domain


valueReturnedToSQLDomain

protected boolean valueReturnedToSQLDomain()
Tell whether this node returns its value to the SQL domain


markReturnValueDiscarded

protected void markReturnValueDiscarded()
Tell this node that nothing is done with the returned value


returnValueDiscarded

protected boolean returnValueDiscarded()
Tell whether the return value from this node is discarded



Copyright © 2013 Akiban Technologies, Inc. All rights reserved.