private static String typeIndicator( OptionDescriptor descriptor ) { String indicator = descriptor.argumentTypeIndicator(); return indicator == null || String.class.getName().equals( indicator ) ? "" : shortNameOf( indicator ); } }
private static String typeIndicator( OptionDescriptor descriptor ) { String indicator = descriptor.argumentTypeIndicator(); return indicator == null || String.class.getName().equals( indicator ) ? "" : shortNameOf( indicator ); } }
private static String typeIndicator( OptionDescriptor descriptor ) { String indicator = descriptor.argumentTypeIndicator(); return indicator == null || String.class.getName().equals( indicator ) ? "" : shortNameOf( indicator ); } }
/** * <p>Gives an indicator of the type of arguments of the option described by the given descriptor, * for use in help.</p> * * <p>This implementation asks for the {@link OptionDescriptor#argumentTypeIndicator()} of the given * descriptor, and if it is present and not {@code "java.lang.String"}, parses it as a fully qualified * class name and returns the base name of that class; otherwise returns {@code "String"}.</p> * * @param descriptor a descriptor for a configured option of a parser * @return type indicator text */ protected String extractTypeIndicator( OptionDescriptor descriptor ) { String indicator = descriptor.argumentTypeIndicator(); if ( !isNullOrEmpty( indicator ) && !String.class.getName().equals( indicator ) ) return shortNameOf( indicator ); return "String"; }
sb.append(od.description()); String type = od.argumentTypeIndicator(); if (type != null) { if (Integer.class.getCanonicalName().equals(type)) {
/** * <p>Gives an indicator of the type of arguments of the option described by the given descriptor, * for use in help.</p> * * <p>This implementation asks for the {@link OptionDescriptor#argumentTypeIndicator()} of the given * descriptor.<br> * If the descriptor describes a date option it returns the date's pattern if present.<br> * Otherwise if the indicator is present and not {@code "java.lang.String"}, parses it as a fully qualified * class name and returns the base name of that class; otherwise returns {@code "String"}.</p> * * * @param descriptor a descriptor for a configured option of a parser * @return type indicator text */ protected String extractTypeIndicator( OptionDescriptor descriptor ) { String indicator = descriptor.argumentTypeIndicator(); if ( isDateOption( descriptor ) && !isNullOrEmpty( indicator ) ) { return indicator; } if ( !isNullOrEmpty( indicator ) && !String.class.getName().equals( indicator ) ) return shortNameOf( indicator ); return "String"; }
/** * <p>Decides whether or not to show a non-option arguments help.</p> * * <p>This implementation responds with {@code true} if the non-option descriptor has a non-{@code null}, * non-empty value for any of {@link OptionDescriptor#description()}, * {@link OptionDescriptor#argumentTypeIndicator()}, or {@link OptionDescriptor#argumentDescription()}.</p> * * @param nonOptionDescriptor non-option argument descriptor * @return {@code true} if non-options argument help should be shown */ protected boolean shouldShowNonOptionArgumentDisplay( OptionDescriptor nonOptionDescriptor ) { return !Strings.isNullOrEmpty( nonOptionDescriptor.description() ) || !Strings.isNullOrEmpty( nonOptionDescriptor.argumentTypeIndicator() ) || !Strings.isNullOrEmpty( nonOptionDescriptor.argumentDescription() ); }
/** * <p>Decides whether or not to show a non-option arguments help.</p> * * <p>This implementation responds with {@code true} if the non-option descriptor has a non-{@code null}, * non-empty value for any of {@link OptionDescriptor#description()}, * {@link OptionDescriptor#argumentTypeIndicator()}, or {@link OptionDescriptor#argumentDescription()}.</p> * * @param nonOptionDescriptor non-option argument descriptor * @return {@code true} if non-options argument help should be shown */ protected boolean shouldShowNonOptionArgumentDisplay( OptionDescriptor nonOptionDescriptor ) { return !Strings.isNullOrEmpty( nonOptionDescriptor.description() ) || !Strings.isNullOrEmpty( nonOptionDescriptor.argumentTypeIndicator() ) || !Strings.isNullOrEmpty( nonOptionDescriptor.argumentDescription() ); }