public class RegexChecker extends BaseTypeChecker
Regex
qualifier that finds
syntactically invalid regular expressions.SourceChecker.CheckerError
Modifier and Type | Field and Description |
---|---|
protected @Nullable AnnotationMirror |
PARTIALREGEX |
protected @Nullable AnnotationMirror |
REGEX |
protected @NonNull ExecutableElement |
regexValue |
currentPath, currentRoot, env, messager, messages, trees
processingEnv
Constructor and Description |
---|
RegexChecker() |
Modifier and Type | Method and Description |
---|---|
protected @Nullable QualifierHierarchy |
createQualifierHierarchy()
Returns the type qualifier hierarchy graph to be used by this processor.
|
protected MultiGraphQualifierHierarchy.MultiGraphFactory |
createQualifierHierarchyFactory()
Factory method to easily change what Factory is used to
create a QualifierHierarchy.
|
int |
getGroupCount(@Nullable AnnotationMirror anno)
Returns the group count value of the given annotation or 0 if
there's a problem getting the group count value.
|
int |
getGroupCount(@ReadOnly String regex)
Returns the number of groups in the given regex String.
|
void |
initChecker(ProcessingEnvironment env)
Initialize the checker.
|
createFactory, createSourceVisitor, createSupportedTypeQualifiers, createTypeHierarchy, getQualifierHierarchy, getSupportedLintOptions, getSupportedTypeQualifiers, invokeConstructorFor, isAssignable, isSubtype
errorAbort, errorAbort, formatStackTrace, fullMessageOf, getLintOption, getLintOption, getMessages, getProcessingEnvironment, getSupportedAnnotationTypes, getSupportedOptions, getSupportedSourceVersion, getSuppressWarningsKey, init, message, report, shouldSkipDefs, shouldSkipDefs, shouldSkipUses, typeProcess
process, typeProcessingOver
getCompletions, isInitialized, toString
protected @Nullable AnnotationMirror REGEX
protected @Nullable AnnotationMirror PARTIALREGEX
protected @NonNull ExecutableElement regexValue
public void initChecker(ProcessingEnvironment env)
SourceChecker
initChecker
in class BaseTypeChecker
AbstractProcessor.init(ProcessingEnvironment)
protected @Nullable QualifierHierarchy createQualifierHierarchy()
BaseTypeChecker
BaseTypeChecker.getSupportedTypeQualifiers()
using the
meta-annotations found in them. The current implementation returns an
instance of GraphQualifierHierarchy
.
Subclasses may override this method to express any relationships that
cannot be inferred using meta-annotations (e.g. due to lack of
meta-annotations).createQualifierHierarchy
in class BaseTypeChecker
protected MultiGraphQualifierHierarchy.MultiGraphFactory createQualifierHierarchyFactory()
BaseTypeChecker
createQualifierHierarchyFactory
in class BaseTypeChecker
public int getGroupCount(@Nullable AnnotationMirror anno)