You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ac...@apache.org on 2020/07/15 17:13:09 UTC
[camel] 02/08: Code clean-up.
This is an automated email from the ASF dual-hosted git repository.
acosentino pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git
commit c6a1a8f605eec4e1aa1fa84d81e4840353da4bf3
Author: Jim MacInnes <ma...@gmail.com>
AuthorDate: Thu Jul 9 22:07:03 2020 -0700
Code clean-up.
---
.../org/apache/camel/component/jsonata/JsonataEndpoint.java | 13 ++-----------
1 file changed, 2 insertions(+), 11 deletions(-)
diff --git a/components/camel-jsonata/src/main/java/org/apache/camel/component/jsonata/JsonataEndpoint.java b/components/camel-jsonata/src/main/java/org/apache/camel/component/jsonata/JsonataEndpoint.java
index 8aca0d6..4d61695 100644
--- a/components/camel-jsonata/src/main/java/org/apache/camel/component/jsonata/JsonataEndpoint.java
+++ b/components/camel-jsonata/src/main/java/org/apache/camel/component/jsonata/JsonataEndpoint.java
@@ -74,7 +74,7 @@ public class JsonataEndpoint extends ResourceEndpoint {
}
/**
- * Specifies if the output should be hydrated JSON or a JSON String.
+ * Specifies if the output should be Jackson JsNode or a JSON String.
*/
public void setOutputType(JsonataInputOutputType outputType) {
this.outputType = outputType;
@@ -91,12 +91,6 @@ public class JsonataEndpoint extends ResourceEndpoint {
this.inputType = inputType;
}
- public JsonataEndpoint findOrCreateEndpoint(String uri, String newResourceUri) {
- String newUri = uri.replace(getResourceUri(), newResourceUri);
- log.debug("Getting endpoint with URI: {}", newUri);
- return getCamelContext().getEndpoint(newUri, JsonataEndpoint.class);
- }
-
@Override
protected void onExchange(Exchange exchange) throws Exception {
String path = getResourceUri();
@@ -110,9 +104,7 @@ public class JsonataEndpoint extends ResourceEndpoint {
input = (JsonNode)exchange.getIn().getBody();
}
- Map<String, Object> inputContextMap = null;
JsonNode output=null;
- JsonNode jsonObj = null;
if(expressions == null) {
String spec = new BufferedReader(
new InputStreamReader(getResourceAsInputStream(), StandardCharsets.UTF_8))
@@ -121,7 +113,7 @@ public class JsonataEndpoint extends ResourceEndpoint {
expressions = Expressions.parse(spec);
}
output = expressions.evaluate(input);
-
+
// now lets output the results to the exchange
Message out = exchange.getOut(); // getOut() is depricated
if (getOutputType() == JsonataInputOutputType.JsonString) {
@@ -131,5 +123,4 @@ public class JsonataEndpoint extends ResourceEndpoint {
}
out.setHeaders(exchange.getIn().getHeaders());
}
-
}