@Override public StringBuilder visitDefinition_stream(@NotNull SiddhiQLParser.Definition_streamContext ctx) { StringBuilder streamText = new StringBuilder(" {\"Stream\": "); streamText.append(" [{ \"streamId\":\"").append(ctx.source().stream_id().getText()).append("\" ,"); String stream_Text = excapeCode(tokenStreamRewriter.getTokenStream().getText(ctx.getStart(), ctx.getStop())); streamText.append(" \"stream_Text\":\"").append(stream_Text).append("\" ,"); if (ctx.annotation().isEmpty()) { streamText.append(" \"annoName\": ").append("null").append(" ,"); streamText.append(" \"annoElement\": ").append("null").append(" ,"); } else { for (SiddhiQLParser.AnnotationContext annotationContext : ctx.annotation()) { streamText.append(" \"annoName\":\"").append(annotationContext.name().getText()).append("\" ,"); if (annotationContext.annotation_element().isEmpty()) { streamText.append(" \"annoElement\": ").append("null").append(" ,"); } else { for (SiddhiQLParser.Annotation_elementContext elementContext : annotationContext.annotation_element()) { streamText.append(" \"annoElement\":\"").append(elementContext.property_value().getText()).append("\" ,"); } } } } streamText = new StringBuilder(streamText.substring(0, streamText.length() - 1)); streamText.append(" }]}"); return streamText; }
@Override public StringBuilder visitPlan_annotation(@NotNull SiddhiQLParser.Plan_annotationContext ctx) { StringBuilder annotation = new StringBuilder(" { "); for (SiddhiQLParser.Annotation_elementContext elementContext : ctx.annotation_element()) { annotation.append(" \"plan_annoElement\":\"").append(elementContext.property_value().string_value().getText()).append("\" ,"); } annotation = new StringBuilder(annotation.substring(0, annotation.length() - 1)); annotation.append("}"); return annotation; }
@Override public StringBuilder visitQuery(@NotNull SiddhiQLParser.QueryContext ctx) { StringBuilder queryText = new StringBuilder(" { \"Query\": [{ "); if (ctx.annotation().isEmpty()) { queryText.append(" \"annotationElement\":\"").append("query").append("\","); } else { queryText.append("\"annotationElement\":\"").append(ctx.annotation().get(0).annotation_element().get(0).property_value().getText()).append("\","); } queryText.append("\"inputStream\":").append(visit(ctx.query_input())).append(","); if (ctx.query_section() != null) { queryText.append("\"selection\":\"").append(ctx.query_section().getText()).append("\","); } queryText.append("\"outputStream\":").append(visit(ctx.query_output())).append(","); String q_Text = excapeCode(tokenStreamRewriter.getTokenStream().getText(ctx.getStart(), ctx.getStop())); queryText.append("\"query_Text\":\"").append(q_Text).append("\","); queryText = new StringBuilder(queryText.substring(0, queryText.length() - 1)); queryText.append(" }]}"); return queryText; }
public final Property_valueContext property_value() throws RecognitionException { Property_valueContext _localctx = new Property_valueContext(_ctx, getState()); enterRule(_localctx, 218, RULE_property_value); try { enterOuterAlt(_localctx, 1); { setState(1487); string_value(); } } catch (RecognitionException re) { _localctx.exception = re; _errHandler.reportError(this, re); _errHandler.recover(this, re); } finally { exitRule(); } return _localctx; }
public String_valueContext string_value() { return getRuleContext(String_valueContext.class,0); } public Property_valueContext(ParserRuleContext parent, int invokingState) {