本文整理汇总了Java中com.espertech.esper.pattern.guard.GuardEnum类的典型用法代码示例。如果您正苦于以下问题:Java GuardEnum类的具体用法?Java GuardEnum怎么用?Java GuardEnum使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
GuardEnum类属于com.espertech.esper.pattern.guard包,在下文中一共展示了GuardEnum类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: exitGuardPostFix
import com.espertech.esper.pattern.guard.GuardEnum; //导入依赖的package包/类
public void exitGuardPostFix(EsperEPL2GrammarParser.GuardPostFixContext ctx) {
if (ctx.getChildCount() < 2) {
return;
}
if (ctx.guardWhereExpression() == null && ctx.guardWhileExpression() == null) { // nested
return;
}
String objectNamespace;
String objectName;
List<ExprNode> obsParameters;
if (ctx.guardWhereExpression() != null) {
objectNamespace = ctx.guardWhereExpression().getChild(0).getText();
objectName = ctx.guardWhereExpression().getChild(2).getText();
obsParameters = ASTExprHelper.exprCollectSubNodes(ctx.guardWhereExpression(), 3, astExprNodeMap);
} else {
objectNamespace = GuardEnum.WHILE_GUARD.getNamespace();
objectName = GuardEnum.WHILE_GUARD.getName();
obsParameters = ASTExprHelper.exprCollectSubNodes(ctx.guardWhileExpression(), 1, astExprNodeMap);
}
PatternGuardSpec guardSpec = new PatternGuardSpec(objectNamespace, objectName, obsParameters);
EvalFactoryNode guardNode = patternNodeFactory.makeGuardNode(guardSpec);
ASTExprHelper.patternCollectAddSubnodesAddParentNode(guardNode, ctx, astPatternNodeMap);
}
示例2: leaveGuard
import com.espertech.esper.pattern.guard.GuardEnum; //导入依赖的package包/类
private void leaveGuard(Tree node) throws ASTWalkException
{
log.debug(".leaveGuard");
String objectNamespace;
String objectName;
List<ExprNode> obsParameters;
if (node.getChild(1).getType() == IDENT && node.getChild(2).getType() == IDENT) {
objectNamespace = node.getChild(1).getText();
objectName = node.getChild(2).getText();
obsParameters = ASTExprHelper.getExprNodes(node, 3, astExprNodeMap);
}
else {
objectNamespace = GuardEnum.WHILE_GUARD.getNamespace();
objectName = GuardEnum.WHILE_GUARD.getName();
obsParameters = ASTExprHelper.getExprNodes(node, 1, astExprNodeMap);
}
PatternGuardSpec guardSpec = new PatternGuardSpec(objectNamespace, objectName, obsParameters);
EvalFactoryNode guardNode = patternNodeFactory.makeGuardNode(guardSpec);
addEvalNodeExpression(guardNode, node);
}
示例3: toPrecedenceFreeEPL
import com.espertech.esper.pattern.guard.GuardEnum; //导入依赖的package包/类
public void toPrecedenceFreeEPL(StringWriter writer) {
getChildNodes().get(0).toEPL(writer, getPrecedence());
if (patternGuardSpec.getObjectNamespace().equals(GuardEnum.WHILE_GUARD.getNamespace()) &&
patternGuardSpec.getObjectName().equals(GuardEnum.WHILE_GUARD.getName())) {
writer.write(" while ");
} else {
writer.write(" where ");
writer.write(patternGuardSpec.getObjectNamespace());
writer.write(":");
writer.write(patternGuardSpec.getObjectName());
}
writer.write("(");
ExprNodeUtilityCore.toExpressionStringParameterList(patternGuardSpec.getObjectParameters(), writer);
writer.write(")");
}
示例4: toPrecedenceFreeEPL
import com.espertech.esper.pattern.guard.GuardEnum; //导入依赖的package包/类
/**
* Renders the expressions and all it's child expression, in full tree depth, as a string in
* language syntax.
* @param writer is the output to use
* @param formatter for newline-whitespace formatting
*/
public void toPrecedenceFreeEPL(StringWriter writer, EPStatementFormatter formatter) {
guarded.get(0).toEPL(writer, getPrecedence(), formatter);
if (GuardEnum.isWhile(this.getNamespace(), this.getName())) {
writer.write(" while (");
this.getParameters().get(0).toEPL(writer, ExpressionPrecedenceEnum.MINIMUM);
writer.write(")");
}
else {
writer.write(" where ");
super.toEPL(writer);
}
}
示例5: whileGuard
import com.espertech.esper.pattern.guard.GuardEnum; //导入依赖的package包/类
/**
* While-guard expression.
* @param expression expression to evaluate against matches
* @param guarded is the sub-expression to guard
* @return pattern guard
*/
public static PatternGuardExpr whileGuard(PatternExpr guarded, Expression expression)
{
return new PatternGuardExpr(GuardEnum.WHILE_GUARD.getNamespace(), GuardEnum.WHILE_GUARD.getName(), new Expression[] {expression}, guarded);
}