Lines Matching refs:Opt
131 Opt opt = null;
177 opt = opts.getOpt (canonicalName);
181 if (opt == null)
183 opt = new Opt (optName, canonicalName, patternPrefix);
184 opts.addOpt (opt, optdef, optName);
189 if (opt == null)
191 opt = new Opt (optName, canonicalName, patternPrefix);
192 opts.addOpt (opt, optdef, optName);
221 // [assertion: opt != null and optdef != null]
234 opts.addError (formatMessage ("option \'" + opt.getName () + "\' does not accept values: \'" + value + "\'"));
241 opt.addValue (value);
254 opts.addError (formatMessage ("option \'" + opt.getName () + "\' does not accept fewer than " + cardinality [0] + " value(s)"));
267 opt.addValue (value);
274 // opts.addError (formatMessage ("option \'" + opt.getName () + "\' does not accept fewer than " + cardinality [0] + " value(s)"));
314 if (opt != null) // validate the last option's min cardinality
320 opts.addError (formatMessage ("option \'" + opt.getName () + "\' does not accept fewer than " + cardinality [0] + " value(s)"));
355 final IOpt opt = specified [s];
356 final OptDef optdef = m_metadata.getOptDef (opt.getCanonicalName (), null);
361 // if (opt.getValueCount () < cardinality [0])
362 // opts.addError (formatMessage ("option \'" + opt.getName () + "\' must have at least " + cardinality [0] + " value(s)"));
363 // else if (opt.getValueCount () > cardinality [1])
364 // opts.addError (formatMessage ("option \'" + opt.getName () + "\' must not have more than " + cardinality [1] + " value(s)"));
374 opts.addError (formatMessage ("option \'" + opt.getName () + "\' requires option \'" + requires [r] + "\'"));
385 final Opt xopt = opts.getOpt (excludes [x]);
387 opts.addError (formatMessage ("option \'" + opt.getName () + "\' cannot be used with option \'" + xopt.getName () + "\'"));
395 opts.setUsageRequested (opt.getName ().equals (opt.getCanonicalName ()) ? SHORT_USAGE : DETAILED_USAGE);
430 * ['optdef' can be null if no current opt def context has been established]
506 static final class Opt implements IOptsParser.IOpt
561 Opt (final String name, final String canonicalName, final String patternPrefix)
629 final List /* Opt */ patternOpts = (List) m_patternMap.get (pattern);
658 void addOpt (final Opt opt, final OptDef optdef, final String occuranceName)
660 if (opt == null) throw new IllegalArgumentException ("null input: opt");
666 m_opts.add (opt);
669 final boolean isPattern = (opt.getPatternPrefix () != null);
673 final String unprefixedName = occuranceName.substring (opt.getPatternPrefix ().length ());
677 m_nameMap.put (names [n].concat (unprefixedName), opt);
693 patternList.add (opt);
700 m_nameMap.put (names [n], opt);
705 Opt getOpt (final String occuranceName)
709 return (Opt) m_nameMap.get (occuranceName);
755 private final List /* Opt */ m_opts;
756 private final Map /* String(name/pattern-prefixed name)->Opt */ m_nameMap;
757 private final Map /* String(pattern prefix)->List<Opt> */ m_patternMap;
768 static final class OptDef // TODO: merge with Opt?