SwatObject
└─SiteObject
└─SiteCommandLineArgumentParameter
public class SiteCommandLineArgumentParameter
extends SiteObject
| Field Summary | |
|---|---|
| protected mixed | The default value of this parameter. |
| protected string | |
| protected string | The type of this parameter. |
| Constructor Summary | |
|---|---|
SiteCommandLineArgumentParameter(string type, string error_message, mixed default) Creates a new command line argument parameter. |
|
| Method Summary | |
|---|---|
| mixed | Gets the default value of this parameter. |
| string | Gets the error message text of this parameter. |
| boolean | Whether or not a default value is specified for this parameter. |
| boolean | validate(mixed value) Checks a value to see if it is the correct type for this parameter. |
protected mixed $default
The default value of this parameter
protected string $error_message
protected string $type
The type of this parameter
Type must be one of 'int', 'integer', 'double', 'float', or 'string'.
public SiteCommandLineArgumentParameter(string type, string error_message, mixed default)
Creates a new command line argument parameter
type - the type of the parameter. Must be one of 'int', 'integer', 'double', 'float', or 'string'.error_message - a message displayed when the user omits a required parameter or the user specifies a parameter value of the wrong type.default - optional default value. If a default value is specified and the user does not specify the parameter value, the default value is used.public mixed getDefault()
Gets the default value of this parameter
public string getErrorMessage()
Gets the error message text of this parameter
public boolean hasDefault()
Whether or not a default value is specified for this parameter
public boolean validate(mixed value)
Checks a value to see if it is the correct type for this parameter
value - the value to check.
A parameter for a command line argument