org.apache.commons.cli.Parser.getRequiredOptions()方法的使用及代码示例

x33g5p2x  于2022-01-26 转载在 其他  
字(3.3k)|赞(0)|评价(0)|浏览(181)

本文整理了Java中org.apache.commons.cli.Parser.getRequiredOptions()方法的一些代码示例,展示了Parser.getRequiredOptions()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Parser.getRequiredOptions()方法的具体详情如下:
包路径:org.apache.commons.cli.Parser
类名称:Parser
方法名:getRequiredOptions

Parser.getRequiredOptions介绍

暂无

代码示例

代码示例来源:origin: commons-cli/commons-cli

  1. /**
  2. * Throws a {@link MissingOptionException} if all of the required options
  3. * are not present.
  4. *
  5. * @throws MissingOptionException if any of the required Options are not present.
  6. */
  7. protected void checkRequiredOptions() throws MissingOptionException
  8. {
  9. // if there are required options that have not been processed
  10. if (!getRequiredOptions().isEmpty())
  11. {
  12. throw new MissingOptionException(getRequiredOptions());
  13. }
  14. }

代码示例来源:origin: commons-cli/commons-cli

  1. /**
  2. * Removes the option or its group from the list of expected elements.
  3. *
  4. * @param opt
  5. */
  6. private void updateRequiredOptions(Option opt) throws ParseException
  7. {
  8. // if the option is a required option remove the option from
  9. // the requiredOptions list
  10. if (opt.isRequired())
  11. {
  12. getRequiredOptions().remove(opt.getKey());
  13. }
  14. // if the option is in an OptionGroup make that option the selected
  15. // option of the group
  16. if (getOptions().getOptionGroup(opt) != null)
  17. {
  18. OptionGroup group = getOptions().getOptionGroup(opt);
  19. if (group.isRequired())
  20. {
  21. getRequiredOptions().remove(group);
  22. }
  23. group.setSelected(opt);
  24. }
  25. }
  26. }

代码示例来源:origin: com.impetus.fabric/fabric-jdbc-driver-shaded

  1. /**
  2. * Throws a {@link MissingOptionException} if all of the required options
  3. * are not present.
  4. *
  5. * @throws MissingOptionException if any of the required Options are not present.
  6. */
  7. protected void checkRequiredOptions() throws MissingOptionException
  8. {
  9. // if there are required options that have not been processed
  10. if (!getRequiredOptions().isEmpty())
  11. {
  12. throw new MissingOptionException(getRequiredOptions());
  13. }
  14. }

代码示例来源:origin: org.apache.commons/com.springsource.org.apache.commons.cli

  1. /**
  2. * Throws a {@link MissingOptionException} if all of the required options
  3. * are not present.
  4. *
  5. * @throws MissingOptionException if any of the required Options
  6. * are not present.
  7. */
  8. protected void checkRequiredOptions() throws MissingOptionException
  9. {
  10. // if there are required options that have not been processsed
  11. if (!getRequiredOptions().isEmpty())
  12. {
  13. throw new MissingOptionException(getRequiredOptions());
  14. }
  15. }

代码示例来源:origin: sdedit/sdedit

  1. /**
  2. * Throws a {@link MissingOptionException} if all of the required options
  3. * are not present.
  4. *
  5. * @throws MissingOptionException if any of the required Options
  6. * are not present.
  7. */
  8. protected void checkRequiredOptions() throws MissingOptionException
  9. {
  10. // if there are required options that have not been processsed
  11. if (!getRequiredOptions().isEmpty())
  12. {
  13. throw new MissingOptionException(getRequiredOptions());
  14. }
  15. }

代码示例来源:origin: com.impetus.fabric/fabric-jdbc-driver-shaded

  1. /**
  2. * Removes the option or its group from the list of expected elements.
  3. *
  4. * @param opt
  5. */
  6. private void updateRequiredOptions(Option opt) throws ParseException
  7. {
  8. // if the option is a required option remove the option from
  9. // the requiredOptions list
  10. if (opt.isRequired())
  11. {
  12. getRequiredOptions().remove(opt.getKey());
  13. }
  14. // if the option is in an OptionGroup make that option the selected
  15. // option of the group
  16. if (getOptions().getOptionGroup(opt) != null)
  17. {
  18. OptionGroup group = getOptions().getOptionGroup(opt);
  19. if (group.isRequired())
  20. {
  21. getRequiredOptions().remove(group);
  22. }
  23. group.setSelected(opt);
  24. }
  25. }
  26. }

代码示例来源:origin: sdedit/sdedit

  1. getRequiredOptions().remove(opt.getKey());
  2. getRequiredOptions().remove(group);

代码示例来源:origin: org.apache.commons/com.springsource.org.apache.commons.cli

  1. getRequiredOptions().remove(opt.getKey());
  2. getRequiredOptions().remove(group);

相关文章