/** * Get whether this parameter is entered by the user. * * @return true if this parameter is entered by the user. */ boolean isUserInput() { return getBinding().getBehavior(this) != BindingBehavior.PROVIDES; }
/** * Get whether this parameter consumes non-flag arguments. * * @return true if this parameter consumes non-flag arguments */ boolean isNonFlagConsumer() { return getBinding().getBehavior(this) != BindingBehavior.PROVIDES && !isValueFlag(); }
@Override public void updateDescription(Object object, Method method, ParameterData[] parameters, SimpleDescription description) { Command annotation = method.getAnnotation(Command.class); // Handle the case for old commands where no usage is set and all of its // parameters are provider bindings, so its usage information would // be blank and would imply that there were no accepted parameters if (annotation != null && annotation.usage().isEmpty() && (annotation.min() > 0 || annotation.max() > 0)) { boolean hasUserParameters = false; for (ParameterData parameter : parameters) { if (parameter.getBinding().getBehavior(parameter) != BindingBehavior.PROVIDES) { hasUserParameters = true; break; } } if (!hasUserParameters) { description.overrideUsage("(unknown usage information)"); } } }
BindingBehavior behavior = getBinding().getBehavior(this); boolean indeterminate = (behavior == BindingBehavior.INDETERMINATE); if (!isValueFlag() && indeterminate) {