38
38
import io .streamthoughts .kafka .connect .filepulse .expression .function .impl .Split ;
39
39
import io .streamthoughts .kafka .connect .filepulse .expression .function .impl .StartsWith ;
40
40
import io .streamthoughts .kafka .connect .filepulse .expression .function .impl .Trim ;
41
+ import io .streamthoughts .kafka .connect .filepulse .expression .function .impl .UnixTimestamp ;
41
42
import io .streamthoughts .kafka .connect .filepulse .expression .function .impl .Uppercase ;
42
43
import io .streamthoughts .kafka .connect .filepulse .expression .function .impl .Uuid ;
43
44
import org .slf4j .Logger ;
@@ -64,7 +65,7 @@ public static ExpressionFunctionExecutor resolve(final String functionName, fina
64
65
* Creates a new {@link ExpressionFunctionExecutors} instance.
65
66
*/
66
67
private ExpressionFunctionExecutors () {
67
- // TODO function registration is hard-coded
68
+ // List of built-in expression functions to register.
68
69
register (new Lowercase ());
69
70
register (new Uppercase ());
70
71
register (new Converts ());
@@ -85,6 +86,7 @@ private ExpressionFunctionExecutors() {
85
86
register (new Hash ());
86
87
register (new Md5 ());
87
88
register (new Split ());
89
+ register (new UnixTimestamp ());
88
90
}
89
91
90
92
@ SuppressWarnings ("unchecked" )
@@ -106,8 +108,9 @@ private ExpressionFunctionExecutor make(final String functionName, final Express
106
108
return new ExpressionFunctionExecutor (functionName , function , prepared );
107
109
}
108
110
109
- private void register (final ExpressionFunction function ) {
110
- LOG .info ("Registered expression function '" + function .name () + "'" );
111
+ public void register (final ExpressionFunction function ) {
112
+ Objects .requireNonNull (function , "'function' should not be null" );
113
+ LOG .info ("Registered built-in expression function '{}'" , function .name () );
111
114
functions .put (function .name (), function );
112
115
}
113
116
}
0 commit comments