public class RegexAnnotatedTypeFactory extends GenericAnnotatedTypeFactory<CFValue,CFStore,RegexTransfer,RegexAnalysis>
Regex
to the type of tree, in the following cases:
String
or char
literal that is a valid
regular expressionString
or char
) or two partial regular expression
values that make a valid regular expression when concatenated.@Regex String
with the same group count as the second argument to the
call to asRegex.PartialRegex
is added
to the type of tree in the following cases:
PolyRegex
to the type of String/char concatenation of
a Regex and a PolyRegex or two PolyRegexs.GenericAnnotatedTypeFactory.ScanState
AnnotatedTypeFactory.InheritedFromClassAnnotator
Modifier and Type | Field and Description |
---|---|
protected javax.lang.model.element.AnnotationMirror |
PARTIALREGEX |
protected javax.lang.model.element.AnnotationMirror |
REGEX |
protected javax.lang.model.element.AnnotationMirror |
REGEXBOTTOM |
protected javax.lang.model.element.ExecutableElement |
regexValueElement |
analyses, defaults, FLOW_BY_DEFAULT, flowResult, initializationStaticStore, initializationStore, methodInvocationStores, poly, regularExitStores, returnStatementStores, scannedClasses, treeAnnotator, typeAnnotator, useFlow
checker, elements, fromTreeCache, processingEnv, qualHierarchy, root, SHOULD_CACHE, SHOULD_READ_CACHE, shouldCache, shouldReadCache, trees, typeHierarchy, types, uid, visitorState
Constructor and Description |
---|
RegexAnnotatedTypeFactory(BaseTypeChecker checker) |
Modifier and Type | Method and Description |
---|---|
protected RegexAnalysis |
createFlowAnalysis(java.util.List<Pair<javax.lang.model.element.VariableElement,CFValue>> fieldValues)
Returns the appropriate flow analysis class that is used for the org.checkerframework.dataflow
analysis.
|
QualifierHierarchy |
createQualifierHierarchy(MultiGraphQualifierHierarchy.MultiGraphFactory factory)
Factory method to easily change what QualifierHierarchy is
created.
|
TreeAnnotator |
createTreeAnnotator()
Returns a
TreeAnnotator that adds annotations to a type based
on the contents of a tree. |
int |
getGroupCount(javax.lang.model.element.AnnotationMirror anno)
Returns the group count value of the given annotation or 0 if
there's a problem getting the group count value.
|
static int |
getGroupCount(@Regex java.lang.String regex)
Returns the number of groups in the given regex String.
|
analyze, annotateImplicit, annotateImplicit, annotateImplicit, annotateImplicitWithFlow, applyInferredAnnotations, constructorFromUse, createFlowTransferFunction, createQualifierDefaults, createQualifierPolymorphism, createTypeAnnotator, dotOutputFileName, getDefaultedAnnotatedType, getEmptyStore, getFinalLocalValues, getInferredValueFor, getNodeForTree, getRegularExitStore, getReturnStatementStores, getStoreAfter, getStoreBefore, getSupportedMonotonicTypeQualifiers, getUseFlow, methodFromUse, performFlowAnalysis, postDirectSuperTypes, postInit, setRoot, setUseFlow
addAliasedAnnotation, addAliasedDeclAnnotation, aliasedAnnotation, annotateInheritedFromClass, annotateInheritedFromClass, buildIndexTypes, createLRUCache, createQualifierHierarchy, createQualifierHierarchy, createQualifierHierarchyFactory, createSupportedTypeQualifiers, createTypeHierarchy, declarationFromElement, fromClass, fromElement, fromElement, fromElement, fromExpression, fromMember, fromNewClass, fromTypeTree, getAnnotatedType, getAnnotatedType, getAnnotatedType, getAnnotatedType, getAnnotatedType, getAnnotatedType, getAnnotatedType, getAnnotatedType, getAnnotatedTypeFromTypeTree, getAnnotationMirror, getAnnotationWithMetaAnnotation, getBoxedType, getCurrentClassTree, getCurrentClassType, getCurrentMethodReceiver, getDeclAnnotation, getDeclAnnotations, getDeclAnnotationWithMetaAnnotation, getElementUtils, getEnclosingMethod, getEnclosingType, getImplicitReceiverType, getMethodReturnType, getMethodReturnType, getPath, getProcessingEnv, getQualifierHierarchy, getReceiverType, getSelfType, getSupportedTypeQualifiers, getTreeUtils, getTypeHierarchy, getUnboxedType, getUninferredWildcardType, getVisitorState, getWildcardBoundedBy, isAnyEnclosingThisDeref, isFromByteCode, isFromStubFile, isMostEnclosingThisDeref, isSupportedQualifier, isWithinConstructor, postAsMemberOf, postProcessClassTree, setPathHack, toAnnotatedType, toString, type, typeVariablesFromUse
protected final javax.lang.model.element.AnnotationMirror REGEX
protected final javax.lang.model.element.AnnotationMirror REGEXBOTTOM
protected final javax.lang.model.element.AnnotationMirror PARTIALREGEX
protected final javax.lang.model.element.ExecutableElement regexValueElement
public RegexAnnotatedTypeFactory(BaseTypeChecker checker)
protected RegexAnalysis createFlowAnalysis(java.util.List<Pair<javax.lang.model.element.VariableElement,CFValue>> fieldValues)
GenericAnnotatedTypeFactory
This implementation uses the checker naming convention to create the
appropriate analysis. If no transfer function is found, it returns an
instance of CFAnalysis
.
Subclasses have to override this method to create the appropriate analysis if they do not follow the checker naming convention.
createFlowAnalysis
in class GenericAnnotatedTypeFactory<CFValue,CFStore,RegexTransfer,RegexAnalysis>
public TreeAnnotator createTreeAnnotator()
GenericAnnotatedTypeFactory
TreeAnnotator
that adds annotations to a type based
on the contents of a tree.
Subclasses may override this method to specify more appriopriate
TreeAnnotator
createTreeAnnotator
in class GenericAnnotatedTypeFactory<CFValue,CFStore,RegexTransfer,RegexAnalysis>
public QualifierHierarchy createQualifierHierarchy(MultiGraphQualifierHierarchy.MultiGraphFactory factory)
AnnotatedTypeFactory
createQualifierHierarchy
in class AnnotatedTypeFactory
public int getGroupCount(javax.lang.model.element.AnnotationMirror anno)
public static int getGroupCount(@Regex java.lang.String regex)