/** * Build a function extractor for a function call. * @param fc The function call. * @return The function call. */ public IValueExtractor buildFunctionExtractor(int tupleindex, FunctionCall fc, int subindex, BuildContext context) { List pcs = fc.getParameterSources(); IValueExtractor[] fex = new IValueExtractor[pcs.size()]; for(int i=0; i<pcs.size(); i++) { Object tmp = pcs.get(i); fex[i] = createValueExtractor(tupleindex, tmp, subindex, context, false); // if(tmp instanceof Variable) // { // fex[i] = buildVariableExtractor((Variable)tmp, context); // } // else if(tmp instanceof FunctionCall) // { // fex[i] = buildFunctionExtractor((FunctionCall)tmp, context); // } // else // { // fex[i] = new ConstantExtractor(tmp); // } } return new FunctionExtractor(fc.getFunction(), fex); }
/** * Build a function extractor for a function call. * @param fc The function call. * @return The function call. */ public IValueExtractor buildFunctionExtractor(int tupleindex, FunctionCall fc, int subindex, BuildContext context) { List pcs = fc.getParameterSources(); IValueExtractor[] fex = new IValueExtractor[pcs.size()]; for(int i=0; i<pcs.size(); i++) { Object tmp = pcs.get(i); fex[i] = createValueExtractor(tupleindex, tmp, subindex, context, false); // if(tmp instanceof Variable) // { // fex[i] = buildVariableExtractor((Variable)tmp, context); // } // else if(tmp instanceof FunctionCall) // { // fex[i] = buildFunctionExtractor((FunctionCall)tmp, context); // } // else // { // fex[i] = new ConstantExtractor(tmp); // } } return new FunctionExtractor(fc.getFunction(), fex); }
if(func.getFunction() instanceof OperatorFunction && ((OperatorFunction)func.getFunction()).getOperator().equals(IOperator.EQUAL))
if(func.getFunction() instanceof OperatorFunction && ((OperatorFunction)func.getFunction()).getOperator().equals(IOperator.EQUAL))
argtypes[i] = funcall.getFunction().getReturnType();
argtypes[i] = funcall.getFunction().getReturnType();
if(func.getFunction() instanceof OperatorFunction && ((OperatorFunction)func.getFunction()).getOperator().equals(IOperator.EQUAL))
if(func.getFunction() instanceof OperatorFunction && ((OperatorFunction)func.getFunction()).getOperator().equals(IOperator.EQUAL))
ret = tmodel.getJavaType(((FunctionCall)valuesource).getFunction().getReturnType());
ret = tmodel.getJavaType(((FunctionCall)valuesource).getFunction().getReturnType());
/** * * @param tmodel * @param valuesource * @return */ protected static OAVObjectType getValueSourceType(OAVTypeModel tmodel, Object valuesource) { OAVObjectType ret = null; if(valuesource instanceof OAVAttributeType) { ret = ((OAVAttributeType)valuesource).getType(); } else if(valuesource instanceof MethodCall) { Class rettype = ((MethodCall)valuesource).getMethod().getReturnType(); if(rettype!=null) ret = tmodel.getJavaType(rettype); } else if(valuesource instanceof FunctionCall) { Class rettype = ((FunctionCall)valuesource).getFunction().getReturnType(); if(rettype!=null) ret = tmodel.getJavaType(rettype); } return ret; }
/** * * @param tmodel * @param valuesource * @return */ protected static OAVObjectType getValueSourceType(OAVTypeModel tmodel, Object valuesource) { OAVObjectType ret = null; if(valuesource instanceof OAVAttributeType) { ret = ((OAVAttributeType)valuesource).getType(); } else if(valuesource instanceof MethodCall) { Class rettype = ((MethodCall)valuesource).getMethod().getReturnType(); if(rettype!=null) ret = tmodel.getJavaType(rettype); } else if(valuesource instanceof FunctionCall) { Class rettype = ((FunctionCall)valuesource).getFunction().getReturnType(); if(rettype!=null) ret = tmodel.getJavaType(rettype); } return ret; }