本文整理汇总了Java中com.espertech.esper.epl.declexpr.ExprDeclaredHelper类的典型用法代码示例。如果您正苦于以下问题:Java ExprDeclaredHelper类的具体用法?Java ExprDeclaredHelper怎么用?Java ExprDeclaredHelper使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ExprDeclaredHelper类属于com.espertech.esper.epl.declexpr包,在下文中一共展示了ExprDeclaredHelper类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: leaveEventPropertyExpr
import com.espertech.esper.epl.declexpr.ExprDeclaredHelper; //导入依赖的package包/类
private void leaveEventPropertyExpr(Tree node)
{
log.debug(".leaveEventPropertyExpr");
if (node.getChildCount() == 0)
{
throw new IllegalStateException("Empty event property expression encountered");
}
ExprNode exprNode;
String propertyName;
// The stream name may precede the event property name, but cannot be told apart from the property name:
// s0.p1 could be a nested property, or could be stream 's0' and property 'p1'
// A single entry means this must be the property name.
// And a non-simple property means that it cannot be a stream name.
if ((node.getChildCount() == 1) || (node.getChild(0).getType() != EVENT_PROP_SIMPLE))
{
propertyName = ASTFilterSpecHelper.getPropertyName(node, 0);
exprNode = new ExprIdentNodeImpl(propertyName);
Pair<String, String> mappedPropertyPair = ASTFilterSpecHelper.getMappedPropertyPair(node);
if (mappedPropertyPair != null) {
List<ExprNode> params = Collections.<ExprNode>singletonList(new ExprConstantNodeImpl(mappedPropertyPair.getSecond()));
ExprNodeScript scriptNode = ExprDeclaredHelper.getExistsScript(getDefaultDialect(), mappedPropertyPair.getFirst(), params, scriptExpressions, exprDeclaredService);
if (scriptNode != null) {
exprNode = scriptNode;
}
}
}
// --> this is more then one child node, and the first child node is a simple property
// we may have a stream name in the first simple property, or a nested property
// i.e. 's0.p0' could mean that the event has a nested property to 's0' of name 'p0', or 's0' is the stream name
else
{
String leadingIdentifier = node.getChild(0).getChild(0).getText();
String streamOrNestedPropertyName = ASTFilterSpecHelper.escapeDot(leadingIdentifier);
propertyName = ASTFilterSpecHelper.getPropertyName(node, 1);
if (variableService.getReader(leadingIdentifier) != null)
{
exprNode = new ExprVariableNodeImpl(leadingIdentifier + "." + propertyName, variableService);
statementSpec.setHasVariables(true);
addVariable(statementSpec, propertyName);
}
else if (contextDescriptor != null && contextDescriptor.getContextPropertyRegistry().isContextPropertyPrefix(streamOrNestedPropertyName)) {
exprNode = new ExprContextPropertyNode(propertyName);
}
else {
exprNode = new ExprIdentNodeImpl(propertyName, streamOrNestedPropertyName);
}
}
if (variableService.getReader(propertyName) != null)
{
exprNode = new ExprVariableNodeImpl(propertyName, variableService);
statementSpec.setHasVariables(true);
addVariable(statementSpec, propertyName);
}
astExprNodeMap.put(node, exprNode);
}