JCommander extension library


License

License

Categories

Categories

JCommander User Interface CLI
GroupId

GroupId

name.valery1707
ArtifactId

ArtifactId

jcommander-ext
Last Version

Last Version

0.1.13
Release Date

Release Date

Type

Type

pom
Description

Description

JCommander extension library
JCommander extension library
Project URL

Project URL

https://github.com/valery1707/jcommander-ext
Source Code Management

Source Code Management

https://github.com/valery1707/jcommander-ext

Download jcommander-ext

How to add to project

<!-- https://jarcasting.com/artifacts/name.valery1707/jcommander-ext/ -->
<dependency>
    <groupId>name.valery1707</groupId>
    <artifactId>jcommander-ext</artifactId>
    <version>0.1.13</version>
    <type>pom</type>
</dependency>
// https://jarcasting.com/artifacts/name.valery1707/jcommander-ext/
implementation 'name.valery1707:jcommander-ext:0.1.13'
// https://jarcasting.com/artifacts/name.valery1707/jcommander-ext/
implementation ("name.valery1707:jcommander-ext:0.1.13")
'name.valery1707:jcommander-ext:pom:0.1.13'
<dependency org="name.valery1707" name="jcommander-ext" rev="0.1.13">
  <artifact name="jcommander-ext" type="pom" />
</dependency>
@Grapes(
@Grab(group='name.valery1707', module='jcommander-ext', version='0.1.13')
)
libraryDependencies += "name.valery1707" % "jcommander-ext" % "0.1.13"
[name.valery1707/jcommander-ext "0.1.13"]

Dependencies

There are no dependencies for this project. It is a standalone project that does not depend on any other jars.

Project Modules

  • validator-test
  • validator-core
  • validator-number
  • validator-string
  • validator-io
  • validator-nio
  • validator

Maven Central License

Build Status Coverage Status CodeBeat badge

Waffle.io - Columns and their card count

JCommander is very good command line parsing framework for Java.

"Because life is too short to parse command line parameters" © Cédric Beust

JCommander not only can parse program arguments, it also has an extension point for validation of argument values. At the same time JCommander does not contain (at least in version 1.64) any validators.

This library is designed to correct this omission.

Validators

Some validators is ready to use, but I can't guess all useful cases and many validators designed to be useful after simple extension without any logic implementation.

Example: if you need validate argument value to be within some borders, you need only:

  1. extend class InRange
  2. create default constructor
  3. pass in super constructor required borders
  4. use your class in @Parameter#validateValueWith

Validators list:

  1. Common
    1. Range: InRange, NotInRange
    2. Collection: InCollection
  2. Number
    1. Equal: EqualTo, NotEqualTo
    2. Greater: GreaterThan, GreaterThanOrEqualTo
    3. Less: LessThan, LessThanOrEqualTo
    4. Zero-compare: EqualToZero, NotEqualToZero, GreaterThanZero, GreaterThanOrEqualToZero, LessThanZero, LessThanOrEqualToZero
  3. String
    1. Simple: NotBlank, NotEmpty
    2. Pattern based: PatternContains, PatternNotContains, PatternMatched, PatternNotMatched
  4. IO
    1. Base: Exists, NotExists
    2. File: ExistsFile, ExistsFileReadable, ExistsFileWritable, ExistsFileExecutable
    3. Directory: ExistsDirectory, ExistsDirectoryReadable, ExistsDirectoryWritable, ExistsDirectoryExecutable
  5. NIO
    1. Base: Exists, NotExists
    2. File: ExistsFile, ExistsFileReadable, ExistsFileWritable, ExistsFileExecutable
    3. Directory: ExistsDirectory, ExistsDirectoryReadable, ExistsDirectoryWritable, ExistsDirectoryExecutable
    4. Link: ExistsLink, ExistsLinkReadable, ExistsLinkWritable, ExistsLinkExecutable

Build

Build with code coverage report: clean package jacoco:report

Versions

Version
0.1.13
0.1.11
0.1.10
0.1.9
0.1.8
0.1.7
0.1.6
0.1.5
0.1.4
0.1.3
0.1.2
0.1.1
0.1.0