Class StencilArgsParser
- java.lang.Object
-
- io.github.erdos.stencil.standalone.StencilArgsParser
-
public final class StencilArgsParser extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description static ArgsParser.ParamMarker<java.io.File>
JOBS_FILE
A file that contains job data.static ArgsParser.ParamMarker<java.lang.Boolean>
JOBS_FROM_STDIN
static ArgsParser.ParamMarker<java.lang.Boolean>
ONLY_INLCUDES
Only evaluate fragment include directives.static ArgsParser.ParamMarker<java.io.File>
OUTPUT_DIR
Result files are placed in this directory.static ArgsParser.ParamMarker<java.lang.Boolean>
OVERWRITE
Result files will be overwritten when already exist in target directory.static ArgsParser
PARSER
static ArgsParser.ParamMarker<java.lang.Boolean>
SHOW_HELP
Should display help message.static ArgsParser.ParamMarker<java.lang.Boolean>
SHOW_VERSION
Should display version info.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.Boolean
getOnlyIncludes(ArgsParser.ParseResult result)
If specified, only inlclude directives will be evaluated in template.static java.io.File
getOutputDirectory(ArgsParser.ParseResult result)
Finds output directory in parsed parameters or returns current working directory.static java.lang.Boolean
getOutputOverwritten(ArgsParser.ParseResult result)
Finds output directory in parsed parameters or returns current working directory.static ArgsParser.ParseResult
parse(java.lang.String... args)
-
-
-
Field Detail
-
PARSER
public static final ArgsParser PARSER
-
OUTPUT_DIR
public static final ArgsParser.ParamMarker<java.io.File> OUTPUT_DIR
Result files are placed in this directory.
-
OVERWRITE
public static final ArgsParser.ParamMarker<java.lang.Boolean> OVERWRITE
Result files will be overwritten when already exist in target directory.
-
SHOW_HELP
public static final ArgsParser.ParamMarker<java.lang.Boolean> SHOW_HELP
Should display help message.
-
SHOW_VERSION
public static final ArgsParser.ParamMarker<java.lang.Boolean> SHOW_VERSION
Should display version info.
-
ONLY_INLCUDES
public static final ArgsParser.ParamMarker<java.lang.Boolean> ONLY_INLCUDES
Only evaluate fragment include directives.
-
JOBS_FILE
public static final ArgsParser.ParamMarker<java.io.File> JOBS_FILE
A file that contains job data.
-
JOBS_FROM_STDIN
public static final ArgsParser.ParamMarker<java.lang.Boolean> JOBS_FROM_STDIN
-
-
Method Detail
-
parse
public static ArgsParser.ParseResult parse(java.lang.String... args)
-
getOutputDirectory
public static java.io.File getOutputDirectory(ArgsParser.ParseResult result)
Finds output directory in parsed parameters or returns current working directory.- Returns:
- output directory where rendered files will be put
- Throws:
java.lang.NullPointerException
- if param is nulljava.lang.IllegalArgumentException
- if output file path does not exist or is not a directory
-
getOutputOverwritten
public static java.lang.Boolean getOutputOverwritten(ArgsParser.ParseResult result)
Finds output directory in parsed parameters or returns current working directory.- Returns:
- should resulting files override existing files?
- Throws:
java.lang.NullPointerException
- if param is null
-
getOnlyIncludes
public static java.lang.Boolean getOnlyIncludes(ArgsParser.ParseResult result)
If specified, only inlclude directives will be evaluated in template.- Returns:
- default false
- Throws:
java.lang.NullPointerException
- if param is null
-
-