return parameter;
}
+ /**
+ * @return <code>true</code> if no errors were found. <code>false</code>
+ * otherwise.
+ */
+ private boolean checkMandatoryArgumentsPresent() {
+
+ for (final Parameter parameter : parameters)
+ if (parameter.isMandatory() && (!parameter.isParameterSpecified())) {
+ System.out.println("Error! Mandatory parameter ("
+ + parameter.getAliases() + ") is not specified.");
+ return false;
+ }
+
+ return true;
+ }
+
/**
* Return parameter by given alias or <code>null</code> if no parameter
* exists for given alias.
}
- // check if any mandatory parameters are missing
-
- for (final Parameter parameter : parameters)
- if (parameter.isMandatory() && (!parameter.isParameterSpecified())) {
- System.out.println("Error! Mandatory parameter ("
- + parameter.getAliases() + ") is not specified.");
- return false;
- }
-
- return true;
+ return checkMandatoryArgumentsPresent();
}
public void showHelp() {