Skip to content

Commit bdf6e1e

Browse files
committed
Merge remote-tracking branch 'upstream/master'
2 parents c73b17a + 4933980 commit bdf6e1e

File tree

4 files changed

+44
-25
lines changed

4 files changed

+44
-25
lines changed

component/src/main/java/io/siddhi/extension/execution/regex/FindFunctionExtension.java

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
import io.siddhi.annotation.Example;
2222
import io.siddhi.annotation.Extension;
2323
import io.siddhi.annotation.Parameter;
24+
import io.siddhi.annotation.ParameterOverload;
2425
import io.siddhi.annotation.ReturnAttribute;
2526
import io.siddhi.annotation.util.DataType;
2627
import io.siddhi.core.config.SiddhiQueryContext;
@@ -41,6 +42,8 @@
4142
import java.util.regex.Pattern;
4243

4344
/**
45+
* Class representing the Regex Find implementation.
46+
*
4447
* find(regex, input.sequence)
4548
* find(regex, input.sequence, starting.index)
4649
* These methods attempts to find the next sub-sequence of the 'inputSequence' that matches the 'regex' pattern.
@@ -56,10 +59,6 @@
5659
* starting.index : INT
5760
* Return Type(s): BOOLEAN
5861
*/
59-
60-
/**
61-
* Class representing the Regex Find implementation.
62-
*/
6362
@Extension(
6463
name = "find",
6564
namespace = "regex",
@@ -68,19 +67,26 @@
6867
@Parameter(name = "regex",
6968
description = "A regular expression that is matched to a sequence in order " +
7069
"to find the subsequence of the same. For example, `\\d\\d(.*)WSO2`.",
71-
type = {DataType.STRING}),
70+
type = {DataType.STRING},
71+
dynamic = true),
7272
@Parameter(name = "input.sequence",
7373
description = "The input sequence to be matched with the regular expression. "
7474
+ "For example, `21 products are produced by WSO2`.",
75-
type = {DataType.STRING}),
75+
type = {DataType.STRING},
76+
dynamic = true),
7677
@Parameter(name = "starting.index",
7778
description = "The starting index of the input sequence from where the input sequence is" +
7879
"matched with the given regex pattern."
7980
+ "For example, `10`.",
8081
type = {DataType.INT},
8182
optional = true,
83+
dynamic = true,
8284
defaultValue = "0")
8385
},
86+
parameterOverloads = {
87+
@ParameterOverload(parameterNames = {"regex", "input.sequence"}),
88+
@ParameterOverload(parameterNames = {"regex", "input.sequence", "starting.index"})
89+
},
8490
returnAttributes = @ReturnAttribute(
8591
description = "Returns `true` if a matching subsequence is available in the input.sequence, " +
8692
"else return `false`.",

component/src/main/java/io/siddhi/extension/execution/regex/GroupFunctionExtension.java

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
import io.siddhi.annotation.Example;
2222
import io.siddhi.annotation.Extension;
2323
import io.siddhi.annotation.Parameter;
24+
import io.siddhi.annotation.ParameterOverload;
2425
import io.siddhi.annotation.ReturnAttribute;
2526
import io.siddhi.annotation.util.DataType;
2627
import io.siddhi.core.config.SiddhiQueryContext;
@@ -40,6 +41,8 @@
4041
import java.util.regex.Pattern;
4142

4243
/**
44+
* Class representing the Regex Group implementation.
45+
*
4346
* group(regex, input.sequence, group.id)
4447
* This method returns the input sub-sequence captured by the given group during the previous match operation.
4548
* regex - regular expression. eg: "\d\d(.*)WSO2"
@@ -51,10 +54,6 @@
5154
* group.id : INT
5255
* Return Type(s): STRING
5356
*/
54-
55-
/**
56-
* Class representing the Regex Group implementation.
57-
*/
5857
@Extension(
5958
name = "group",
6059
namespace = "regex",
@@ -63,14 +62,20 @@
6362
parameters = {
6463
@Parameter(name = "regex",
6564
description = "A regular expression. For example, `\\d\\d(.*)WSO2.`",
66-
type = {DataType.STRING}),
65+
type = {DataType.STRING},
66+
dynamic = true),
6767
@Parameter(name = "input.sequence",
6868
description = "The input sequence to be matched with the regular expression. "
6969
+ "For example, 2`1 products are produced by WSO2`.",
70-
type = {DataType.STRING}),
70+
type = {DataType.STRING},
71+
dynamic = true),
7172
@Parameter(name = "group.id",
7273
description = "The given group id of the regex expression. For example, `2`.",
73-
type = {DataType.INT})
74+
type = {DataType.INT},
75+
dynamic = true)
76+
},
77+
parameterOverloads = {
78+
@ParameterOverload(parameterNames = {"regex", "input.sequence", "group.id"})
7479
},
7580
returnAttributes = @ReturnAttribute(
7681
description = "The string matching the regex group.",

component/src/main/java/io/siddhi/extension/execution/regex/LookingAtFunctionExtension.java

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import io.siddhi.annotation.Example;
2323
import io.siddhi.annotation.Extension;
2424
import io.siddhi.annotation.Parameter;
25+
import io.siddhi.annotation.ParameterOverload;
2526
import io.siddhi.annotation.ReturnAttribute;
2627
import io.siddhi.annotation.util.DataType;
2728
import io.siddhi.core.config.SiddhiQueryContext;
@@ -42,6 +43,8 @@
4243
import java.util.regex.Pattern;
4344

4445
/**
46+
* Class representing the Regex LookingAt implementation.
47+
*
4548
* lookingAt(regex, input.sequence)
4649
* This method attempts to match the 'inputSequence', starting at the beginning, against the 'regex' pattern.
4750
* regex - regular expression. eg: "\d\d(.*)WSO2"
@@ -51,10 +54,6 @@
5154
* input.sequence : STRING
5255
* Return Type(s): BOOLEAN
5356
*/
54-
55-
/**
56-
* Class representing the Regex LookingAt implementation.
57-
*/
5857
@Extension(
5958
name = "lookingAt",
6059
namespace = "regex",
@@ -63,11 +62,16 @@
6362
parameters = {
6463
@Parameter(name = "regex",
6564
description = "A regular expression. For example, `\\d\\d(.*)WSO2`.",
66-
type = {DataType.STRING}),
65+
type = {DataType.STRING},
66+
dynamic = true),
6767
@Parameter(name = "input.sequence",
6868
description = "The input sequence to be matched with the regular expression. "
6969
+ "For example, `21 products are produced by WSO2`.",
70-
type = {DataType.STRING})
70+
type = {DataType.STRING},
71+
dynamic = true)
72+
},
73+
parameterOverloads = {
74+
@ParameterOverload(parameterNames = {"regex", "input.sequence"})
7175
},
7276
returnAttributes = @ReturnAttribute(
7377
description = "Returns `true` if a matching subsequence is available in the beginning of the " +

component/src/main/java/io/siddhi/extension/execution/regex/MatchesFunctionExtension.java

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import io.siddhi.annotation.Example;
2323
import io.siddhi.annotation.Extension;
2424
import io.siddhi.annotation.Parameter;
25+
import io.siddhi.annotation.ParameterOverload;
2526
import io.siddhi.annotation.ReturnAttribute;
2627
import io.siddhi.annotation.util.DataType;
2728
import io.siddhi.core.config.SiddhiQueryContext;
@@ -42,6 +43,8 @@
4243
import java.util.regex.Pattern;
4344

4445
/**
46+
* Class representing the Regex Matches implementation.
47+
*
4548
* matches(regex, input.sequence)
4649
* This method attempts to match the entire 'inputSequence' against the 'regex' pattern.
4750
* regex - regular expression. eg: "\d\d(.*)WSO2"
@@ -51,22 +54,23 @@
5154
* inputSequence : STRING
5255
* Return Type(s): BOOLEAN
5356
*/
54-
55-
/**
56-
* Class representing the Regex Matches implementation.
57-
*/
5857
@Extension(
5958
name = "matches",
6059
namespace = "regex",
6160
description = "Matches the entire input.sequence against the regex pattern.",
6261
parameters = {
6362
@Parameter(name = "regex",
6463
description = "A regular expression. For example, `\\d\\d(.*)WSO2`.",
65-
type = {DataType.STRING}),
64+
type = {DataType.STRING},
65+
dynamic = true),
6666
@Parameter(name = "input.sequence",
6767
description = "The input sequence to be matched with the regular expression. "
6868
+ "For example, `21 products are produced by WSO2`.",
69-
type = {DataType.STRING})
69+
type = {DataType.STRING},
70+
dynamic = true)
71+
},
72+
parameterOverloads = {
73+
@ParameterOverload(parameterNames = {"regex", "input.sequence"})
7074
},
7175
returnAttributes = @ReturnAttribute(
7276
description = "Returns `true` if the regex matches the entire input.sequence, else return `false`.",

0 commit comments

Comments
 (0)