View Javadoc
1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one
3    * or more contributor license agreements.  See the NOTICE file
4    * distributed with this work for additional information
5    * regarding copyright ownership.  The ASF licenses this file
6    * to you under the Apache License, Version 2.0 (the
7    * "License"); you may not use this file except in compliance
8    * with the License.  You may obtain a copy of the License at
9    *
10   *   http://www.apache.org/licenses/LICENSE-2.0
11   *
12   * Unless required by applicable law or agreed to in writing,
13   * software distributed under the License is distributed on an
14   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15   * KIND, either express or implied.  See the License for the
16   * specific language governing permissions and limitations
17   * under the License.
18   */
19  
20  package org.apache.rat.anttasks;
21  
22  import org.apache.commons.cli.Option;
23  import org.apache.commons.lang3.StringUtils;
24  import org.apache.rat.commandline.Arg;
25  import org.apache.rat.DeprecationReporter;
26  import org.apache.rat.utils.CasedString;
27  import org.apache.rat.utils.DefaultLog;
28  import org.apache.rat.utils.Log;
29  import org.apache.tools.ant.Task;
30  import org.apache.tools.ant.types.FileSet;
31  import org.apache.tools.ant.types.Resource;
32  import org.apache.tools.ant.types.resources.FileResource;
33  
34  import java.util.ArrayList;
35  import java.util.Arrays;
36  import java.util.Collections;
37  import java.util.HashMap;
38  import java.util.List;
39  import java.util.Locale;
40  import java.util.Map;
41  import java.util.Objects;
42  
43  /**
44   * Generated class to provide Ant support for standard RAT command line options.
45   * DO NOT EDIT - GENERATED FILE
46   */
47  public abstract class BaseAntTask extends Task {
48  
49      private static final Map<String, String> xlateName = new HashMap<>();
50  
51      private static final List<String> unsupportedArgs = new ArrayList<>();
52  
53      private static final Map<String, String> deprecatedArgs = new HashMap<>();
54  
55      static {
56          xlateName.put("addLicense", "add-license");
57          unsupportedArgs.add("a");
58          unsupportedArgs.add("input-source");
59          unsupportedArgs.add("dir");
60          unsupportedArgs.add("log-level");
61          unsupportedArgs.add("help-licenses");
62          deprecatedArgs.put("force", "Use of deprecated option 'force'. Deprecated for removal since 0.17: Use editOverwrite attribute instead.");
63          deprecatedArgs.put("list-families", "Use of deprecated option 'listFamilies'. Deprecated for removal since 0.17: Use outputFamilies attribute instead.");
64          deprecatedArgs.put("list-licenses", "Use of deprecated option 'listLicenses'. Deprecated for removal since 0.17: Use outputLicenses attribute instead.");
65          deprecatedArgs.put("licenses", "Use of deprecated option 'licenses'. Deprecated for removal since 0.17: Use <configs> instead.");
66          deprecatedArgs.put("copyright", "Use of deprecated option 'copyright'. Deprecated for removal since 0.17: Use editCopyright attribute instead.");
67          deprecatedArgs.put("exclude", "Use of deprecated option 'excludes'. Deprecated for removal since 0.17: Use <inputExcludes> instead.");
68          deprecatedArgs.put("out", "Use of deprecated option 'out'. Deprecated for removal since 0.17: Use outputFile attribute instead.");
69          deprecatedArgs.put("includes-file", "Use of deprecated option 'includesFile'. Deprecated for removal since 0.17: Use inputIncludeFile attribute instead.");
70          deprecatedArgs.put("exclude-file", "Use of deprecated option 'excludeFile'. Deprecated for removal since 0.17: Use inputExcludeFile attribute instead.");
71          deprecatedArgs.put("addLicense", "Use of deprecated option 'addLicense'. Deprecated for removal since 0.17: Use editLicense attribute instead.");
72          deprecatedArgs.put("stylesheet", "Use of deprecated option 'stylesheet'. Deprecated for removal since 0.17: Use outputStyle attribute instead.");
73          deprecatedArgs.put("include", "Use of deprecated option 'includes'. Deprecated for removal since 0.17: Use <inputIncludes> instead.");
74          deprecatedArgs.put("scan-hidden-directories", "Use of deprecated option 'scanHiddenDirectories'. Deprecated for removal since 0.17: Use <inputIncludeStds> with 'HIDDEN_DIR' argument instead.");
75          deprecatedArgs.put("xml", "Use of deprecated option 'xml'. Deprecated for removal since 0.17: Use outputStyle attribute with the 'xml' argument instead.");
76          deprecatedArgs.put("no-default-licenses", "Use of deprecated option 'noDefaultLicenses'. Deprecated for removal since 0.17: Use configurationNoDefaults attribute instead.");
77      }
78  
79      public static String createName(String longOpt) {
80          String name = StringUtils.defaultIfEmpty(xlateName.get(longOpt), longOpt).toLowerCase(Locale.ROOT);
81          return new CasedString(CasedString.StringCase.KEBAB, name).toCase(CasedString.StringCase.PASCAL);
82      }
83  
84      public static List<String> unsupportedArgs() {
85          return Collections.unmodifiableList(unsupportedArgs);
86      }
87  
88      ///////////////////////// Start common Arg manipulation code
89  
90      /**
91       * Sets the deprecation report method.
92       */
93      private static void setDeprecationReporter() {
94          DeprecationReporter.setLogReporter(opt -> {
95              String msg = deprecatedArgs.get(argsKey(opt));
96              if (msg == null) {
97                  DeprecationReporter.getDefault().accept(opt);
98              } else {
99                  DefaultLog.getInstance().warn(msg);
100             }
101         });
102     }
103 
104     private static String argsKey(Option opt) {
105         return StringUtils.defaultIfEmpty(opt.getLongOpt(), opt.getKey());
106     }
107 
108     /**
109      * A map of CLI-based arguments to values.
110      */
111     protected final Map<String, List<String>> args = new HashMap<>();
112 
113     /**
114      * Gets the list of arguments prepared for the CLI code to parse.
115      * @return the List of arguments for the CLI command line.
116      */
117     protected List<String> args() {
118         List<String> result = new ArrayList<>();
119         for (Map.Entry<String, List<String>> entry : args.entrySet()) {
120             result.add("--" + entry.getKey());
121             result.addAll(entry.getValue().stream().filter(Objects::nonNull).toList());
122         }
123         return result;
124     }
125 
126     private boolean validateSet(String key) {
127         Arg arg = Arg.findArg(key);
128         if (arg != null) {
129             Option opt = arg.find(key);
130             Option main = arg.option();
131             if (opt.isDeprecated()) {
132                 args.remove(argsKey(main));
133                 // deprecated options must be explicitly set so let it go.
134                 return true;
135             }
136             // non-deprecated options may have default so ignore it if another option has already been set.
137             for (Option o : arg.group().getOptions()) {
138                 if (!o.equals(main)) {
139                     if (args.containsKey(argsKey(o))) {
140                         return false;
141                     }
142                 }
143             }
144             return true;
145         }
146         return false;
147     }
148 
149     /**
150      * Set a key and value into the argument list.
151      * Replaces any existing value.
152      * @param key the key for the map.
153      * @param value the value to set.
154      */
155     protected void setArg(String key, String value) {
156         if (value == null || StringUtils.isNotBlank(value)) {
157             if (validateSet(key)) {
158                 List<String> values = new ArrayList<>();
159                 if (DefaultLog.getInstance().isEnabled(Log.Level.DEBUG)) {
160                     DefaultLog.getInstance().debug(String.format("Setting %s to '%s'", key, value));
161                 }
162                 values.add(value);
163                 args.put(key, values);
164             }
165         }
166     }
167 
168     /**
169      * Get the list of values for a key.
170      * @param key the key for the map.
171      * @return the list of values for the key or {@code null} if not set.
172      */
173     public List<String> getArg(String key) {
174         return args.get(key);
175     }
176 
177     /**
178      * Add values to the key in the argument list.
179      * empty values are ignored. If no non-empty values are present no change is made.
180      * If the key does not exist, adds it.
181      * @param key the key for the map.
182      * @param value the array of values to set.
183      */
184     protected void addArg(String key, String[] value) {
185         List<String> newValues = Arrays.stream(value).filter(StringUtils::isNotBlank).toList();
186         if (!newValues.isEmpty()) {
187             if (validateSet(key)) {
188                 if (DefaultLog.getInstance().isEnabled(Log.Level.DEBUG)) {
189                     DefaultLog.getInstance().debug(String.format("Adding [%s] to %s", String.join(", ", Arrays.asList(value)), key));
190                 }
191                 List<String> values = args.computeIfAbsent(key, k -> new ArrayList<>());
192                 values.addAll(newValues);
193             }
194         }
195     }
196 
197     /**
198      * Add a value to the key in the argument list.
199      * If the key does not exist, adds it.
200      * @param key the key for the map.
201      * @param value the value to set.
202      */
203     protected void addArg(String key, String value) {
204         if (StringUtils.isNotBlank(value)) {
205             if (validateSet(key)) {
206                 List<String> values = args.get(key);
207                 if (DefaultLog.getInstance().isEnabled(Log.Level.DEBUG)) {
208                     DefaultLog.getInstance().debug(String.format("Adding [%s] to %s", String.join(", ", Arrays.asList(value)), key));
209                 }
210                 if (values == null) {
211                     values = new ArrayList<>();
212                     args.put(key, values);
213                 }
214                 values.add(value);
215             }
216         }
217     }
218 
219     /**
220      * Remove a key from the argument list.
221      * @param key the key to remove from the map.
222      */
223     protected void removeArg(String key) {
224         args.remove(key);
225     }
226 
227  ///////////////////////// End common Arg manipulation code
228 
229 protected BaseAntTask() {
230     setDeprecationReporter();
231 }
232 
233     /*  GENERATED METHODS */
234 
235     /**
236      * Reads &lt;Expression&gt; entries from a file. Entries will override excluded files. Argument should be a File. (See Argument Types for clarification)
237      * @param inputIncludeFile &lt;Expression&gt; entries from a file.
238      */
239     public void setInputIncludeFile(String inputIncludeFile) {
240         setArg("input-include-file", inputIncludeFile);
241 
242     }
243 
244     /**
245      * Forces any changes in files to be written directly to the source files so that new files are not created. Argument should be a . (See Argument Types for clarification)
246      * @param force The state
247      * @deprecated Deprecated for removal since 0.17: Use editOverwrite attribute instead.
248      */
249     @Deprecated
250     public void setForce(boolean force) {
251         if (force) { setArg("force", null); } else { removeArg("force"); }
252     }
253 
254     /**
255      * List the defined license families. Argument should be a LicenseFilter. (See Argument Types for clarification)
256      * @param listFamilies The defined license families.
257      * @deprecated Deprecated for removal since 0.17: Use outputFamilies attribute instead.
258      */
259     @Deprecated
260     public void setListFamilies(String listFamilies) {
261         setArg("list-families", listFamilies);
262 
263     }
264 
265     /**
266      * List the defined licenses. Argument should be a LicenseFilter. (See Argument Types for clarification)
267      * @param listLicenses The defined licenses.
268      * @deprecated Deprecated for removal since 0.17: Use outputLicenses attribute instead.
269      */
270     @Deprecated
271     public void setListLicenses(String listLicenses) {
272         setArg("list-licenses", listLicenses);
273 
274     }
275 
276     /**
277      * Reads &lt;Expression&gt; entries from a file. Entries will be excluded from processing. Argument should be a File. (See Argument Types for clarification)
278      * @param inputExcludeFile &lt;Expression&gt; entries from a file.
279      */
280     public void setInputExcludeFile(String inputExcludeFile) {
281         setArg("input-exclude-file", inputExcludeFile);
282 
283     }
284 
285     /**
286      * List the defined licenses. Argument should be a LicenseFilter. (See Argument Types for clarification)
287      * @param outputLicenses The defined licenses.
288      */
289     public void setOutputLicenses(String outputLicenses) {
290         setArg("output-licenses", outputLicenses);
291 
292     }
293 
294     /**
295      * Add the Apache-2.0 license header to any file with an unknown license that is not in the exclusion list. By default new files will be created with the license header, to force the modification of existing files use the editOverwrite attribute option. Argument should be a . (See Argument Types for clarification)
296      * @param editLicense The state
297      */
298     public void setEditLicense(boolean editLicense) {
299         if (editLicense) { setArg("edit-license", null); } else { removeArg("edit-license"); }
300     }
301 
302     /**
303      * Excludes files with sizes less than the number of bytes specified. Argument should be a Integer. (See Argument Types for clarification)
304      * @param inputExcludeSize Files with sizes less than the number of bytes specified.
305      */
306     public void setInputExcludeSize(String inputExcludeSize) {
307         setArg("input-exclude-size", inputExcludeSize);
308 
309     }
310 
311     /**
312      * The copyright message to use in the license headers. Argument should be a Arg. (See Argument Types for clarification)
313      * @param copyright Copyright message to use in the license headers.
314      * @deprecated Deprecated for removal since 0.17: Use editCopyright attribute instead.
315      */
316     @Deprecated
317     public void setCopyright(String copyright) {
318         setArg("copyright", copyright);
319 
320     }
321 
322     /**
323      * Specifies the level of detail in ARCHIVE file reporting. Argument should be a ProcessingType. (See Argument Types for clarification)
324      * @param outputArchive The level of detail in ARCHIVE file reporting.
325      */
326     public void setOutputArchive(String outputArchive) {
327         setArg("output-archive", outputArchive);
328 
329     }
330 
331     /**
332      * Forces any changes in files to be written directly to the source files so that new files are not created. Only valid with editLicense attribute. Argument should be a . (See Argument Types for clarification)
333      * @param editOverwrite The state
334      */
335     public void setEditOverwrite(boolean editOverwrite) {
336         if (editOverwrite) { setArg("edit-overwrite", null); } else { removeArg("edit-overwrite"); }
337     }
338 
339     /**
340      * Ignore default configuration. Argument should be a . (See Argument Types for clarification)
341      * @param configurationNoDefaults The state
342      */
343     public void setConfigurationNoDefaults(boolean configurationNoDefaults) {
344         if (configurationNoDefaults) { setArg("configuration-no-defaults", null); } else { removeArg("configuration-no-defaults"); }
345     }
346 
347     /**
348      * Define the output file where to write a report to. Argument should be a File. (See Argument Types for clarification)
349      * @param out The output file where to write a report to.
350      * @deprecated Deprecated for removal since 0.17: Use outputFile attribute instead.
351      */
352     @Deprecated
353     public void setOut(String out) {
354         setArg("out", out);
355 
356     }
357 
358     /**
359      * Reads &lt;Expression&gt; entries from a file. Entries will override excluded files. Argument should be a File. (See Argument Types for clarification)
360      * @param includesFile &lt;Expression&gt; entries from a file.
361      * @deprecated Deprecated for removal since 0.17: Use inputIncludeFile attribute instead.
362      */
363     @Deprecated
364     public void setIncludesFile(String includesFile) {
365         setArg("includes-file", includesFile);
366 
367     }
368 
369     /**
370      * Name of file containing comma separated lists of the denied license IDs. These licenses will be removed from the list of approved licenses. Once licenses are removed they can not be added back. Argument should be a File. (See Argument Types for clarification)
371      * @param licensesDeniedFile Of file containing comma separated lists of the denied license IDs.
372      */
373     public void setLicensesDeniedFile(String licensesDeniedFile) {
374         setArg("licenses-denied-file", licensesDeniedFile);
375 
376     }
377 
378     /**
379      * Reads &lt;Expression&gt; entries from a file. Entries will be excluded from processing. Argument should be a File. (See Argument Types for clarification)
380      * @param excludeFile &lt;Expression&gt; entries from a file.
381      * @deprecated Deprecated for removal since 0.17: Use inputExcludeFile attribute instead.
382      */
383     @Deprecated
384     public void setExcludeFile(String excludeFile) {
385         setArg("exclude-file", excludeFile);
386 
387     }
388 
389     /**
390      * Name of file containing comma separated lists of approved License IDs. Argument should be a File. (See Argument Types for clarification)
391      * @param licensesApprovedFile Of file containing comma separated lists of approved License IDs.
392      */
393     public void setLicensesApprovedFile(String licensesApprovedFile) {
394         setArg("licenses-approved-file", licensesApprovedFile);
395 
396     }
397 
398     /**
399      * XSLT stylesheet to use when creating the report. Either an external xsl file may be specified or one of the internal named sheets. Argument should be a StyleSheet. (See Argument Types for clarification)
400      * @param outputStyle Stylesheet to use when creating the report.
401      */
402     public void setOutputStyle(String outputStyle) {
403         setArg("output-style", outputStyle);
404 
405     }
406 
407     /**
408      * If set do not update the files but generate the reports. Argument should be a . (See Argument Types for clarification)
409      * @param dryRun The state
410      */
411     public void setDryRun(boolean dryRun) {
412         if (dryRun) { setArg("dry-run", null); } else { removeArg("dry-run"); }
413     }
414 
415     /**
416      * Define the output file where to write a report to. Argument should be a File. (See Argument Types for clarification)
417      * @param outputFile The output file where to write a report to.
418      */
419     public void setOutputFile(String outputFile) {
420         setArg("output-file", outputFile);
421 
422     }
423 
424     /**
425      * Specifies the level of detail in STANDARD file reporting. Argument should be a ProcessingType. (See Argument Types for clarification)
426      * @param outputStandard The level of detail in STANDARD file reporting.
427      */
428     public void setOutputStandard(String outputStandard) {
429         setArg("output-standard", outputStandard);
430 
431     }
432 
433     /**
434      * Name of file containing comma separated lists of approved family IDs. Argument should be a File. (See Argument Types for clarification)
435      * @param licenseFamiliesApprovedFile Of file containing comma separated lists of approved family IDs.
436      */
437     public void setLicenseFamiliesApprovedFile(String licenseFamiliesApprovedFile) {
438         setArg("license-families-approved-file", licenseFamiliesApprovedFile);
439 
440     }
441 
442     /**
443      * Add the Apache-2.0 license header to any file with an unknown license that is not in the exclusion list. Argument should be a . (See Argument Types for clarification)
444      * @param addLicense The state
445      * @deprecated Deprecated for removal since 0.17: Use editLicense attribute instead.
446      */
447     @Deprecated
448     public void setAddLicense(boolean addLicense) {
449         if (addLicense) { setArg("addLicense", null); } else { removeArg("addLicense"); }
450     }
451 
452     /**
453      * XSLT stylesheet to use when creating the report. Argument should be a StyleSheet. (See Argument Types for clarification)
454      * @param stylesheet Stylesheet to use when creating the report.
455      * @deprecated Deprecated for removal since 0.17: Use outputStyle attribute instead.
456      */
457     @Deprecated
458     public void setStylesheet(String stylesheet) {
459         setArg("stylesheet", stylesheet);
460 
461     }
462 
463     /**
464      * The copyright message to use in the license headers. Usually in the form of &quot;Copyright 2008 Foo&quot;.  Only valid with editLicense attribute Argument should be a Arg. (See Argument Types for clarification)
465      * @param editCopyright Copyright message to use in the license headers.
466      */
467     public void setEditCopyright(String editCopyright) {
468         setArg("edit-copyright", editCopyright);
469 
470     }
471 
472     /**
473      * List the defined license families. Argument should be a LicenseFilter. (See Argument Types for clarification)
474      * @param outputFamilies The defined license families.
475      */
476     public void setOutputFamilies(String outputFamilies) {
477         setArg("output-families", outputFamilies);
478 
479     }
480 
481     /**
482      * Name of file containing comma separated lists of denied license IDs. These license families will be removed from the list of approved licenses. Once license families are removed they can not be added back. Argument should be a File. (See Argument Types for clarification)
483      * @param licenseFamiliesDeniedFile Of file containing comma separated lists of denied license IDs.
484      */
485     public void setLicenseFamiliesDeniedFile(String licenseFamiliesDeniedFile) {
486         setArg("license-families-denied-file", licenseFamiliesDeniedFile);
487 
488     }
489 
490     /**
491      * Scans hidden directories. Argument should be a . (See Argument Types for clarification)
492      * @param scanHiddenDirectories The state
493      * @deprecated Deprecated for removal since 0.17: Use &lt;inputIncludeStds&gt; with 'HIDDEN_DIR' argument instead.
494      */
495     @Deprecated
496     public void setScanHiddenDirectories(boolean scanHiddenDirectories) {
497         if (scanHiddenDirectories) { setArg("scan-hidden-directories", null); } else { removeArg("scan-hidden-directories"); }
498     }
499 
500     /**
501      * forces XML output rather than the textual report. Argument should be a . (See Argument Types for clarification)
502      * @param xml The state
503      * @deprecated Deprecated for removal since 0.17: Use outputStyle attribute with the 'xml' argument instead.
504      */
505     @Deprecated
506     public void setXml(boolean xml) {
507         if (xml) { setArg("xml", null); } else { removeArg("xml"); }
508     }
509 
510     /**
511      * Ignore default configuration. Argument should be a . (See Argument Types for clarification)
512      * @param noDefaultLicenses The state
513      * @deprecated Deprecated for removal since 0.17: Use configurationNoDefaults attribute instead.
514      */
515     @Deprecated
516     public void setNoDefaultLicenses(boolean noDefaultLicenses) {
517         if (noDefaultLicenses) { setArg("no-default-licenses", null); } else { removeArg("no-default-licenses"); }
518     }
519 
520 
521 
522     /*  GENERATED CLASSES */
523 
524     /**
525      * The minimum number for the specified counter.
526      */
527     public CounterMins createCounterMins() {
528         return new CounterMins();
529     }
530 
531 public class CounterMins {
532     CounterMins() { }
533 public void addConfiguredCntr(Cntr counterPattern) {
534    addArg("counter-min", counterPattern.value);
535 }
536     }
537     /**
538      * Includes files matching &lt;Expression&gt;. Will override excluded files.
539      */
540     public InputIncludes createInputIncludes() {
541         return new InputIncludes();
542     }
543 
544 public class InputIncludes {
545     InputIncludes() { }
546 public void addConfiguredExpr(Expr expression) {
547    addArg("input-include", expression.value);
548 }
549 public void addConfiguredStd(Std standardCollection) {
550    addArg("input-include-std", standardCollection.value);
551 }
552         public void addConfiguredFileset(FileSet fileSet) {
553             for (Resource resource : fileSet) {
554                 if (resource.isFilesystemOnly()) {
555                     addArg("input-include-file", ((FileResource) resource).getFile().getAbsolutePath());
556                 }
557             }
558         }
559     }
560     /**
561      * File names for system configuration.
562      */
563     public Configs createConfigs() {
564         return new Configs();
565     }
566 
567 public class Configs {
568     Configs() { }
569         public void addConfiguredFileset(FileSet fileSet) {
570             for (Resource resource : fileSet) {
571                 if (resource.isFilesystemOnly()) {
572                     addArg("config", ((FileResource) resource).getFile().getAbsolutePath());
573                 }
574             }
575         }
576     }
577     /**
578      * File names for system configuration.
579      * @deprecated Deprecated for removal since 0.17: Use &lt;configs&gt; instead.
580      */
581     public Licenses createLicenses() {
582         return new Licenses();
583     }
584 
585 public class Licenses {
586     Licenses() { }
587         public void addConfiguredFileset(FileSet fileSet) {
588             for (Resource resource : fileSet) {
589                 if (resource.isFilesystemOnly()) {
590                     addArg("licenses", ((FileResource) resource).getFile().getAbsolutePath());
591                 }
592             }
593         }
594     }
595     /**
596      * Excludes files defined in standard collections based on commonly occurring groups. Excludes any path matcher actions but DOES NOT exclude any file processor actions.
597      */
598     public InputExcludeStds createInputExcludeStds() {
599         return new InputExcludeStds();
600     }
601 
602 public class InputExcludeStds {
603     InputExcludeStds() { }
604 public void addConfiguredStd(Std standardCollection) {
605    addArg("input-exclude-std", standardCollection.value);
606 }
607     }
608     /**
609      * Excludes files matching &lt;Expression&gt;.
610      * @deprecated Deprecated for removal since 0.17: Use &lt;inputExcludes&gt; instead.
611      */
612     public Excludes createExcludes() {
613         return new Excludes();
614     }
615 
616 public class Excludes {
617     Excludes() { }
618 public void addConfiguredExpr(Expr expression) {
619    addArg("exclude", expression.value);
620 }
621     }
622     /**
623      * A comma separated list of denied License family IDs. These license families will be removed from the list of approved licenses. Once license families are removed they can not be added back.
624      */
625     public LicenseFamiliesDenied createLicenseFamiliesDenied() {
626         return new LicenseFamiliesDenied();
627     }
628 
629 public class LicenseFamiliesDenied {
630     LicenseFamiliesDenied() { }
631 public void addConfiguredLst(Lst familyID) {
632    addArg("license-families-denied", familyID.value);
633 }
634         public void addConfiguredFileset(FileSet fileSet) {
635             for (Resource resource : fileSet) {
636                 if (resource.isFilesystemOnly()) {
637                     addArg("license-families-denied-file", ((FileResource) resource).getFile().getAbsolutePath());
638                 }
639             }
640         }
641     }
642     /**
643      * Includes files defined in standard collections based on commonly occurring groups. Includes any path matcher actions but DOES NOT include any file processor actions.
644      */
645     public InputIncludeStds createInputIncludeStds() {
646         return new InputIncludeStds();
647     }
648 
649 public class InputIncludeStds {
650     InputIncludeStds() { }
651 public void addConfiguredStd(Std standardCollection) {
652    addArg("input-include-std", standardCollection.value);
653 }
654     }
655     /**
656      * The acceptable maximum number for the specified counter. A value of '-1' specifies an unlimited number.
657      */
658     public CounterMaxs createCounterMaxs() {
659         return new CounterMaxs();
660     }
661 
662 public class CounterMaxs {
663     CounterMaxs() { }
664 public void addConfiguredCntr(Cntr counterPattern) {
665    addArg("counter-max", counterPattern.value);
666 }
667     }
668     /**
669      * Excludes files matching &lt;Expression&gt;.
670      */
671     public InputExcludes createInputExcludes() {
672         return new InputExcludes();
673     }
674 
675 public class InputExcludes {
676     InputExcludes() { }
677 public void addConfiguredExpr(Expr expression) {
678    addArg("input-exclude", expression.value);
679 }
680 public void addConfiguredStd(Std standardCollection) {
681    addArg("input-exclude-std", standardCollection.value);
682 }
683         public void addConfiguredFileset(FileSet fileSet) {
684             for (Resource resource : fileSet) {
685                 if (resource.isFilesystemOnly()) {
686                     addArg("input-exclude-file", ((FileResource) resource).getFile().getAbsolutePath());
687                 }
688             }
689         }
690     }
691     /**
692      * A comma separated list of approved license family IDs. These license families will be added to the list of approved license families.
693      */
694     public LicenseFamiliesApproved createLicenseFamiliesApproved() {
695         return new LicenseFamiliesApproved();
696     }
697 
698 public class LicenseFamiliesApproved {
699     LicenseFamiliesApproved() { }
700 public void addConfiguredLst(Lst familyID) {
701    addArg("license-families-approved", familyID.value);
702 }
703         public void addConfiguredFileset(FileSet fileSet) {
704             for (Resource resource : fileSet) {
705                 if (resource.isFilesystemOnly()) {
706                     addArg("license-families-approved-file", ((FileResource) resource).getFile().getAbsolutePath());
707                 }
708             }
709         }
710     }
711     /**
712      * A comma separated list of denied License IDs. These licenses will be removed from the list of approved licenses. Once licenses are removed they can not be added back.
713      */
714     public LicensesDenied createLicensesDenied() {
715         return new LicensesDenied();
716     }
717 
718 public class LicensesDenied {
719     LicensesDenied() { }
720 public void addConfiguredLst(Lst licenseID) {
721    addArg("licenses-denied", licenseID.value);
722 }
723         public void addConfiguredFileset(FileSet fileSet) {
724             for (Resource resource : fileSet) {
725                 if (resource.isFilesystemOnly()) {
726                     addArg("licenses-denied-file", ((FileResource) resource).getFile().getAbsolutePath());
727                 }
728             }
729         }
730     }
731     /**
732      * Parse SCM based exclusion files to exclude specified files and directories. This action can apply to any standard collection that implements a file processor.
733      */
734     public InputExcludeParsedScms createInputExcludeParsedScms() {
735         return new InputExcludeParsedScms();
736     }
737 
738 public class InputExcludeParsedScms {
739     InputExcludeParsedScms() { }
740 public void addConfiguredStd(Std standardCollection) {
741    addArg("input-exclude-parsed-scm", standardCollection.value);
742 }
743     }
744     /**
745      * A comma separated list of approved License IDs. These licenses will be added to the list of approved licenses.
746      */
747     public LicensesApproved createLicensesApproved() {
748         return new LicensesApproved();
749     }
750 
751 public class LicensesApproved {
752     LicensesApproved() { }
753 public void addConfiguredLst(Lst licenseID) {
754    addArg("licenses-approved", licenseID.value);
755 }
756         public void addConfiguredFileset(FileSet fileSet) {
757             for (Resource resource : fileSet) {
758                 if (resource.isFilesystemOnly()) {
759                     addArg("licenses-approved-file", ((FileResource) resource).getFile().getAbsolutePath());
760                 }
761             }
762         }
763     }
764     /**
765      * Includes files matching &lt;Expression&gt;. Will override excluded files.
766      * @deprecated Deprecated for removal since 0.17: Use &lt;inputIncludes&gt; instead.
767      */
768     public Includes createIncludes() {
769         return new Includes();
770     }
771 
772 public class Includes {
773     Includes() { }
774 public void addConfiguredExpr(Expr expression) {
775    addArg("include", expression.value);
776 }
777     }
778 
779     /* TYPE CLASSES */
780 
781     protected static class TxtValue {
782         protected TxtValue() { }
783 
784         public String value;
785 
786         public void addText(String text) {
787             value = text.trim();
788         }
789     }
790 
791     public static class Std extends TxtValue {
792         public Std() { }
793     }
794 
795     public static class Expr extends TxtValue {
796         public Expr() { }
797     }
798 
799     public static class Cntr extends TxtValue {
800         public Cntr() { }
801     }
802 
803     public static class Filename extends TxtValue {
804         public Filename() { }
805     }
806 
807     public static class Lst extends TxtValue {
808         public Lst() { }
809     }
810 }