Class RegexAnnotatedTypeFactory

All Implemented Interfaces:
AnnotationProvider

public class RegexAnnotatedTypeFactory extends BaseAnnotatedTypeFactory
Adds Regex to the type of tree, in the following cases:
  1. a String or char literal that is a valid regular expression
  2. concatenation of two valid regular expression values (either String or char) or two partial regular expression values that make a valid regular expression when concatenated.
  3. for calls to Pattern.compile, change the group count value of the return type to be the same as the parameter. For calls to the asRegex methods of the classes in asRegexClasses, the returned @Regex String gets the same group count as the second argument to the call to asRegex.
Provides a basic analysis of concatenation of partial regular expressions to determine if a valid regular expression is produced by concatenating non-regular expression Strings. Do do this, PartialRegex is added to the type of tree in the following cases:
  1. a String literal that is not a valid regular expression.
  2. concatenation of two partial regex Strings that doesn't result in a regex String or a partial regex and regex String.
Also, adds PolyRegex to the type of String/char concatenation of a Regex and a PolyRegex or two PolyRegexs.