Package com.pnfsoftware.jeb.core
Class ScriptMetadataParser
java.lang.Object
com.pnfsoftware.jeb.core.ScriptMetadataParser
Parser and generator of
ScriptMetadata objects.
JEB script (client scripts, plugin scripts) may start with metadata in comments to provide
valuable information to the client or back-end without requiring full parsing and compilation of
the script. The metadata is provided at the top of the source file as inline comments, before any
code appears. The inline comment format is ?key=value where key is the metadata attribute
name.
Example, in a Python script:
#?description=A description string #?shortcut=CTRL+SHIFT+K
Example, in a Java script:
//?description=A description string //?shortcut=CTRL+SHIFT+K
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ScriptMetadataExtract script metadata using the default comment prefix inferred from the file extension.static ScriptMetadataExtract script metadata from the leading comment block of a source file.
-
Constructor Details
-
ScriptMetadataParser
public ScriptMetadataParser()
-
-
Method Details
-
extract
Extract script metadata using the default comment prefix inferred from the file extension.- Parameters:
file- script source file- Returns:
- extracted metadata
- Throws:
IOException- on read error
-
extract
Extract script metadata from the leading comment block of a source file.- Parameters:
file- script source filecommentPrefix- comment prefix to use, or null to infer it from the file extension- Returns:
- extracted metadata
- Throws:
IOException- on read error
-