test_class.file: app-cleaner/src/test/java/com/kdgregory/pomutil/cleaner/TestCommandLine.java
test_class.identifier: TestCommandLine
test_case.body: @Test
      public void testDefaults() throws Exception
      {
          CommandLine cmd = new CommandLine("test.xml");
  
          assertFalse(ORGANIZE_POM.toString(),            cmd.isOptionEnabled(ORGANIZE_POM));
          assertTrue(PRETTY_PRINT.toString(),             cmd.isOptionEnabled(PRETTY_PRINT));
          assertTrue(COMMON_PROPS.toString(),             cmd.isOptionEnabled(COMMON_PROPS));
          assertTrue(VERSION_PROPS.toString(),            cmd.isOptionEnabled(VERSION_PROPS));
          assertFalse(VP_REPLACE_EXISTING.toString(),     cmd.isOptionEnabled(VP_REPLACE_EXISTING));
          assertTrue(VP_CONVERT_PLUGINS.toString(),       cmd.isOptionEnabled(VP_CONVERT_PLUGINS));
          assertTrue(DEPENDENCY_NORMALIZE.toString(),     cmd.isOptionEnabled(DEPENDENCY_NORMALIZE));
          assertTrue(DEPENDENCY_SORT.toString(),          cmd.isOptionEnabled(DEPENDENCY_SORT));
          assertFalse(DEPENDENCY_SORT_BY_SCOPE.toString(), cmd.isOptionEnabled(DEPENDENCY_SORT_BY_SCOPE));
          assertTrue(PLUGIN_NORMALIZE.toString(),         cmd.isOptionEnabled(PLUGIN_NORMALIZE));
  
          assertEquals(VP_ARTIFACT_ID.toString(),         Collections.emptyList(),
                                                          cmd.getOptionValues(VP_ARTIFACT_ID));
  
          assertEquals("arguments",                       Arrays.asList("test.xml"),
                                                          cmd.getParameters());
  
          assertToString(cmd,
              "--noOrganizePom",
              "--prettyPrint",
              "--commonProps",
              "--versionProps",
              "--noReplaceExistingProps",
              "--convertPluginVersions",
              "--dependencyNormalize",
              "--dependencySort",
              "--noGroupDependenciesByScope",
              "--pluginNormalize",
              "test.xml"
             );
      }
test_case.class_method_signature: TestCommandLine.testDefaults()
test_case.full_signature: @Test public void testDefaults()
test_case.identifier: testDefaults
test_case.invocations: assertFalse toString isOptionEnabled assertTrue toString isOptionEnabled assertTrue toString isOptionEnabled assertTrue toString isOptionEnabled assertFalse toString isOptionEnabled assertTrue toString isOptionEnabled assertTrue toString isOptionEnabled assertTrue toString isOptionEnabled assertFalse toString isOptionEnabled assertTrue toString isOptionEnabled assertEquals toString emptyList getOptionValues assertEquals asList getParameters assertToString
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testDefaults()
focal_class.declarator: optionDefs = new OptionDefinition[]
      {
          new OptionDefinition(
                  Options.ORGANIZE_POM,
                  "--organizePom", "--noOrganizePom", false,
                  "Restructure the entire POM to follow the order in the Maven documentation"
                  + " (as a side-effect, removes any comments between top-level sections)."),
          new OptionDefinition(
                  Options.PRETTY_PRINT,
                  "--prettyPrint", "--noPrettyPrint", true,
                  "Pretty-print the cleaned POM. By default, indentation is four spaces;"
                  + " you can control this with \"--prettyPrint=VALUE\"."),
          new OptionDefinition(
                  Options.COMMON_PROPS,
                  "--commonProps", "--noCommonProps", true,
                  "Insert common build properties (such as source encoding) if not already present."),
          new OptionDefinition(
                  Options.VERSION_PROPS,
                  "--versionProps", "--noVersionProps", true,
                  "Replace hardcoded dependency versions with properties. These properties normally"
                  + " take the form \"GROUPID.version\"; where there are multiple artifacts with the"
                  + " same group but different versions, they take the form \"GROUPID.ARTIFACTID.version\"."),
          new OptionDefinition(
                  Options.VP_REPLACE_EXISTING,
                  "--replaceExistingProps", "--noReplaceExistingProps", false,
                  "Replace existing properties used as dependency versions (assures that all"
                  + " version properties follow same form). Do not use if you inherit properties"
                  + " from a parent POM"),
          new OptionDefinition(
                  Options.VP_ARTIFACT_ID,
                  "--addArtifactIdToProp", 1,
                  "For artifacts in the specified group, always construct version properties named"
                  + " \"GROUPID.ARTIFACTID.version\" (often used for organization-local artifacts)."),
          new OptionDefinition(
                  Options.VP_CONVERT_PLUGINS,
                  "--convertPluginVersions", "--noConvertPluginVersions", true,
                  "Create properties for plugins as well as normal dependencies. These properties"
                  + " take the form \"plugin.ARTIFACTID.version\"."),
          new OptionDefinition(
                  Options.DEPENDENCY_NORMALIZE,
                  "--dependencyNormalize", "--noDependencyNormalize", true,
                  "Ensure that the children of a <dependency> element follow the order shown"
                  + " in the Maven POM documentation."),
          new OptionDefinition(
                  Options.DEPENDENCY_SORT,
                  "--dependencySort", "--noDependencySort", true,
                  "Sort <dependency> elements by groupId and artifactId."),
          new OptionDefinition(
                  Options.DEPENDENCY_SORT_BY_SCOPE,
                  "--groupDependenciesByScope", "--noGroupDependenciesByScope", false,
                  "When sorting <dependency> elements, sort first by scope."),
          new OptionDefinition(
                  Options.PLUGIN_NORMALIZE,
                  "--pluginNormalize", "--noPluginNormalize", true,
                  "Ensure that the children of a <plugin> element follow the order shown"
                  + " in the Maven POM documentation, and adds an explicit <groupId> if"
                  + " the specification is relying on the default.")
      }
focal_class.modifier: private static
focal_class.original_string: private static OptionDefinition[] optionDefs = new OptionDefinition[]
      {
          new OptionDefinition(
                  Options.ORGANIZE_POM,
                  "--organizePom", "--noOrganizePom", false,
                  "Restructure the entire POM to follow the order in the Maven documentation"
                  + " (as a side-effect, removes any comments between top-level sections)."),
          new OptionDefinition(
                  Options.PRETTY_PRINT,
                  "--prettyPrint", "--noPrettyPrint", true,
                  "Pretty-print the cleaned POM. By default, indentation is four spaces;"
                  + " you can control this with \"--prettyPrint=VALUE\"."),
          new OptionDefinition(
                  Options.COMMON_PROPS,
                  "--commonProps", "--noCommonProps", true,
                  "Insert common build properties (such as source encoding) if not already present."),
          new OptionDefinition(
                  Options.VERSION_PROPS,
                  "--versionProps", "--noVersionProps", true,
                  "Replace hardcoded dependency versions with properties. These properties normally"
                  + " take the form \"GROUPID.version\"; where there are multiple artifacts with the"
                  + " same group but different versions, they take the form \"GROUPID.ARTIFACTID.version\"."),
          new OptionDefinition(
                  Options.VP_REPLACE_EXISTING,
                  "--replaceExistingProps", "--noReplaceExistingProps", false,
                  "Replace existing properties used as dependency versions (assures that all"
                  + " version properties follow same form). Do not use if you inherit properties"
                  + " from a parent POM"),
          new OptionDefinition(
                  Options.VP_ARTIFACT_ID,
                  "--addArtifactIdToProp", 1,
                  "For artifacts in the specified group, always construct version properties named"
                  + " \"GROUPID.ARTIFACTID.version\" (often used for organization-local artifacts)."),
          new OptionDefinition(
                  Options.VP_CONVERT_PLUGINS,
                  "--convertPluginVersions", "--noConvertPluginVersions", true,
                  "Create properties for plugins as well as normal dependencies. These properties"
                  + " take the form \"plugin.ARTIFACTID.version\"."),
          new OptionDefinition(
                  Options.DEPENDENCY_NORMALIZE,
                  "--dependencyNormalize", "--noDependencyNormalize", true,
                  "Ensure that the children of a <dependency> element follow the order shown"
                  + " in the Maven POM documentation."),
          new OptionDefinition(
                  Options.DEPENDENCY_SORT,
                  "--dependencySort", "--noDependencySort", true,
                  "Sort <dependency> elements by groupId and artifactId."),
          new OptionDefinition(
                  Options.DEPENDENCY_SORT_BY_SCOPE,
                  "--groupDependenciesByScope", "--noGroupDependenciesByScope", false,
                  "When sorting <dependency> elements, sort first by scope."),
          new OptionDefinition(
                  Options.PLUGIN_NORMALIZE,
                  "--pluginNormalize", "--noPluginNormalize", true,
                  "Ensure that the children of a <plugin> element follow the order shown"
                  + " in the Maven POM documentation, and adds an explicit <groupId> if"
                  + " the specification is relying on the default.")
      };
focal_class.type: OptionDefinition[]
focal_class.var_name: optionDefs
focal_class.declarator: optionDefsByKey = new HashMap<Object,OptionDefinition>()
focal_class.modifier: private static
focal_class.original_string: private static Map<Object,OptionDefinition> optionDefsByKey = new HashMap<Object,OptionDefinition>();
focal_class.type: Map<Object,OptionDefinition>
focal_class.var_name: optionDefsByKey
focal_class.file: app-cleaner/src/main/java/com/kdgregory/pomutil/cleaner/CommandLine.java
focal_class.identifier: CommandLine
focal_class.class_method_signature: CommandLine.getDefinition(Options key)
focal_class.full_signature: public static OptionDefinition getDefinition(Options key)
focal_class.identifier: getDefinition
focal_class.modifiers: public static
focal_class.parameters: (Options key)
focal_class.return: OptionDefinition
focal_class.signature: OptionDefinition getDefinition(Options key)
focal_class.class_method_signature: CommandLine.CommandLine(String... argv)
focal_class.full_signature: public  CommandLine(String... argv)
focal_class.identifier: CommandLine
focal_class.modifiers: public
focal_class.parameters: (String... argv)
focal_class.signature:  CommandLine(String... argv)
focal_class.class_method_signature: CommandLine.isValid()
focal_class.full_signature: public boolean isValid()
focal_class.identifier: isValid
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: boolean
focal_class.signature: boolean isValid()
focal_class.class_method_signature: CommandLine.toString()
focal_class.full_signature: @Override public String toString()
focal_class.identifier: toString
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String toString()
focal_class.superclass: extends SimpleCLIParser
focal_method.body: @Override
      public String toString()
      {
          StringBuilder sb = new StringBuilder(256);
  
          for (OptionDefinition optionDef : optionDefs)
          {
              if (optionDef.getType() == OptionDefinition.Type.BINARY)
              {
                  sb.append((sb.length() > 0) ? " " : "");
                  sb.append(isOptionEnabled(optionDef.getKey())
                            ? optionDef.getEnableVal()
                            : optionDef.getDisableVal());
              }
              else if (! getOptionValues(optionDef.getKey()).isEmpty())
              {
                  sb.append((sb.length() > 0) ? " " : "");
                  sb.append(optionDef.getEnableVal());
                  for (String value : getOptionValues(optionDef.getKey()))
                  {
                      sb.append(" ").append(value);
                  }
              }
          }
  
          for (String param : getParameters())
          {
              sb.append(" ").append(param);
          }
  
          return sb.toString();
      }
focal_method.class_method_signature: CommandLine.toString()
focal_method.full_signature: @Override public String toString()
focal_method.identifier: toString
focal_method.invocations: getType append length append isOptionEnabled getKey getEnableVal getDisableVal isEmpty getOptionValues getKey append length append getEnableVal getOptionValues getKey append append getParameters append append toString
focal_method.modifiers: @Override public
focal_method.parameters: ()
focal_method.return: String
focal_method.signature: String toString()