Package net.emustudio.edigen.ui
Class Argument
- java.lang.Object
-
- net.emustudio.edigen.ui.Argument
-
public class Argument extends java.lang.ObjectA command line argument specification.This does not represent a specific argument instance obtained from the user, but information about the possible argument, like his name and description.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classArgument.TypeAn argument type.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetDescription()Returns the description used in the help text.SettinggetKey()Returns the key to which the recognized value will be later assigned.java.lang.StringgetOption()Returns the option name, e.g.Argument.TypegetType()Returns the argument type.java.lang.StringgetValue()Returns the value name suitable for printing in a help text, e.g.
-
-
-
Constructor Detail
-
Argument
public Argument(java.lang.String description, Setting key)Constructs an unnamed mandatory argument.- Parameters:
description- the description used in the help textkey- the key to which the recognized value will be later assigned
-
Argument
public Argument(java.lang.String option, java.lang.String description, Setting key)Constructs a flag or a value argument.- Parameters:
option- the option name, e.g. "o" for "-o"description- the description used in the help textkey- the key to which the recognized value will be later assigned
-
-
Method Detail
-
getType
public Argument.Type getType()
Returns the argument type.- Returns:
- the type
-
getOption
public java.lang.String getOption()
Returns the option name, e.g. "o" for "-o"- Returns:
- the option name, or an empty string if the argument is unnamed
-
getValue
public java.lang.String getValue()
Returns the value name suitable for printing in a help text, e.g.<directory>. The value is automatically extracted from the description.- Returns:
- the value including the brackets;
<value>in case of extraction failure for a mandatory argument; an empty string for a flag
-
getDescription
public java.lang.String getDescription()
Returns the description used in the help text.- Returns:
- the description
-
getKey
public Setting getKey()
Returns the key to which the recognized value will be later assigned.- Returns:
- the key
-
-