davsclaus commented on code in PR #7715:
URL: https://github.com/apache/camel/pull/7715#discussion_r888615011


##########
core/camel-core-model/src/main/java/org/apache/camel/model/language/JqExpression.java:
##########
@@ -0,0 +1,115 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.model.language;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlTransient;
+
+import org.apache.camel.spi.Metadata;
+
+/**
+ * Evaluates a JQ expression.
+ */
+@Metadata(firstVersion = "3.18.0", label = "language", title = "Jq")
+@XmlRootElement(name = "jq")
+@XmlAccessorType(XmlAccessType.FIELD)
+public class JqExpression extends ExpressionDefinition {
+    @XmlAttribute(name = "resultType")
+    private String resultTypeName;
+    @XmlTransient
+    private Class<?> resultType;
+
+    @XmlAttribute
+    @Metadata(label = "advanced", defaultValue = "true", javaType = 
"java.lang.Boolean")
+    private String autoDiscoverFunctionsFromServiceLoader;
+    @XmlAttribute
+    @Metadata(label = "advanced", defaultValue = "true", javaType = 
"java.lang.Boolean")
+    private String autoDiscoverFunctionsFromJq;
+    @XmlAttribute
+    @Metadata(label = "advanced", defaultValue = "true", javaType = 
"java.lang.Boolean")
+    private String autoDiscoverFunctionsFromRegistry;
+
+    public JqExpression() {
+    }
+
+    public JqExpression(String expression) {
+        super(expression);
+    }
+
+    @Override
+    public String getLanguage() {
+        return "jq";
+    }
+
+    public String getResultTypeName() {
+        return resultTypeName;
+    }
+
+    /**
+     * Sets the class of the result type (type from output)
+     */
+    public void setResultTypeName(String resultTypeName) {
+        this.resultTypeName = resultTypeName;
+    }
+
+    public Class<?> getResultType() {
+        return resultType;
+    }
+
+    /**
+     * Sets the class name of the result type (type from output)
+     */
+    public void setResultType(Class<?> resultType) {
+        this.resultType = resultType;
+    }
+
+    public String isAutoDiscoverFunctionsFromServiceLoader() {
+        return autoDiscoverFunctionsFromServiceLoader;
+    }
+
+    /**
+     * Set if JQ functions should be discovered using the {@link 
java.util.ServiceLoader} mechanism.
+     */
+    public void setAutoDiscoverFunctionsFromServiceLoader(String 
autoDiscoverFunctionsFromServiceLoader) {
+        this.autoDiscoverFunctionsFromServiceLoader = 
autoDiscoverFunctionsFromServiceLoader;
+    }
+
+    public String isAutoDiscoverFunctionsFromJq() {
+        return autoDiscoverFunctionsFromJq;
+    }
+
+    /**
+     * Set if JQ functions should be discovered from JQ's json file.

Review Comment:
   What does this mean? Maybe the doc page should have more details? For users 
that dont know JQ to well. Does it mean you can have built-in functions in a JQ 
script file?



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to