Visitable
NewInvocationNode
, NonStaticMethodCallNode
, StaticMethodCallNode
abstract class MethodCallNode extends JavaValueNode
Modifier and Type | Field | Description |
---|---|---|
protected java.lang.String |
actualMethodReturnType |
|
(package private) boolean |
internalCall |
True if this is an internal call, just used to set up a generated method call.
|
(package private) java.lang.String |
javaClassName |
The name of the class containing the method.
|
protected java.lang.reflect.Member |
method |
|
(package private) java.lang.String |
methodName |
|
(package private) java.lang.String[] |
methodParameterTypes |
The parameter types for the resolved method.
|
protected JavaValueNode[] |
methodParms |
|
private java.lang.String[] |
procedurePrimitiveArrayType |
For resolution of procedure INOUT/OUT parameters to the primitive
form, such as int[].
|
(package private) RoutineAliasInfo |
routineInfo |
For a procedure or function call
|
protected JSQLType[] |
signature |
forCallStatement, jsqlType
AUTOINCREMENT_CREATE_MODIFY, AUTOINCREMENT_CYCLE, AUTOINCREMENT_INC_INDEX, AUTOINCREMENT_IS_AUTOINCREMENT_INDEX, AUTOINCREMENT_START_INDEX
Constructor | Description |
---|---|
MethodCallNode(java.lang.String methodName,
ContextManager cm) |
Modifier and Type | Method | Description |
---|---|---|
(package private) void |
acceptChildren(Visitor v) |
Accept the visitor for all visitable children of this node.
|
(package private) void |
addParms(java.util.List<ValueNode> parameterList) |
Add the parameter list
|
protected boolean |
areParametersQueryInvariant() |
Return whether or not all of the parameters to this node are
QUERY_INVARIANT or CONSTANT.
|
(package private) void |
bindParameters(FromList fromList,
SubqueryList subqueryList,
java.util.List<AggregateNode> aggregates) |
Bind this expression.
|
(package private) boolean |
categorize(JBitSet referencedTabs,
boolean simplePredsOnly) |
Categorize this predicate.
|
private void |
generateAndCastOneParameter(ExpressionClassBuilder acb,
MethodBuilder mb,
int param,
java.lang.String parameterType) |
Generate and cast one parameter, pushing the result onto the stack.
|
(package private) void |
generateOneParameter(ExpressionClassBuilder acb,
MethodBuilder mb,
int parameterNumber) |
Generate one parameter to the given method call.
|
int |
generateParameters(ExpressionClassBuilder acb,
MethodBuilder mb) |
Generate the parameters to the given method call
|
private void |
generateVarargs(ExpressionClassBuilder acb,
MethodBuilder mb) |
Generate the trailing routine arguments into a varargs array and
push that array onto the stack.
|
(package private) void |
getCorrelationTables(JBitSet correlationMap) |
Build a JBitSet of all of the tables that we are
correlated with.
|
(package private) DataTypeDescriptor |
getDataType() |
Override method in ancestor.
|
int |
getFirstVarargIdx() |
Get the index of the first vararg if this is a varargs method
|
(package private) TableName |
getFullName() |
Get the schema-qualified name of the the routine.
|
protected boolean[] |
getIsParam() |
Build an array of booleans denoting whether or not a given method
parameter is a ?.
|
java.lang.String |
getJavaClassName() |
|
(package private) java.lang.String |
getMethodName() |
|
(package private) java.lang.Class<?>[] |
getMethodParameterClasses() |
Get the resolved Classes of our parameters
|
(package private) JavaValueNode[] |
getMethodParms() |
Get the method parameters.
|
protected java.lang.String[] |
getObjectSignature() |
Build an array of names of the argument types.
|
(package private) static java.lang.String |
getObjectTypeName(JSQLType jsqlType,
TypeCompilerFactory tcf) |
|
(package private) int |
getOrderableVariantType() |
Return the variant type for the underlying expression.
|
static java.lang.String |
getParameterTypeName(JavaValueNode param) |
|
(package private) java.lang.String[] |
getPrimitiveSignature(boolean castToPrimitiveAsNecessary) |
|
java.lang.reflect.Member |
getResolvedMethod() |
|
protected int |
getRoutineArgIdx(int invocationArgIdx) |
Get the offset into the routine arguments corresponding to the index
of the invocation parameter.
|
protected int |
getRoutineArgIdx(RoutineAliasInfo rai,
int invocationArgIdx) |
|
RoutineAliasInfo |
getRoutineInfo() |
Get the details on the invoked routines.
|
private java.lang.String |
getVarargTypeName(java.lang.String arrayTypeName) |
Turn an array type name into the corresponding vararg type name
|
private int |
getVariantTypeOfParams() |
|
boolean |
hasVarargs() |
Return true if the routine has varargs
|
boolean |
isVararg(int parameterNumber) |
Return true if the parameter is a vararg
|
private java.lang.String[] |
parseValidateSignature(java.lang.String externalName,
int offset,
boolean hasDynamicResultSets) |
Parse the user supplied signature for a method and validate
it, need to match the number of parameters passed in and match
the valid types for the parameter.
|
(package private) void |
preprocess(int numTables,
FromList outerFromList,
SubqueryList outerSubqueryList,
PredicateList outerPredicateList) |
Preprocess an expression tree.
|
(package private) void |
printSubNodes(int depth) |
Prints the sub-nodes of this object.
|
(package private) JavaValueNode |
remapColumnReferencesToExpressions() |
Remap all ColumnReferences in this tree to be clones of the
underlying expression.
|
protected void |
resolveMethodCall(java.lang.String javaClassName,
boolean staticMethod) |
|
(package private) void |
setNullParameterInfo(java.lang.String[] parmTypeNames) |
Set the appropriate type information for a null passed as a parameter.
|
protected boolean |
someParametersAreNull() |
Return true if some parameters are null, false otherwise.
|
protected java.lang.String |
stripOneArrayLevel(java.lang.String typeName) |
Strip the trailing [] from a type name
|
(package private) void |
throwNoMethodFound(java.lang.String receiverTypeName,
java.lang.String[] parmTypeNames,
java.lang.String[] primParmTypeNames) |
Build parameters for error message and throw the exception when there
is no matching signature found.
|
java.lang.String |
toString() |
Convert this object to a String.
|
bindExpression, castToPrimitive, checkReliability, generate, generateExpression, generateReceiver, generateReceiver, getCollationType, getConstantValueAsObject, getJavaTypeName, getJSQLType, getPrimitiveTypeName, getReceiverExpression, isPrimitiveType, mapToTypeID, markForCallStatement, markReturnValueDiscarded, mustCastToPrimitive, returnValueDiscarded, returnValueToSQLDomain, setCollationType, setJavaTypeName, valueReturnedToSQLDomain
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
accept, addTag, addUDTUsagePriv, addUDTUsagePriv, bindOffsetFetch, bindRowMultiSet, bindUserCatalogType, bindUserType, checkReliability, checkReliability, convertDefaultNode, copyTagsFrom, createTypeDependency, debugFlush, debugPrint, disablePrivilegeCollection, formatNodeString, generateAuthorizeCheck, getBeginOffset, getClassFactory, getCompilerContext, getContext, getContextManager, getDataDictionary, getDependencyManager, getEndOffset, getExecutionFactory, getGenericConstantActionFactory, getIntProperty, getLanguageConnectionContext, getLongProperty, getNullNode, getOffsetOrderedNodes, getOptimizerFactory, getOptimizerTracer, getParameterTypes, getSchemaDescriptor, getSchemaDescriptor, getStatementType, getTableDescriptor, getTypeCompiler, getUDTDesc, isAtomic, isPrivilegeCollectionRequired, isSessionSchema, isSessionSchema, makeConstantAction, makeTableName, makeTableName, nodeHeader, optimizerTracingIsOn, orReliability, parseSearchCondition, parseStatement, printLabel, referencesSessionSchema, resolveTableToSynonym, setBeginOffset, setEndOffset, setRefActionInfo, stackPrint, taggedWith, treePrint, treePrint, verifyClassExist
java.lang.String methodName
java.lang.String javaClassName
RoutineAliasInfo routineInfo
boolean internalCall
private java.lang.String[] procedurePrimitiveArrayType
protected JSQLType[] signature
protected JavaValueNode[] methodParms
protected java.lang.reflect.Member method
protected java.lang.String actualMethodReturnType
java.lang.String[] methodParameterTypes
MethodCallNode(java.lang.String methodName, ContextManager cm)
java.lang.String getMethodName()
TableName getFullName()
Get the schema-qualified name of the the routine. Is non-null only for StaticMethodCallNodes.
public java.lang.String getJavaClassName()
public java.lang.reflect.Member getResolvedMethod()
public RoutineAliasInfo getRoutineInfo()
void addParms(java.util.List<ValueNode> parameterList) throws StandardException
parameterList
- A list of the parametersStandardException
- Thrown on errorjava.lang.Class<?>[] getMethodParameterClasses()
void getCorrelationTables(JBitSet correlationMap) throws StandardException
correlationMap
- The JBitSet of the tables that we are correlated with.StandardException
void printSubNodes(int depth)
printSubNodes
in class QueryTreeNode
depth
- The depth of this node in the treepublic java.lang.String toString()
toString
in class QueryTreeNode
final void bindParameters(FromList fromList, SubqueryList subqueryList, java.util.List<AggregateNode> aggregates) throws StandardException
fromList
- The FROM list for the query this
expression is in, for binding columns.subqueryList
- The subquery list being built as we find SubqueryNodesaggregates
- The aggregate list being built as we find AggregateNodesStandardException
- Thrown on errorprotected boolean areParametersQueryInvariant() throws StandardException
StandardException
- thrown on errorvoid throwNoMethodFound(java.lang.String receiverTypeName, java.lang.String[] parmTypeNames, java.lang.String[] primParmTypeNames) throws StandardException
receiverTypeName
- Type name for receiverparmTypeNames
- Type names for parameters as object typesprimParmTypeNames
- Type names for parameters as primitive typesStandardException
- Thrown on errorprivate java.lang.String getVarargTypeName(java.lang.String arrayTypeName)
void preprocess(int numTables, FromList outerFromList, SubqueryList outerSubqueryList, PredicateList outerPredicateList) throws StandardException
preprocess
in class JavaValueNode
numTables
- Number of tables in the DML StatementouterFromList
- FromList from outer query blockouterSubqueryList
- SubqueryList from outer query blockouterPredicateList
- PredicateList from outer query blockStandardException
- Thrown on errorValueNode.preprocess(int, org.apache.derby.impl.sql.compile.FromList, org.apache.derby.impl.sql.compile.SubqueryList, org.apache.derby.impl.sql.compile.PredicateList)
boolean categorize(JBitSet referencedTabs, boolean simplePredsOnly) throws StandardException
categorize
in class JavaValueNode
referencedTabs
- JBitSet with bit map of referenced FromTablessimplePredsOnly
- Whether or not to consider method
calls, field references and conditional nodes
when building bit mapStandardException
- Thrown on errorValueNode.categorize(org.apache.derby.iapi.util.JBitSet, boolean)
JavaValueNode remapColumnReferencesToExpressions() throws StandardException
remapColumnReferencesToExpressions
in class JavaValueNode
StandardException
- Thrown on errorValueNode.remapColumnReferencesToExpressions()
public boolean hasVarargs()
public int getFirstVarargIdx()
public boolean isVararg(int parameterNumber)
public int generateParameters(ExpressionClassBuilder acb, MethodBuilder mb) throws StandardException
acb
- The ExpressionClassBuilder for the class we're generatingmb
- the method the expression will go intoStandardException
- Thrown on errorprivate void generateAndCastOneParameter(ExpressionClassBuilder acb, MethodBuilder mb, int param, java.lang.String parameterType) throws StandardException
Generate and cast one parameter, pushing the result onto the stack.
StandardException
private void generateVarargs(ExpressionClassBuilder acb, MethodBuilder mb) throws StandardException
Generate the trailing routine arguments into a varargs array and push that array onto the stack.
StandardException
protected int getRoutineArgIdx(int invocationArgIdx)
Get the offset into the routine arguments corresponding to the index of the invocation parameter. The two indexes may be different in the case of varargs methods. There may be more invocation args than declared routine args. For a varargs routine, all of the trailing invocation parameters correspond to the last argument declared by the CREATE FUNCTION/PROCEDURE statement.
protected int getRoutineArgIdx(RoutineAliasInfo rai, int invocationArgIdx)
public static java.lang.String getParameterTypeName(JavaValueNode param) throws StandardException
StandardException
void generateOneParameter(ExpressionClassBuilder acb, MethodBuilder mb, int parameterNumber) throws StandardException
acb
- The ExpressionClassBuilder for the class we're generatingmb
- the method the expression will go intoparameterNumber
- Identifies which parameter to generate. 0 based.StandardException
- Thrown on errorvoid setNullParameterInfo(java.lang.String[] parmTypeNames) throws StandardException
parmTypeNames
- String[] with the java type names for the parameters
as declared by the methodStandardException
- Thrown on errorprotected void resolveMethodCall(java.lang.String javaClassName, boolean staticMethod) throws StandardException
StandardException
protected java.lang.String stripOneArrayLevel(java.lang.String typeName)
private java.lang.String[] parseValidateSignature(java.lang.String externalName, int offset, boolean hasDynamicResultSets) throws StandardException
offset
- Character offset of first parenhasDynamicResultSets
- Can ResultSet[] parameters be specified.StandardException
protected boolean someParametersAreNull()
protected java.lang.String[] getObjectSignature() throws StandardException
StandardException
- Thrown on errorprotected boolean[] getIsParam()
static java.lang.String getObjectTypeName(JSQLType jsqlType, TypeCompilerFactory tcf) throws StandardException
StandardException
java.lang.String[] getPrimitiveSignature(boolean castToPrimitiveAsNecessary) throws StandardException
StandardException
int getOrderableVariantType() throws StandardException
getOrderableVariantType
in class JavaValueNode
StandardException
private int getVariantTypeOfParams() throws StandardException
StandardException
DataTypeDescriptor getDataType() throws StandardException
getDataType
in class JavaValueNode
StandardException
JavaValueNode[] getMethodParms()
void acceptChildren(Visitor v) throws StandardException
acceptChildren
in class QueryTreeNode
v
- the visitorStandardException
- on errorApache Derby V10.14 Internals - Copyright © 2004,2018 The Apache Software Foundation. All Rights Reserved.