public String inspectNextElement() { if (hasMoreElements()) { return array[pos]; } else { throw new NoSuchElementException(); } } }
boolean includeExclusively = false; boolean excludeExclusively = false; StringArrayEnumeration sae = new StringArrayEnumeration(args); while (sae.hasMoreElements()) { String arg = sae.nextElement(); if ("--include-exclusively".equals(arg)) { includeExclusively = true; return options; sae = new StringArrayEnumeration(args); while (sae.hasMoreElements()) { String arg = sae.nextElement(); if ("--include-exclusively".equals(arg) || "--exclude-exclusively".equals(arg)){ options.setIgnoreMissingClasses(true); } else if (IGNORE_MISSING_CLASSES_BY_REGEX.equals(arg)) { while (sae.hasMoreElements()) { String nextElement = sae.inspectNextElement(); if (!nextElement.startsWith("-")) { nextElement = sae.nextElement(); options.addIgnoreMissingClassRegularExpression(nextElement);
private String getOptionWithArgument(String option, StringArrayEnumeration sae) { if (sae.hasMoreElements()) { String value = sae.nextElement(); if (value.startsWith("-")) { throw new JApiCmpException(JApiCmpException.Reason.CliError, String.format("Missing argument for option '%s'.", option)); } return value; } else { throw new JApiCmpException(JApiCmpException.Reason.CliError, String.format("Missing argument for option '%s'.", option)); } }
boolean includeExclusively = false; boolean excludeExclusively = false; StringArrayEnumeration sae = new StringArrayEnumeration(args); while (sae.hasMoreElements()) { String arg = sae.nextElement(); if ("--include-exclusively".equals(arg)) { includeExclusively = true; return options; sae = new StringArrayEnumeration(args); while (sae.hasMoreElements()) { String arg = sae.nextElement(); if ("--include-exclusively".equals(arg) || "--exclude-exclusively".equals(arg)){ options.setIgnoreMissingClasses(true); } else if (IGNORE_MISSING_CLASSES_BY_REGEX.equals(arg)) { while (sae.hasMoreElements()) { String nextElement = sae.inspectNextElement(); if (!nextElement.startsWith("-")) { nextElement = sae.nextElement(); options.addIgnoreMissingClassRegularExpression(nextElement);
private String getOptionWithArgument(String option, StringArrayEnumeration sae) { if (sae.hasMoreElements()) { String value = sae.nextElement(); if (value.startsWith("-")) { throw new JApiCmpException(JApiCmpException.Reason.CliError, String.format("Missing argument for option '%s'.", option)); } return value; } else { throw new JApiCmpException(JApiCmpException.Reason.CliError, String.format("Missing argument for option '%s'.", option)); } }
public String nextElement() { if (hasMoreElements()) { return array[pos++]; } else { throw new NoSuchElementException(); } }
public String nextElement() { if (hasMoreElements()) { return array[pos++]; } else { throw new NoSuchElementException(); } }
public String inspectNextElement() { if (hasMoreElements()) { return array[pos]; } else { throw new NoSuchElementException(); } } }