Skip to content

Commit 8761d98

Browse files
committed
Add flux annotations
See #382.
1 parent db8f5a1 commit 8761d98

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

metafacture-json/src/main/java/org/metafacture/json/JsonDecoder.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2017 hbz
2+
* Copyright 2017, 2021 hbz
33
*
44
* Licensed under the Apache License, Version 2.0 the "License";
55
* you may not use this file except in compliance with the License.
@@ -22,8 +22,12 @@
2222
import com.fasterxml.jackson.databind.ObjectMapper;
2323
import com.jayway.jsonpath.JsonPath;
2424

25+
import org.metafacture.framework.FluxCommand;
2526
import org.metafacture.framework.MetafactureException;
2627
import org.metafacture.framework.StreamReceiver;
28+
import org.metafacture.framework.annotations.Description;
29+
import org.metafacture.framework.annotations.In;
30+
import org.metafacture.framework.annotations.Out;
2731
import org.metafacture.framework.helpers.DefaultObjectPipe;
2832

2933
import java.io.IOException;
@@ -37,6 +41,11 @@
3741
* @author Jens Wille
3842
*
3943
*/
44+
@Description("Decodes JSON to metadata events. The \'setRecordPath\' option can be used to set a JsonPath "
45+
+ "to extract a path as JSON - or to split the data into multiple JSON documents.")
46+
@In(String.class)
47+
@Out(StreamReceiver.class)
48+
@FluxCommand("decode-json")
4049
public final class JsonDecoder extends DefaultObjectPipe<String, StreamReceiver> {
4150

4251
public static final String DEFAULT_ARRAY_MARKER = JsonEncoder.ARRAY_MARKER;

0 commit comments

Comments
 (0)