當前位置: 首頁>>代碼示例>>Java>>正文


Java ExprLambdaGoesNode類代碼示例

本文整理匯總了Java中com.espertech.esper.epl.enummethod.dot.ExprLambdaGoesNode的典型用法代碼示例。如果您正苦於以下問題:Java ExprLambdaGoesNode類的具體用法?Java ExprLambdaGoesNode怎麽用?Java ExprLambdaGoesNode使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


ExprLambdaGoesNode類屬於com.espertech.esper.epl.enummethod.dot包,在下文中一共展示了ExprLambdaGoesNode類的13個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getExprNodesLibFunc

import com.espertech.esper.epl.enummethod.dot.ExprLambdaGoesNode; //導入依賴的package包/類
public static List<ExprNode> getExprNodesLibFunc(EsperEPL2GrammarParser.LibFunctionArgsContext ctx, Map<Tree, ExprNode> astExprNodeMap) {
    if (ctx == null) {
        return Collections.emptyList();
    }
    List<EsperEPL2GrammarParser.LibFunctionArgItemContext> args = ctx.libFunctionArgItem();
    if (args == null || args.isEmpty()) {
        return Collections.emptyList();
    }
    List<ExprNode> parameters = new ArrayList<ExprNode>(args.size());
    for (EsperEPL2GrammarParser.LibFunctionArgItemContext arg : args) {
        if (arg.expressionLambdaDecl() != null) {
            List<String> lambdaparams = getLambdaGoesParams(arg.expressionLambdaDecl());
            ExprLambdaGoesNode goes = new ExprLambdaGoesNode(lambdaparams);
            ExprNode lambdaExpr = ASTExprHelper.exprCollectSubNodes(arg.expressionWithNamed(), 0, astExprNodeMap).get(0);
            goes.addChildNode(lambdaExpr);
            parameters.add(goes);
        } else {
            ExprNode parameter = ASTExprHelper.exprCollectSubNodes(arg.expressionWithNamed(), 0, astExprNodeMap).get(0);
            parameters.add(parameter);
        }
    }
    return parameters;
}
 
開發者ID:espertechinc,項目名稱:esper,代碼行數:24,代碼來源:ASTLibFunctionHelper.java

示例2: getExprNodesLibFunc

import com.espertech.esper.epl.enummethod.dot.ExprLambdaGoesNode; //導入依賴的package包/類
public static List<ExprNode> getExprNodesLibFunc(int start, Tree parent, Map<Tree, ExprNode> astExprNodeMap) {
    List<ExprNode> parameters = new ArrayList<ExprNode>();
    int exprNum = start;
    while (exprNum < parent.getChildCount()) {
        if (parent.getChild(exprNum).getType() == EsperEPL2Ast.GOES) {
            ExprLambdaGoesNode goes = getLambdaGoes(parent.getChild(exprNum));
            ExprNode lambdaExpr = astExprNodeMap.remove(parent.getChild(++exprNum));
            goes.addChildNode(lambdaExpr);
            parameters.add(goes);
        }
        else {
            ExprNode parameter = astExprNodeMap.remove(parent.getChild(exprNum));
            if (parameter != null) {
                parameters.add(parameter);
            }
        }
        exprNum++;
    }
    return parameters;
}
 
開發者ID:mobile-event-processing,項目名稱:Asper,代碼行數:21,代碼來源:ASTLibHelper.java

示例3: getProvidedFootprint

import com.espertech.esper.epl.enummethod.dot.ExprLambdaGoesNode; //導入依賴的package包/類
public static DotMethodFPProvided getProvidedFootprint(List<ExprNode> parameters) {
    List<DotMethodFPProvidedParam> paramsList = new ArrayList<DotMethodFPProvidedParam>();
    for (ExprNode node : parameters) {
        if (!(node instanceof ExprLambdaGoesNode)) {
            paramsList.add(new DotMethodFPProvidedParam(0, node.getForge().getEvaluationType(), node));
            continue;
        }
        ExprLambdaGoesNode goesNode = (ExprLambdaGoesNode) node;
        paramsList.add(new DotMethodFPProvidedParam(goesNode.getGoesToNames().size(), null, goesNode));
    }
    return new DotMethodFPProvided(paramsList.toArray(new DotMethodFPProvidedParam[paramsList.size()]));
}
 
開發者ID:espertechinc,項目名稱:esper,代碼行數:13,代碼來源:DotMethodUtil.java

示例4: isVisit

import com.espertech.esper.epl.enummethod.dot.ExprLambdaGoesNode; //導入依賴的package包/類
public boolean isVisit(ExprNode exprNode) {
    if (exprNode instanceof ExprLambdaGoesNode) {
        return false;
    }

    if (isVisitAggregateNodes) {
        return true;
    }

    return !(exprNode instanceof ExprAggregateNode);
}
 
開發者ID:espertechinc,項目名稱:esper,代碼行數:12,代碼來源:ExprNodeStreamSelectVisitor.java

示例5: isVisit

import com.espertech.esper.epl.enummethod.dot.ExprLambdaGoesNode; //導入依賴的package包/類
public boolean isVisit(ExprNode exprNode) {
    if (exprNode instanceof ExprLambdaGoesNode) {
        return false;
    }
    if (isVisitAggregateNodes) {
        return true;
    }
    return !(exprNode instanceof ExprAggregateNode);
}
 
開發者ID:espertechinc,項目名稱:esper,代碼行數:10,代碼來源:ExprNodeIdentifierAndStreamRefVisitor.java

示例6: getValidatedSubtree

import com.espertech.esper.epl.enummethod.dot.ExprLambdaGoesNode; //導入依賴的package包/類
/**
 * Validates the expression node subtree that has this
 * node as root. Some of the nodes of the tree, including the
 * root, might be replaced in the process.
 *
 * @param origin            validate origin
 * @param exprNode          node
 * @param validationContext context
 * @return the root node of the validated subtree, possibly
 * different than the root node of the unvalidated subtree
 * @throws ExprValidationException when the validation fails
 */
public static ExprNode getValidatedSubtree(ExprNodeOrigin origin, ExprNode exprNode, ExprValidationContext validationContext) throws ExprValidationException {
    if (exprNode instanceof ExprLambdaGoesNode) {
        return exprNode;
    }

    try {
        return getValidatedSubtreeInternal(exprNode, validationContext, true);
    } catch (ExprValidationException ex) {
        try {
            String text;
            if (exprNode instanceof ExprSubselectNode) {
                ExprSubselectNode subselect = (ExprSubselectNode) exprNode;
                text = getSubqueryInfoText(subselect.getSubselectNumber() - 1, subselect);
            } else {
                text = toExpressionStringMinPrecedenceSafe(exprNode);
                if (text.length() > 40) {
                    String shortened = text.substring(0, 35);
                    text = shortened + "...(" + text.length() + " chars)";
                }
                text = "'" + text + "'";
            }
            throw new ExprValidationException("Failed to validate " +
                    origin.getClauseName() +
                    " expression " +
                    text + ": " +
                    ex.getMessage(), ex);
        } catch (RuntimeException rtex) {
            log.debug("Failed to render nice validation message text: " + rtex.getMessage(), rtex);
            throw ex;
        }
    }
}
 
開發者ID:espertechinc,項目名稱:esper,代碼行數:45,代碼來源:ExprNodeUtilityRich.java

示例7: getLambdaGoes

import com.espertech.esper.epl.enummethod.dot.ExprLambdaGoesNode; //導入依賴的package包/類
private static ExprLambdaGoesNode getLambdaGoes(Tree child) {
    List<String> parameters = new ArrayList<String>();
    if (child.getChild(0).getType() == EsperEPL2Ast.IDENT) {
        parameters.add(child.getChild(0).getText());
    }
    else {
        parameters = getIdentList(child.getChild(0));
    }
    return new ExprLambdaGoesNode(parameters);
}
 
開發者ID:mobile-event-processing,項目名稱:Asper,代碼行數:11,代碼來源:ASTLibHelper.java

示例8: getProvidedFootprint

import com.espertech.esper.epl.enummethod.dot.ExprLambdaGoesNode; //導入依賴的package包/類
public static DotMethodFPProvided getProvidedFootprint(List<ExprNode> parameters) {
    List<DotMethodFPProvidedParam> paramsList = new ArrayList<DotMethodFPProvidedParam>();
    for (ExprNode node : parameters) {
        if (!(node instanceof ExprLambdaGoesNode)) {
            paramsList.add(new DotMethodFPProvidedParam(0, node.getExprEvaluator().getType(), node));
            continue;
        }
        ExprLambdaGoesNode goesNode = (ExprLambdaGoesNode) node;
        paramsList.add(new DotMethodFPProvidedParam(goesNode.getGoesToNames().size(), null, goesNode));
    }
    return new DotMethodFPProvided(paramsList.toArray(new DotMethodFPProvidedParam[paramsList.size()]));
}
 
開發者ID:mobile-event-processing,項目名稱:Asper,代碼行數:13,代碼來源:DotMethodUtil.java

示例9: getValidatedSubtree

import com.espertech.esper.epl.enummethod.dot.ExprLambdaGoesNode; //導入依賴的package包/類
/**
 * Validates the expression node subtree that has this
 * node as root. Some of the nodes of the tree, including the
 * root, might be replaced in the process.
 * @throws com.espertech.esper.epl.expression.ExprValidationException when the validation fails
 * @return the root node of the validated subtree, possibly
 *         different than the root node of the unvalidated subtree
 */
public static ExprNode getValidatedSubtree(ExprNode exprNode, ExprValidationContext validationContext) throws ExprValidationException
{
    if (exprNode instanceof ExprLambdaGoesNode) {
        return exprNode;
    }

    return getValidatedSubtreeInternal(exprNode, validationContext, true);
}
 
開發者ID:mobile-event-processing,項目名稱:Asper,代碼行數:17,代碼來源:ExprNodeUtility.java

示例10: isVisit

import com.espertech.esper.epl.enummethod.dot.ExprLambdaGoesNode; //導入依賴的package包/類
public boolean isVisit(ExprNode exprNode)
{
    if (exprNode instanceof ExprLambdaGoesNode) {
        return false;
    }
    
    if (isVisitAggregateNodes)
    {
        return true;
    }

    return (!(exprNode instanceof ExprAggregateNode));
}
 
開發者ID:mobile-event-processing,項目名稱:Asper,代碼行數:14,代碼來源:ExprNodeIdentifierVisitor.java

示例11: getValidatedSubtreeInternal

import com.espertech.esper.epl.enummethod.dot.ExprLambdaGoesNode; //導入依賴的package包/類
private static ExprNode getValidatedSubtreeInternal(ExprNode exprNode, ExprValidationContext validationContext, boolean isTopLevel) throws ExprValidationException {
    ExprNode result = exprNode;
    if (exprNode instanceof ExprLambdaGoesNode) {
        return exprNode;
    }

    for (int i = 0; i < exprNode.getChildNodes().length; i++) {
        ExprNode childNode = exprNode.getChildNodes()[i];
        if (childNode instanceof ExprDeclaredOrLambdaNode) {
            ExprDeclaredOrLambdaNode node = (ExprDeclaredOrLambdaNode) childNode;
            if (node.validated()) {
                continue;
            }
        }
        ExprNode childNodeValidated = getValidatedSubtreeInternal(childNode, validationContext, false);
        exprNode.setChildNode(i, childNodeValidated);
    }

    try {
        ExprNode optionalReplacement = exprNode.validate(validationContext);
        if (optionalReplacement != null) {
            return getValidatedSubtreeInternal(optionalReplacement, validationContext, isTopLevel);
        }
    } catch (ExprValidationException e) {
        if (exprNode instanceof ExprIdentNode) {
            ExprIdentNode identNode = (ExprIdentNode) exprNode;
            try {
                result = resolveStaticMethodOrField(identNode, e, validationContext);
            } catch (ExprValidationException ex) {
                e = ex;
                result = resolveAsStreamName(identNode, e, validationContext);
            }
        } else {
            throw e;
        }
    }

    // For top-level expressions check if we perform audit
    if (isTopLevel) {
        if (validationContext.isExpressionAudit()) {
            return (ExprNode) ExprNodeProxy.newInstance(validationContext.getStreamTypeService().getEngineURIQualifier(), validationContext.getStatementName(), result);
        }
    } else {
        if (validationContext.isExpressionNestedAudit() && !(result instanceof ExprIdentNode) && !(ExprNodeUtilityCore.isConstantValueExpr(result))) {
            return (ExprNode) ExprNodeProxy.newInstance(validationContext.getStreamTypeService().getEngineURIQualifier(), validationContext.getStatementName(), result);
        }
    }

    return result;
}
 
開發者ID:espertechinc,項目名稱:esper,代碼行數:51,代碼來源:ExprNodeUtilityRich.java

示例12: getValidatedSubtreeInternal

import com.espertech.esper.epl.enummethod.dot.ExprLambdaGoesNode; //導入依賴的package包/類
private static ExprNode getValidatedSubtreeInternal(ExprNode exprNode, ExprValidationContext validationContext, boolean isTopLevel) throws ExprValidationException
{
    ExprNode result = exprNode;
    if (exprNode instanceof ExprLambdaGoesNode) {
        return exprNode;
    }

    for (int i = 0; i < exprNode.getChildNodes().size(); i++)
    {
        ExprNode childNode = exprNode.getChildNodes().get(i);
        if (childNode instanceof ExprDeclaredOrLambdaNode) {
            ExprDeclaredOrLambdaNode node = (ExprDeclaredOrLambdaNode) childNode;
            if (node.validated()) {
                continue;
            }
        }
        ExprNode childNodeValidated = getValidatedSubtreeInternal(childNode, validationContext, false);
        exprNode.getChildNodes().set(i, childNodeValidated);
    }

    try
    {
        exprNode.validate(validationContext);
    }
    catch(ExprValidationException e)
    {
        if (exprNode instanceof ExprIdentNode)
        {
            ExprIdentNode identNode = (ExprIdentNode) exprNode;
            try
            {
                result = resolveStaticMethodOrField(identNode, e, validationContext);
            }
            catch(ExprValidationException ex)
            {
                e = ex;
                result = resolveAsStreamName(identNode, e, validationContext);
            }
        }
        else
        {
            throw e;
        }
    }

    // For top-level expressions check if we perform audit
    if (isTopLevel) {
        if (validationContext.isExpressionAudit()) {
            return (ExprNode) ExprNodeProxy.newInstance(validationContext.getStreamTypeService().getEngineURIQualifier(), validationContext.getStatementName(), result);
        }
    }
    else {
        if (validationContext.isExpressionNestedAudit() && !(result instanceof ExprIdentNode) && !(ExprNodeUtility.isConstantValueExpr(result))) {
            return (ExprNode) ExprNodeProxy.newInstance(validationContext.getStreamTypeService().getEngineURIQualifier(), validationContext.getStatementName(), result);
        }
    }
    
    return result;
}
 
開發者ID:mobile-event-processing,項目名稱:Asper,代碼行數:60,代碼來源:ExprNodeUtility.java

示例13: resolveSingleRowPluginFunc

import com.espertech.esper.epl.enummethod.dot.ExprLambdaGoesNode; //導入依賴的package包/類
public static ExprNodeUtilSingleRowMethodDesc resolveSingleRowPluginFunc(String className, String methodName, List<ExprNode> parameters, MethodResolutionService methodResolutionService, boolean allowWildcard, final EventType wildcardType, String resolvedExpression, boolean configuredAsSingleRow) throws ExprValidationException {
    Class[] paramTypes = new Class[parameters.size()];
    ExprEvaluator[] childEvals = new ExprEvaluator[parameters.size()];
    int count = 0;

    boolean allConstants = true;
    for(ExprNode childNode : parameters)
    {
        if (childNode instanceof ExprLambdaGoesNode) {
            throw new ExprValidationException("Unexpected lambda-expression encountered as parameter to UDF or static method '" + methodName + "'");
        }
        if (childNode instanceof ExprNumberSetWildcardMarker) {
            if (wildcardType == null || !allowWildcard) {
                throw new ExprValidationException("Failed to resolve wildcard parameter to a given event type");
            }
            childEvals[count] = new ExprEvaluator() {
                public Object evaluate(EventBean[] eventsPerStream, boolean isNewData, ExprEvaluatorContext context) {
                    return eventsPerStream[0].getUnderlying();
                }

                public Class getType() {
                    return wildcardType.getUnderlyingType();
                }

                public Map<String, Object> getEventType() throws ExprValidationException {
                    return null;
                }
            };
            paramTypes[count] = wildcardType.getUnderlyingType();
            allConstants = false;
            count++;
            continue;
        }
        ExprEvaluator eval = childNode.getExprEvaluator();
        childEvals[count] = eval;
        paramTypes[count] = eval.getType();
        count++;
        if (!(childNode.isConstantResult()))
        {
            allConstants = false;
        }
    }

    // Try to resolve the method
    final FastMethod staticMethod;
    Method method;
    try
    {
        method = methodResolutionService.resolveMethod(className, methodName, paramTypes);
        FastClass declaringClass = FastClass.create(Thread.currentThread().getContextClassLoader(), method.getDeclaringClass());
        staticMethod = declaringClass.getMethod(method);
    }
    catch(Exception e)
    {
        String message;
        if (configuredAsSingleRow) {
            message = e.getMessage();
        }
        else {
            message = "Failed to resolve '" + resolvedExpression + "' to a property, single-row function, script, stream or class name";
        }
        throw new ExprValidationException(message, e);
    }

    return new ExprNodeUtilSingleRowMethodDesc(allConstants, paramTypes, childEvals, method, staticMethod);
}
 
開發者ID:mobile-event-processing,項目名稱:Asper,代碼行數:67,代碼來源:ExprNodeUtility.java


注:本文中的com.espertech.esper.epl.enummethod.dot.ExprLambdaGoesNode類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。