olabusayoT commented on a change in pull request #273: WIP: Add User Defined 
Functions Capability
URL: https://github.com/apache/incubator-daffodil/pull/273#discussion_r331644961
 
 

 ##########
 File path: 
daffodil-test/src/test/java/org/goodudfs/example/StringFunctions/StringFunctionsProvider.java
 ##########
 @@ -0,0 +1,25 @@
+package org.goodudfs.example.StringFunctions;
+
+import org.apache.daffodil.udf.*;
+
+public class StringFunctionsProvider extends UDFunctionProvider {
+       public StringFunctionsProvider() {
+               super.setFunctionClasses( new Class<?>[] { Replace.class, 
Compare.class } );
+       }
+
+       public Object lookupFunctionClass(String namespace, String name) {
+               Object functionClass = null;
+
+               String nn = String.join("_", namespace, name);
+
+               switch (nn) {
+               case "com.ext.UDFunction.StringFunctions_replace":
 
 Review comment:
   This is true, as long as the default value for the annotation properties 
isn't set (which they are now), and they apply the annotation without filling 
out the elements. There is no way to enforce the annotations are applied (at 
all or correctly) at UDF compile time. But if they leave it out, we'd catch it 
during our checks. So as you've stated annotations provide a wee bit more 
advantage in this respect.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to