Skip to content

Commit 3f621fa

Browse files
committed
Writing your own op: minor tweaks
1 parent 5177514 commit 3f621fa

1 file changed

Lines changed: 7 additions & 15 deletions

File tree

docs/ops/doc/WritingYourOwnOpPackage.md

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -284,12 +284,10 @@ At compile time, the SciJava Ops Indexer will convert each `@implNote` annotatio
284284
285285
#### Adding the SciJava Ops Indexer to your POM
286286
287-
Ops written through Javadoc are discovered by the SciJava Ops Indexer, which creates a file `ops.yaml` containing all of the data needed to import each Op you declare.
287+
Ops written through Javadoc are discovered by the SciJava Ops Indexer, which creates an `ops.yaml` file containing all of the data needed to import each Op you declare.
288288
289289
Until the SciJava Ops annotation processor is integrated into [pom-scijava](https://github.com/scijava/pom-scijava), developers must add the following block of code to the `build` section of their project POM:
290290
291-
TODO: Replace with the pom-scijava version needed to grab this annotation processor.
292-
TODO: Replace the SciJava Ops Indexer version with the correct initial version
293291
```xml
294292
<build>
295293
<plugins>
@@ -314,6 +312,7 @@ TODO: Replace the SciJava Ops Indexer version with the correct initial version
314312
</plugins>
315313
</build>
316314
```
315+
**Note:** Replace the `<version>` property with the [latest release](https://maven.scijava.org/#nexus-search;quick~scijava-ops-indexer), or omit if using a [parent pom](https://github.com/scijava/pom-scijava) managing the indexer.
317316
318317
#### Declaring Ops with the `@implNote` syntax
319318
@@ -369,7 +368,7 @@ public class MyClassOp
369368
* @param arg1 the first argument to the Op
370369
* @param arg2 the first argument to the Op
371370
* @return the result of the Op
372-
*/
371+
*/
373372
@Override
374373
public Double apply(Double arg1, Double arg2) {
375374
return null;
@@ -384,9 +383,11 @@ Note that the only supported functional interfaces that can be used without addi
384383
<dependency>
385384
<groupId>org.scijava</groupId>
386385
<artifactId>scijava-function</artifactId>
386+
<version>1.0.0</version>
387387
</dependency>
388388
</dependencies>
389389
```
390+
**Note:** Replace the `<version>` property with the [latest release](https://maven.scijava.org/#nexus-search;quick~scijava-function), or omit if using a [parent pom](https://github.com/scijava/pom-scijava) managing SciJava Function.
390391

391392
#### Declaring Ops as Fields
392393

@@ -400,7 +401,7 @@ public class MyOpCollection {
400401
* @input arg2 the second {@link Double}
401402
* @output arg2 the second {@link Double}
402403
* @implNote op names='my.op'
403-
*/
404+
*/
404405
public final BiFunction<Double, Double, Double> myFieldOp =
405406
(arg1, arg2) -> {...computation...};
406407

@@ -413,16 +414,7 @@ To describe each Op parameter, add the following tags to its javadoc:
413414
* To describe a conatiner (for a computer Op), add the Javadoc tag `@container <parameter_name> <description>`
414415
* To describe a mutable input (for an inplace Op), add the Javadoc tag `@mutable <parameter_name> <description>`
415416

416-
Note again that the only supported functional interfaces that can be used without additional dependencies are `java.util.function.Function` and `java.util.function.BiFunction` - if you'd like to write an Op requiring more than two inputs, or to write an Op that takes a pre-allocated output buffer, you'll need to depend on the SciJava Function library:
417-
418-
```xml
419-
<dependencies>
420-
<dependency>
421-
<groupId>org.scijava</groupId>
422-
<artifactId>scijava-function</artifactId>
423-
</dependency>
424-
</dependencies>
425-
```
417+
Note again that the only supported functional interfaces that can be used without additional dependencies are `java.util.function.Function` and `java.util.function.BiFunction` - if you'd like to write an Op requiring more than two inputs, or to write an Op that takes a pre-allocated output buffer, you'll need to depend on the SciJava Function library, as mentioned above.
426418

427419
### YAML
428420

0 commit comments

Comments
 (0)