Fork me on GitHub

Default Matcher Definitions

RAT provides a number of matcher definitions. These definitions are sufficient to define most licences. Additional matchers can be created and installed in the system. The listing below is the set of standard matchers.

all

A collection of matchers that will report true if any enclosed matcher is true.

  • Encloses one or more IHeaderMatcher object\(s\). (required)
  • Attributes
    • id (optional) The id of the matcher.
      • type: String
    • resource (optional) Resource (URL or file) to read enclosed text matcher definitions from.
      • type: String

any

A collection of matchers where one or more enclosed matchers being true will cause the matcher to report true.

  • Encloses one or more IHeaderMatcher object\(s\). (required)
  • Attributes
    • id (optional) The id of the matcher.
      • type: String
    • resource (optional) Resource (URL or file) to read enclosed text matcher definitions from.
      • type: String

copyright

A matcher that matches Copyright text. Uses regular expressions and so should only be used when looking for copyrights with specific patterns that are not caught by a standard text matcher. This matcher will match "(C)", "copyright", or "©". (text is not case sensitive). It will also match things like Copyright (c) joe 1995 as well as Copyright (C) 1995 joe and Copyright (C) joe 1995.

  • Attributes
    • end (optional) The last year the copyright. Only valid with 'start'
      • type: String
    • id (optional) The id of the matcher.
      • type: String
    • owner (optional) The owner of the copyright
      • type: String
    • start (optional) The initial year of the copyright if any
      • type: String

matcherRef

A pointer to another Matcher

  • Attributes
    • refId (required) Reference to an existing matcher
      • type: String

not

A matcher that wraps one matcher and negates its value. Not matchers require that the entire header be read before it can report true or false. This may significantly slow processing.

  • Encloses one IHeaderMatcher object\(s\). (required)
  • Attributes
    • id (optional) The id of the matcher.
      • type: String

regex

Performs a regular expression match using the enclosed text. This is a relatively slow matcher.

  • Attributes
    • expression (optional) The pattern to match
      • type: String
    • id (optional) The id of the matcher.
      • type: String

spdx

A matcher that matches SPDX tags. SPDX tags have the form: "SPDX-License-Identifier: short-name", where short-name matches the regex pattern "[A-Za-z0-9\.-]+". The SPDX matcher takes the short name as an argument.

  • Attributes
    • id (optional) The id of the matcher.
      • type: String
    • name (optional) The SPDX identifier string
      • type: String

text

Matches the enclosed text

  • Encloses one String object\(s\). (required)
  • Attributes
    • id (optional) The id of the matcher.
      • type: String