@Test public void testNoShortNameToRegister() throws BindException { thrown.expect(BindException.class); final ConfigurationBuilder cb = Tang.Factory.getTang().newConfigurationBuilder(); final CommandLine cl = new CommandLine(cb); cl.registerShortNameOfClass(NamedParameters.StringNoShortNameNoDefault.class); }
public CommandLine registerShortNameOfClass(final String s) throws BindException { final Node n; try { n = conf.getClassHierarchy().getNode(s); } catch (final NameResolutionException e) { throw new BindException("Problem loading class " + s, e); } if (n instanceof NamedParameterNode) { final NamedParameterNode<?> np = (NamedParameterNode<?>) n; final String shortName = np.getShortName(); final String longName = np.getFullName(); if (shortName == null) { throw new BindException( "Can't register non-existent short name of named parameter: " + longName); } shortNames.put(shortName, longName); } else { throw new BindException("Can't register short name for non-NamedParameterNode: " + n); } return this; }
CommandLine { public CommandLine registerShortNameOfClass(final String s) throws BindException { final Node n; try { n = conf.getClassHierarchy().getNode(s); } catch (final NameResolutionException e) { throw new BindException("Problem loading class " + s, e); } if (n instanceof NamedParameterNode) { final NamedParameterNode<?> np = (NamedParameterNode<?>) n; final String shortName = np.getShortName(); final String longName = np.getFullName(); if (shortName == null) { throw new BindException( "Can't register non-existent short name of named parameter: " + longName); } shortNames.put(shortName, longName); } else { throw new BindException("Can't register short name for non-NamedParameterNode: " + n); } return this; } }
CommandLine { public CommandLine registerShortNameOfClass(final String s) throws BindException { final Node n; try { n = conf.getClassHierarchy().getNode(s); } catch (final NameResolutionException e) { throw new BindException("Problem loading class " + s, e); } if (n instanceof NamedParameterNode) { final NamedParameterNode<?> np = (NamedParameterNode<?>) n; final String shortName = np.getShortName(); final String longName = np.getFullName(); if (shortName == null) { throw new BindException( "Can't register non-existent short name of named parameter: " + longName); } shortNames.put(shortName, longName); } else { throw new BindException("Can't register short name for non-NamedParameterNode: " + n); } return this; } CommandLine();  CommandLine(final ConfigurationBuilder conf); }
CommandLine { public CommandLine registerShortNameOfClass(final String s) throws BindException { final Node n; try { n = conf.getClassHierarchy().getNode(s); } catch (final NameResolutionException e) { throw new BindException("Problem loading class " + s, e); } if (n instanceof NamedParameterNode) { final NamedParameterNode<?> np = (NamedParameterNode<?>) n; final String shortName = np.getShortName(); final String longName = np.getFullName(); if (shortName == null) { throw new BindException( "Can't register non-existent short name of named parameter: " + longName); } shortNames.put(shortName, longName); } else { throw new BindException("Can't register short name for non-NamedParameterNode: " + n); } return this; } CommandLine();  CommandLine(final ConfigurationBuilder conf); ConfigurationBuilder getBuilder(); CommandLine registerShortNameOfClass(final String s); CommandLine registerShortNameOfClass(
      final Class<? extends Name<?>> c); CommandLine addCommandLineOption(final Option option, final CommandLineCallback cb); @SafeVarargs final CommandLine processCommandLine(
      final String[] args, final Class<? extends Name<?>>... argClasses); static Configuration parseToConfiguration(final String[] args,
                                                   final Class<? extends Name<?>>... argClasses); @SuppressWarnings("checkstyle:avoidhidingcauseexception") static ConfigurationBuilder parseToConfigurationBuilder(final String[] args,
                                                                 final Class<? extends Name<?>>... argClasses); }
CommandLine { public CommandLine registerShortNameOfClass(final String s) throws BindException { final Node n; try { n = conf.getClassHierarchy().getNode(s); } catch (final NameResolutionException e) { throw new BindException("Problem loading class " + s, e); } if (n instanceof NamedParameterNode) { final NamedParameterNode<?> np = (NamedParameterNode<?>) n; final String shortName = np.getShortName(); final String longName = np.getFullName(); if (shortName == null) { throw new BindException( "Can't register non-existent short name of named parameter: " + longName); } shortNames.put(shortName, longName); } else { throw new BindException("Can't register short name for non-NamedParameterNode: " + n); } return this; } CommandLine();  CommandLine(final ConfigurationBuilder conf); ConfigurationBuilder getBuilder(); CommandLine registerShortNameOfClass(final String s); CommandLine registerShortNameOfClass(
      final Class<? extends Name<?>> c); CommandLine addCommandLineOption(final Option option, final CommandLineCallback cb); @SafeVarargs final CommandLine processCommandLine(
      final String[] args, final Class<? extends Name<?>>... argClasses); static Configuration parseToConfiguration(final String[] args,
                                                   final Class<? extends Name<?>>... argClasses); @SuppressWarnings("checkstyle:avoidhidingcauseexception") static ConfigurationBuilder parseToConfigurationBuilder(final String[] args,
                                                                 final Class<? extends Name<?>>... argClasses);  }