- java.lang.Object
-
- org.scijava.ops.parser.OpParser
-
public final class OpParser extends Object
Entry point for parsing external libraries to ops (viamain(java.lang.String...)).
Expected YAML structure is:- namespace:String # Optional string for aliasing methods to "namespace.methodName"
- version:String # Optional version number for versioning input YAML
- authors:String|List #Optional one or more authors to apply to all ops
- class:(Op map) # One or more. Map of class name containing op methods to
a map of method names within that class. Supported fields for each method
include:
- priority:String # Optional priority for Ops of this method
- description:String # Optional description for Ops of this method
- authors:String|List # Optional, as global list, but per-method list takes precedence
- type:String # Optional SciJava Ops type shorthand (e.g. Computer2). If omitted, Ops for this method are assumed to be functions.
- alias:String|List # Optional, one or more names for the Ops to be aliased under. This is in addition to the namespace aliasing. If omitted, defaults to 'ext.Method'
- Author:
- Mark Hiner
-
-
Constructor Summary
Constructors Constructor Description OpParser()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidmain(String... args)static StringparseOpDocument(String inputYamlPath)Performs the actual parsing logic
-
-
-
Method Detail
-
main
public static void main(String... args) throws ClassNotFoundException
- Parameters:
args- One argument is required: path to a YAML file containing Op information to wrap.- Throws:
ClassNotFoundException- If any of the indicated classes to be wrapped as ops are not found.
-
parseOpDocument
public static String parseOpDocument(String inputYamlPath) throws ClassNotFoundException
Performs the actual parsing logic- Parameters:
inputYamlPath- YAML file to parse- Returns:
- A string representation of the resulting YAML Op configuration
- Throws:
ClassNotFoundException
-
-