Enum Format

java.lang.Object
java.lang.Enum<Format>
org.apache.rat.configuration.Format
All Implemented Interfaces:
Serializable, Comparable<Format>

public enum Format extends Enum<Format>
An enumeration of the types of files that can contain the configuration information.
  • Enum Constant Details

    • XML

      public static final Format XML
      an XML file
    • TXT

      public static final Format TXT
      A plain text file
  • Method Details

    • values

      public static Format[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static Format valueOf(String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum type has no constant with the specified name
      NullPointerException - if the argument is null
    • matcherReader

      public MatcherReader matcherReader()
      Returns:
      a new instance of MatcherReader for this format.
    • licenseReader

      public LicenseReader licenseReader()
      Returns:
      a new instance of the LicenseReader for this format.
    • fromName

      public static Format fromName(String name)
      Determine the Format from the file name.
      Parameters:
      name - the file name to check.
      Returns:
      the Format
    • fromURL

      public static Format fromURL(URL url)
      Determine the Format from a URL.
      Parameters:
      url - the URL to check.
      Returns:
      the Format
    • fromFile

      public static Format fromFile(File file) throws MalformedURLException
      Determine the Format from a File.
      Parameters:
      file - the File to check.
      Returns:
      the Format
      Throws:
      MalformedURLException - in case the file cannot be found.