本文整理了Java中org.wso2.siddhi.annotation.Example
类的一些代码示例,展示了Example
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Example
类的具体详情如下:
包路径:org.wso2.siddhi.annotation.Example
类名称:Example
暂无
代码示例来源:origin: org.wso2.extension.siddhi.map.keyvalue/siddhi-map-keyvalue
"with which the messages can be published.",
examples = {
@Example(
syntax = "@sink(type='inMemory', topic='stock', @map(type='keyvalue'))\n"
+ "define stream FooStream (symbol string, price float, volume long);\n",
),
@Example(
syntax = "@sink(type='inMemory', topic='stock', @map(type='keyvalue', "
+ "@payload(a='symbol',b='price',c='volume')))\n"
),
@Example(
syntax = "@sink(type='inMemory', topic='stock', @map(type='keyvalue', "
+ "@payload(a='{{symbol}} is here',b='`price`',c='volume')))\n"
代码示例来源:origin: wso2/siddhi
/**
* This method uses for validate @Extension / @Example elements.
*
* @param examples examples array which needs to be validate.
* @throws AnnotationValidationException whenever if the validate rule violate, throws the annotation validate
* exception with proper message.
*/
public void examplesValidation(Example[] examples) throws AnnotationValidationException {
//Check if the @Example annotated in all the @Extension classes.
if (examples.length == 0) {
throw new AnnotationValidationException(MessageFormat.format("The @Extension -> @Example " +
"annotated in class {0} is null or empty.", extensionClassFullName));
} else {
for (Example example : examples) {
//Check if the @Example syntax is empty.
if (example.syntax().isEmpty()) {
throw new AnnotationValidationException(MessageFormat.format("The @Extension -> " +
"@Example -> syntax annotated in class {0} is null or empty.", extensionClassFullName));
}
//Check if the @Example description is empty.
if (example.description().isEmpty()) {
throw new AnnotationValidationException(MessageFormat.format("The @Extension -> " +
"@Example -> description annotated in class {0} is null or empty.",
extensionClassFullName));
}
}
}
}
}
代码示例来源:origin: org.wso2.extension.siddhi.map.wso2event/siddhi-map-wso2event
@Example(
syntax = "@source(type=’wso2event’, @map(type=’wso2event’) " +
"define stream FooStream (meta_timestamp long, symbol string, price float, " +
" payloadData: [symbol, price, volume]\n" +
" }\n"),
@Example(
syntax = "@source(type=’wso2event’, @map(type=’wso2event’, " +
"@attributes(" +
代码示例来源:origin: org.wso2.siddhi/siddhi-annotations
/**
* This method uses for validate @Extension / @Example elements.
*
* @param examples examples array which needs to be validate.
* @throws AnnotationValidationException whenever if the validate rule violate, throws the annotation validate
* exception with proper message.
*/
public void examplesValidation(Example[] examples) throws AnnotationValidationException {
//Check if the @Example annotated in all the @Extension classes.
if (examples.length == 0) {
throw new AnnotationValidationException(MessageFormat.format("The @Extension -> @Example " +
"annotated in class {0} is null or empty.", extensionClassFullName));
} else {
for (Example example : examples) {
//Check if the @Example syntax is empty.
if (example.syntax().isEmpty()) {
throw new AnnotationValidationException(MessageFormat.format("The @Extension -> " +
"@Example -> syntax annotated in class {0} is null or empty.", extensionClassFullName));
}
//Check if the @Example description is empty.
if (example.description().isEmpty()) {
throw new AnnotationValidationException(MessageFormat.format("The @Extension -> " +
"@Example -> description annotated in class {0} is null or empty.",
extensionClassFullName));
}
}
}
}
}
代码示例来源:origin: org.wso2.extension.siddhi.map.wso2event/siddhi-map-wso2event
"parameters need to be configured (i.e., in addition to the format type).\n",
examples = {
@Example(
syntax = "`@sink(type='wso2event', @map(type='wso2event')); `" +
"`define stream FooStream (symbol string, price float, volume long);`",
" }\n"),
@Example(
syntax = "@sink(type='wso2event', " +
"@map(type='wso2event'," +
代码示例来源:origin: org.wso2.carbon.analytics/org.wso2.carbon.siddhi.editor.core
String examples[] = new String[extensionAnnotation.examples().length];
for (int i = 0; i < extensionAnnotation.examples().length; i++) {
examples[i] = "syntax: " + extensionAnnotation.examples()[i].syntax() + "\n" +
"description: " + extensionAnnotation.examples()[i].description();
代码示例来源:origin: org.wso2.siddhi/siddhi-extension-text-output-mapper
namespace = "sinkMapper",
description = "Event to Text output mapper.",
examples = @Example(description = "TBD", syntax = "TBD")
代码示例来源:origin: org.wso2.siddhi/siddhi-extension-kafka-output-transport
namespace = "sink",
description = "TBD",
examples = @Example(description = "TBD", syntax = "TBD")
代码示例来源:origin: org.wso2.extension.siddhi.execution.unique/siddhi-execution-unique
},
examples = {
@Example(
syntax = "define stream LoginEvents (timeStamp long, ip string) ;\n" +
"from LoginEvents#window.unique:ever(ip)\n" +
@Example(
syntax = "define stream LoginEvents (timeStamp long, ip string , id string) ;\n" +
"from LoginEvents#window.unique:ever(ip, id)\n" +
代码示例来源:origin: org.wso2.analytics.apim/siddhi-io-mgwfile
@Example(
syntax = " ",
description = " "
代码示例来源:origin: org.wso2.extension.siddhi.execution.time/siddhi-execution-time
type = {DataType.STRING}),
examples = {
@Example(
syntax = "define stream InputStream (symbol string, price long, volume long);" +
"from InputStream " +
代码示例来源:origin: org.wso2.extension.siddhi.execution.time/siddhi-execution-time
type = {DataType.STRING}),
examples = {
@Example(
syntax = "define stream InputStream (symbol string, price long, volume long);\n" +
"from InputStream select symbol , time:currentTime() as currentTime\n" +
代码示例来源:origin: org.wso2.extension.siddhi.execution.time/siddhi-execution-time
type = {DataType.STRING}),
examples = {
@Example(
syntax = "define stream InputStream (symbol string, price long, volume long);\n" +
"from InputStream select symbol , time:currentDate() as currentTime \n" +
代码示例来源:origin: org.wso2.extension.siddhi.execution.time/siddhi-execution-time
type = {DataType.STRING}),
examples = {
@Example(
syntax = "define stream InputStream (symbol string, price long, volume long);\n" +
"from InputStream " +
代码示例来源:origin: org.wso2.extension.siddhi.execution.unique/siddhi-execution-unique
},
examples = {
@Example(
syntax = "define stream LoginEvents (timeStamp long, ip string);\n" +
"from LoginEvents#window.unique:first(ip)\n" +
代码示例来源:origin: org.wso2.extension.siddhi.execution.unique/siddhi-execution-unique
},
examples = {
@Example(
syntax = "define window CseEventWindow (symbol string, price float, volume int) " +
"from CseEventStream#window.unique:firstLengthBatch(symbol, 10)\n" +
代码示例来源:origin: org.wso2.extension.siddhi.execution.time/siddhi-execution-time
type = {DataType.LONG}),
examples = {
@Example(
syntax = "define stream InputStream (symbol string, price long, volume long);\n" +
"from InputStream\n" +
),
@Example(
syntax = "define stream InputStream (symbol string, price long, volume long);\n" +
"from InputStream\n" +
代码示例来源:origin: org.wso2.extension.siddhi.execution.unitconversion/siddhi-execution-unitconversion
description = "The value that is returned in microseconds.",
type = {DataType.DOUBLE}),
examples = @Example(
syntax = "define stream UnitConversionForSecondToMicrosecondStream (inValue int); \n" +
"from UnitConversionForSecondToMicrosecondStream \n" +
代码示例来源:origin: org.wso2.extension.siddhi.execution.unitconversion/siddhi-execution-unitconversion
description = "The value that is returned in grams.",
type = {DataType.DOUBLE}),
examples = @Example(
syntax = "define stream UnitConversionForKilogramToGramStream (inValue int); \n" +
"from UnitConversionForKilogramToGramStream \n" +
代码示例来源:origin: org.wso2.extension.siddhi.execution.unitconversion/siddhi-execution-unitconversion
description = "The value that is returned in inches.",
type = {DataType.DOUBLE}),
examples = @Example(
syntax = "define stream UnitConversionForCentimetreToInchStream (inValue int); \n" +
"from UnitConversionForCentimetreToInchStream \n" +
内容来源于网络,如有侵权,请联系作者删除!