public class UnitsAnnotatedTypeFactory
extends org.checkerframework.common.basetype.BaseAnnotatedTypeFactory
Handles multiple names for the same unit, with different prefixes, e.g. @kg is the same as @g(Prefix.kilo).
Supports relations between units, e.g. if "m" is a variable of type "@m" and "s" is a variable of type "@s", the division "m/s" is automatically annotated as "mPERs", the correct unit for the result.
| Modifier and Type | Class and Description |
|---|---|
protected class |
UnitsAnnotatedTypeFactory.UnitsQualifierHierarchy |
| Modifier and Type | Field and Description |
|---|---|
protected AnnotationMirror |
BOTTOM |
protected AnnotationMirror |
mixedUnits |
protected AnnotationMirror |
TOP |
analysis, cfgVisualizer, defaults, dependentTypesHelper, emptyStore, FLOW_BY_DEFAULT, flowResult, flowResultAnalysisCaches, initializationStaticStore, initializationStore, methodInvocationStores, poly, regularExitStores, returnStatementStores, scannedClasses, transfer, treeAnnotator, typeAnnotatorchecker, elements, fromExpressionTreeCache, fromMemberTreeCache, fromTypeTreeCache, ignoreUninferredTypeArguments, loader, processingEnv, qualHierarchy, reflectionResolver, root, shouldCache, trees, typeArgumentInference, typeFormatter, typeHierarchy, types, typeVarSubstitutor, uid, visitorState| Constructor and Description |
|---|
UnitsAnnotatedTypeFactory(org.checkerframework.common.basetype.BaseTypeChecker checker) |
| Modifier and Type | Method and Description |
|---|---|
AnnotationMirror |
aliasedAnnotation(AnnotationMirror anno) |
protected org.checkerframework.framework.type.AnnotatedTypeFormatter |
createAnnotatedTypeFormatter() |
protected org.checkerframework.framework.type.AnnotationClassLoader |
createAnnotationClassLoader() |
org.checkerframework.framework.type.QualifierHierarchy |
createQualifierHierarchy(org.checkerframework.framework.util.MultiGraphQualifierHierarchy.MultiGraphFactory factory)
Set the Bottom qualifier as the bottom of the hierarchy.
|
protected Set<Class<? extends Annotation>> |
createSupportedTypeQualifiers() |
org.checkerframework.framework.type.treeannotator.TreeAnnotator |
createTreeAnnotator() |
protected Map<String,UnitsRelations> |
getUnitsRel() |
createFlowAnalysisaddCheckedCodeDefaults, addCheckedStandardDefaults, addComputedTypeAnnotations, addComputedTypeAnnotations, addComputedTypeAnnotations, addDefaultAnnotations, addTypeNameImplicit, addUncheckedCodeDefaults, addUncheckedStandardDefaults, analyze, applyInferredAnnotations, checkAndPerformFlowAnalysis, checkForDefaultQualifierInHierarchy, constructorFromUse, createAndInitQualifierDefaults, createCFGVisualizer, createDependentTypesHelper, createFlowTransferFunction, createQualifierDefaults, createQualifierPolymorphism, createTypeAnnotator, fromNewClass, getAnnotatedTypeLhs, getAnnotatedTypeLhsNoTypeVarDefault, getAnnotatedTypeRhsUnaryAssign, getAnnotatedTypeVarargsArray, getAnnotationFromJavaExpressionString, getAnnotationFromReceiver, getAnnotationMirrorFromJavaExpressionString, getCFGVisualizer, getDependentTypesHelper, getEmptyStore, getFinalLocalValues, getFirstNodeOfKindForTree, getInferredValueFor, getMethodReturnType, getMethodReturnType, getNodesForTree, getReceiverFromJavaExpressionString, getRegularExitStore, getResultingTypeOfConstructorMemberReference, getReturnStatementStores, getShouldDefaultTypeVarLocals, getSortedQualifierNames, getStoreAfter, getStoreAfter, getStoreAfter, getStoreBefore, getStoreBefore, getStoreBefore, getSupportedMonotonicTypeQualifiers, getTypeFactoryOfSubchecker, handleCFGViz, methodFromUse, performFlowAnalysis, postDirectSuperTypes, postInit, preProcessClassTree, setRoot, typeVariablesFromUseadaptGetClassReturnTypeToReceiver, addAliasedAnnotation, addAliasedAnnotation, addAliasedAnnotation, addAliasedAnnotation, addAliasedDeclAnnotation, addAnnotationFromFieldInvariant, addInheritedAnnotation, annotateInheritedFromClass, annotateInheritedFromClass, checkInvalidOptionsInferSignatures, createAnnotationFormatter, createQualifierHierarchy, createQualifierHierarchy, createQualifierHierarchyFactory, createTypeArgumentInference, createTypeHierarchy, createTypeVariableSubstitutor, declarationFromElement, fromElement, fromElement, fromElement, getAnnotatedNullType, getAnnotatedType, getAnnotatedType, getAnnotatedType, getAnnotatedType, getAnnotatedType, getAnnotatedType, getAnnotatedType, getAnnotatedType, getAnnotatedTypeFormatter, getAnnotatedTypeFromTypeTree, getAnnotationFormatter, getAnnotationMirror, getAnnotationWithMetaAnnotation, getBoxedType, getBundledTypeQualifiersWithoutPolyAll, getBundledTypeQualifiersWithPolyAll, getCacheSize, getContext, getCurrentClassTree, getCurrentClassType, getCurrentMethodReceiver, getDeclAnnotation, getDeclAnnotationNoAliases, getDeclAnnotations, getDeclAnnotationWithMetaAnnotation, getElementUtils, getEnclosingMethod, getEnclosingType, getFieldInvariantAnnotationTree, getFieldInvariantDeclarationAnnotations, getFieldInvariants, getFnInterfaceFromTree, getFnInterfaceFromTree, getImplicitReceiverType, getNarrowedPrimitive, getPath, getProcessingEnv, getQualifierHierarchy, getReceiverType, getSelfType, getStringType, getSupportedTypeQualifiers, getTreeUtils, getTypeArgumentInference, getTypeHierarchy, getTypeVarSubstitutor, getUnboxedType, getUninferredWildcardType, getVisitorState, getWholeProgramInference, initializeReflectionResolution, isAnyEnclosingThisDeref, isFromByteCode, isFromStubFile, isMostEnclosingThisDeref, isSupportedQualifier, isWithinConstructor, methodFromUse, parseStubFiles, postAsMemberOf, postProcessClassTree, postTypeVarSubstitution, setPathHack, toAnnotatedType, toString, type, widenToUpperBoundprotected final AnnotationMirror mixedUnits
protected final AnnotationMirror TOP
protected final AnnotationMirror BOTTOM
public UnitsAnnotatedTypeFactory(org.checkerframework.common.basetype.BaseTypeChecker checker)
protected org.checkerframework.framework.type.AnnotatedTypeFormatter createAnnotatedTypeFormatter()
createAnnotatedTypeFormatter in class org.checkerframework.framework.type.AnnotatedTypeFactorypublic AnnotationMirror aliasedAnnotation(AnnotationMirror anno)
aliasedAnnotation in class org.checkerframework.framework.type.AnnotatedTypeFactoryprotected Map<String,UnitsRelations> getUnitsRel()
protected org.checkerframework.framework.type.AnnotationClassLoader createAnnotationClassLoader()
createAnnotationClassLoader in class org.checkerframework.framework.type.AnnotatedTypeFactoryprotected Set<Class<? extends Annotation>> createSupportedTypeQualifiers()
createSupportedTypeQualifiers in class org.checkerframework.framework.type.AnnotatedTypeFactorypublic org.checkerframework.framework.type.treeannotator.TreeAnnotator createTreeAnnotator()
createTreeAnnotator in class org.checkerframework.framework.type.GenericAnnotatedTypeFactory<org.checkerframework.framework.flow.CFValue,org.checkerframework.framework.flow.CFStore,org.checkerframework.framework.flow.CFTransfer,org.checkerframework.framework.flow.CFAnalysis>public org.checkerframework.framework.type.QualifierHierarchy createQualifierHierarchy(org.checkerframework.framework.util.MultiGraphQualifierHierarchy.MultiGraphFactory factory)
createQualifierHierarchy in class org.checkerframework.framework.type.AnnotatedTypeFactory