@@ -296,6 +296,8 @@ array("foo")
296
296
# {"name":"value"} => ["name", "value"]
297
297
```
298
298
299
+ [ Example in Playground] ( https://metafacture.org/playground/?example=array )
300
+
299
301
[ Java Code] ( https://github.com/search?type=code&q=repo:metafacture/metafacture-fix+path:FixMethod.java+"+array+{" )
300
302
301
303
##### ` call_macro `
@@ -359,6 +361,8 @@ hash("foo")
359
361
# ["name", "value"] => {"name":"value"}
360
362
```
361
363
364
+ [ Example in Playground] ( https://metafacture.org/playground/?example=hash )
365
+
362
366
[ Java Code] ( https://github.com/search?type=code&q=repo:metafacture/metafacture-fix+path:FixMethod.java+"+hash+{" )
363
367
364
368
##### ` move_field `
@@ -383,6 +387,8 @@ Parses a text into an array or hash of values.
383
387
parse_text(" <sourceField>" , " <parsePattern>" )
384
388
```
385
389
390
+ [ Example in Playground] ( https://metafacture.org/playground/?example=parse_text )
391
+
386
392
[ Java Code] ( https://github.com/search?type=code&q=repo:metafacture/metafacture-fix+path:FixMethod.java+"+parse_text+{" )
387
393
388
394
##### ` paste `
@@ -453,6 +459,8 @@ Creates (or replaces) a field with a random number (less than the specified maxi
453
459
random(" <targetField>" , " <maximum>" )
454
460
```
455
461
462
+ [ Example in Playground] ( https://metafacture.org/playground/?example=random )
463
+
456
464
[ Java Code] ( https://github.com/search?type=code&q=repo:metafacture/metafacture-fix+path:FixMethod.java+"+random+{" )
457
465
458
466
##### ` remove_field `
@@ -523,6 +531,8 @@ set_hash("<targetFieldName>")
523
531
set_hash(" <targetFieldName>" , " subfieldName" : " <subfieldValue>" [, ...])
524
532
```
525
533
534
+ [ Example in Playground] ( https://metafacture.org/playground/?example=set_hash )
535
+
526
536
[ Java Code] ( https://github.com/search?type=code&q=repo:metafacture/metafacture-fix+path:FixMethod.java+"+set_hash+{" )
527
537
528
538
##### ` timestamp `
@@ -539,6 +549,8 @@ Options:
539
549
timestamp(" <targetField>" [, format: " <formatPattern>" ][, timezone: " <timezoneCode>" ][, language: " <languageCode>" ])
540
550
```
541
551
552
+ [ Example in Playground] ( https://metafacture.org/playground/?example=timestamp )
553
+
542
554
[ Java Code] ( https://github.com/search?type=code&q=repo:metafacture/metafacture-fix+path:FixMethod.java+"+timestamp+{" )
543
555
544
556
##### ` vacuum `
@@ -587,6 +599,8 @@ Counts the number of elements in an array or a hash and replaces the field value
587
599
count(" <sourceField>" )
588
600
```
589
601
602
+ [ Example in Playground] ( https://metafacture.org/playground/?example=count )
603
+
590
604
[ Java Code] ( https://github.com/search?type=code&q=repo:metafacture/metafacture-fix+path:FixMethod.java+"+count+{" )
591
605
592
606
##### ` downcase `
@@ -609,6 +623,8 @@ Only keeps field values that match the regular expression pattern. Works only wi
609
623
filter(" <sourceField>" , " <regexp>" )
610
624
```
611
625
626
+ [ Example in Playground] ( https://metafacture.org/playground/?example=filter )
627
+
612
628
[ Java Code] ( https://github.com/search?type=code&q=repo:metafacture/metafacture-fix+path:FixMethod.java+"+filter+{" )
613
629
614
630
##### ` flatten `
@@ -645,6 +661,8 @@ Returns the index position of a substring in a field and replaces the field valu
645
661
index (" <sourceField>" , " <substring>" )
646
662
```
647
663
664
+ [ Example in Playground] ( https://metafacture.org/playground/?example=index )
665
+
648
666
[ Java Code] ( https://github.com/search?type=code&q=repo:metafacture/metafacture-fix+path:FixMethod.java+"+index+{" )
649
667
650
668
##### ` isbn `
@@ -770,6 +788,8 @@ Reverses the character order of a string or the element order of an array.
770
788
reverse (" <sourceField>" )
771
789
```
772
790
791
+ [ Example in Playground] ( https://metafacture.org/playground/?example=reverse )
792
+
773
793
[ Java Code] ( https://github.com/search?type=code&q=repo:metafacture/metafacture-fix+path:FixMethod.java+"+reverse+{" )
774
794
775
795
##### ` sort_field `
@@ -806,6 +826,8 @@ Replaces a string with its substring as defined by the start position (offset) a
806
826
substring(" <sourceField>" , " <startPosition>" , " <length>" )
807
827
```
808
828
829
+ [ Example in Playground] ( https://metafacture.org/playground/?example=substring )
830
+
809
831
[ Java Code] ( https://github.com/search?type=code&q=repo:metafacture/metafacture-fix+path:FixMethod.java+"+substring+{" )
810
832
811
833
##### ` sum `
@@ -816,6 +838,8 @@ Sums numbers in an array and replaces the field value with this number.
816
838
sum(" <sourceField>" )
817
839
```
818
840
841
+ [ Example in Playground] ( https://metafacture.org/playground/?example=sum )
842
+
819
843
[ Java Code] ( https://github.com/search?type=code&q=repo:metafacture/metafacture-fix+path:FixMethod.java+"+sum+{" )
820
844
821
845
##### ` to_json `
@@ -831,6 +855,8 @@ Options:
831
855
to_json(" <sourceField>" [, pretty: " <boolean>" ][, error_string: " <errorValue>" ])
832
856
```
833
857
858
+ [ Example in Playground] ( https://metafacture.org/playground/?example=to_json )
859
+
834
860
[ Java Code] ( https://github.com/search?type=code&q=repo:metafacture/metafacture-fix+path:FixMethod.java+"+to_json+{" )
835
861
836
862
##### ` to_base64 `
@@ -841,6 +867,8 @@ Replaces the value with its Base64 encoding.
841
867
to_base64(" <sourceField>" )
842
868
```
843
869
870
+ [ Example in Playground] ( https://metafacture.org/playground/?example=to_base64 )
871
+
844
872
[ Java Code] ( https://github.com/search?type=code&q=repo:metafacture/metafacture-fix+path:FixMethod.java+"+to_base64+{" )
845
873
846
874
##### ` trim `
@@ -898,6 +926,8 @@ E.g.:
898
926
uri_encode(" path.to.field" , plus_for_space:" false" , safe_chars:" " )
899
927
```
900
928
929
+ [ Example in Playground] ( https://metafacture.org/playground/?example=uri_encode )
930
+
901
931
[ Java Code] ( https://github.com/search?type=code&q=repo:metafacture/metafacture-fix+path:FixMethod.java+"+uri_encode+{" )
902
932
903
933
### Selectors
948
978
949
979
Iterates over each _ named_ element of an array (like [ ` do list ` ] ( #do-list ) with a variable name). If multiple arrays are given, iterates over the _ corresponding_ elements from each array (i.e., all elements with the same array index, skipping elements whose arrays have already been exhausted).
950
980
981
+ [ Example in Playground] ( https://metafacture.org/playground/?example=do+list_as )
982
+
951
983
[ Java Code] ( https://github.com/search?type=code&q=repo:metafacture/metafacture-fix+path:FixBind.java+"+list_as+{" )
952
984
953
985
``` perl
@@ -1059,24 +1091,32 @@ end
1059
1091
1060
1092
Executes the functions if/unless the field contains the value. If it is an array or a hash all field values must contain the string.
1061
1093
1094
+ [ Example in Playground] ( https://metafacture.org/playground/?example=all_contain )
1095
+
1062
1096
[ Java Code] ( https://github.com/search?type=code&q=repo:metafacture/metafacture-fix+path:FixConditional.java+"+all_contain+{" )
1063
1097
1064
1098
##### ` any_contain `
1065
1099
1066
1100
Executes the functions if/unless the field contains the value. If it is an array or a hash one or more field values must contain the string.
1067
1101
1102
+ [ Example in Playground] ( https://metafacture.org/playground/?example=any_contain )
1103
+
1068
1104
[ Java Code] ( https://github.com/search?type=code&q=repo:metafacture/metafacture-fix+path:FixConditional.java+"+any_contain+{" )
1069
1105
1070
1106
##### ` none_contain `
1071
1107
1072
1108
Executes the functions if/unless the field does not contain the value. If it is an array or a hash none of the field values may contain the string.
1073
1109
1110
+ [ Example in Playground] ( https://metafacture.org/playground/?example=none_contain )
1111
+
1074
1112
[ Java Code] ( https://github.com/search?type=code&q=repo:metafacture/metafacture-fix+path:FixConditional.java+"+none_contain+{" )
1075
1113
1076
1114
##### ` str_contain `
1077
1115
1078
1116
Executes the functions if/unless the first string contains the second string.
1079
1117
1118
+ [ Example in Playground] ( https://metafacture.org/playground/?example=str_contain )
1119
+
1080
1120
[ Java Code] ( https://github.com/search?type=code&q=repo:metafacture/metafacture-fix+path:FixConditional.java+"+str_contain+{" )
1081
1121
1082
1122
#### ` equal `
@@ -1085,24 +1125,32 @@ Executes the functions if/unless the first string contains the second string.
1085
1125
1086
1126
Executes the functions if/unless the field value equals the string. If it is an array or a hash all field values must equal the string.
1087
1127
1128
+ [ Example in Playground] ( https://metafacture.org/playground/?example=all_equal )
1129
+
1088
1130
[ Java Code] ( https://github.com/search?type=code&q=repo:metafacture/metafacture-fix+path:FixConditional.java+"+all_equal+{" )
1089
1131
1090
1132
##### ` any_equal `
1091
1133
1092
1134
Executes the functions if/unless the field value equals the string. If it is an array or a hash one or more field values must equal the string.
1093
1135
1136
+ [ Example in Playground] ( https://metafacture.org/playground/?example=any_equal )
1137
+
1094
1138
[ Java Code] ( https://github.com/search?type=code&q=repo:metafacture/metafacture-fix+path:FixConditional.java+"+any_equal+{" )
1095
1139
1096
1140
##### ` none_equal `
1097
1141
1098
1142
Executes the functions if/unless the field value does not equal the string. If it is an array or a hash none of the field values may equal the string.
1099
1143
1144
+ [ Example in Playground] ( https://metafacture.org/playground/?example=none_equal )
1145
+
1100
1146
[ Java Code] ( https://github.com/search?type=code&q=repo:metafacture/metafacture-fix+path:FixConditional.java+"+none_equal+{" )
1101
1147
1102
1148
##### ` str_equal `
1103
1149
1104
1150
Executes the functions if/unless the first string equals the second string.
1105
1151
1152
+ [ Example in Playground] ( https://metafacture.org/playground/?example=str_equal )
1153
+
1106
1154
[ Java Code] ( https://github.com/search?type=code&q=repo:metafacture/metafacture-fix+path:FixConditional.java+"+str_equal+{" )
1107
1155
1108
1156
#### ` exists `
@@ -1112,6 +1160,9 @@ Executes the functions if/unless the field exists.
1112
1160
``` perl
1113
1161
if exists (" <sourceField>" )
1114
1162
```
1163
+
1164
+ [ Example in Playground] ( https://metafacture.org/playground/?example=exists )
1165
+
1115
1166
[ Java Code] ( https://github.com/search?type=code&q=repo:metafacture/metafacture-fix+path:FixConditional.java+"+exists+{" )
1116
1167
1117
1168
#### ` in `
@@ -1120,6 +1171,8 @@ Executes the functions if/unless the field value [is contained in](https://perld
1120
1171
1121
1172
_ Also aliased as [ ` is_contained_in ` ] ( #is_contained_in ) ._
1122
1173
1174
+ [ Example in Playground] ( https://metafacture.org/playground/?example=in )
1175
+
1123
1176
[ Java Code] ( https://github.com/search?type=code&q=repo:metafacture/metafacture-fix+path:FixConditional.java+"+in+{" )
1124
1177
1125
1178
#### ` is_contained_in `
@@ -1130,30 +1183,40 @@ _Alias for [`in`](#in)._
1130
1183
1131
1184
Executes the functions if/unless the field value is an array.
1132
1185
1186
+ [ Example in Playground] ( https://metafacture.org/playground/?example=is_array )
1187
+
1133
1188
[ Java Code] ( https://github.com/search?type=code&q=repo:metafacture/metafacture-fix+path:FixConditional.java+"+is_array+{" )
1134
1189
1135
1190
#### ` is_empty `
1136
1191
1137
1192
Executes the functions if/unless the field value is empty.
1138
1193
1194
+ [ Example in Playground] ( https://metafacture.org/playground/?example=is_empty )
1195
+
1139
1196
[ Java Code] ( https://github.com/search?type=code&q=repo:metafacture/metafacture-fix+path:FixConditional.java+"+is_empty+{" )
1140
1197
1141
1198
#### ` is_false `
1142
1199
1143
1200
Executes the functions if/unless the field value equals ` false ` or ` 0 ` .
1144
1201
1202
+ [ Example in Playground] ( https://metafacture.org/playground/?example=is_false )
1203
+
1145
1204
[ Java Code] ( https://github.com/search?type=code&q=repo:metafacture/metafacture-fix+path:FixConditional.java+"+is_false+{" )
1146
1205
1147
1206
#### ` is_hash `
1148
1207
1149
1208
_ Alias for [ ` is_object ` ] ( #is_object ) ._
1150
1209
1210
+ [ Example in Playground] ( https://metafacture.org/playground/?example=is_hash )
1211
+
1151
1212
[ Java Code] ( https://github.com/search?type=code&q=repo:metafacture/metafacture-fix+path:FixConditional.java+"+is_hash+{" )
1152
1213
1153
1214
#### ` is_number `
1154
1215
1155
1216
Executes the functions if/unless the field value is a number.
1156
1217
1218
+ [ Example in Playground] ( https://metafacture.org/playground/?example=is_number )
1219
+
1157
1220
[ Java Code] ( https://github.com/search?type=code&q=repo:metafacture/metafacture-fix+path:FixConditional.java+"+is_number+{" )
1158
1221
1159
1222
#### ` is_object `
@@ -1166,12 +1229,16 @@ _Also aliased as [`is_hash`](#is_hash)._
1166
1229
1167
1230
Executes the functions if/unless the field value is a string (and not a number).
1168
1231
1232
+ [ Example in Playground] ( https://metafacture.org/playground/?example=is_string )
1233
+
1169
1234
[ Java Code] ( https://github.com/search?type=code&q=repo:metafacture/metafacture-fix+path:FixConditional.java+"+is_string+{" )
1170
1235
1171
1236
#### ` is_true `
1172
1237
1173
1238
Executes the functions if/unless the field value equals ` true ` or ` 1 ` .
1174
1239
1240
+ [ Example in Playground] ( https://metafacture.org/playground/?example=is_true )
1241
+
1175
1242
[ Java Code] ( https://github.com/search?type=code&q=repo:metafacture/metafacture-fix+path:FixConditional.java+"+is_true+{" )
1176
1243
1177
1244
@@ -1181,24 +1248,32 @@ Executes the functions if/unless the field value equals `true` or `1`.
1181
1248
1182
1249
Executes the functions if/unless the field value matches the regular expression pattern. If it is an array or a hash all field values must match the regular expression pattern.
1183
1250
1251
+ [ Example in Playground] ( https://metafacture.org/playground/?example=all_match )
1252
+
1184
1253
[ Java Code] ( https://github.com/search?type=code&q=repo:metafacture/metafacture-fix+path:FixConditional.java+"+all_match+{" )
1185
1254
1186
1255
##### ` any_match `
1187
1256
1188
1257
Executes the functions if/unless the field value matches the regular expression pattern. If it is an array or a hash one or more field values must match the regular expression pattern.
1189
1258
1259
+ [ Example in Playground] ( https://metafacture.org/playground/?example=any_match )
1260
+
1190
1261
[ Java Code] ( https://github.com/search?type=code&q=repo:metafacture/metafacture-fix+path:FixConditional.java+"+any_match+{" )
1191
1262
1192
1263
##### ` none_match `
1193
1264
1194
1265
Executes the functions if/unless the field value does not match the regular expression pattern. If it is an array or a hash none of the field values may match the regular expression pattern.
1195
1266
1267
+ [ Example in Playground] ( https://metafacture.org/playground/?example=none_match )
1268
+
1196
1269
[ Java Code] ( https://github.com/search?type=code&q=repo:metafacture/metafacture-fix+path:FixConditional.java+"+none_match+{" )
1197
1270
1198
1271
##### ` str_match `
1199
1272
1200
1273
Executes the functions if/unless the string matches the regular expression pattern.
1201
1274
1275
+ [ Example in Playground] ( https://metafacture.org/playground/?example=str_match )
1276
+
1202
1277
[ Java Code] ( https://github.com/search?type=code&q=repo:metafacture/metafacture-fix+path:FixConditional.java+"+str_match+{" )
1203
1278
1204
1279
## Xtext
0 commit comments