public class IndexUtil extends Object
Constructor and Description |
---|
IndexUtil() |
Modifier and Type | Method and Description |
---|---|
static Long |
getExactValue(Tree tree,
ValueAnnotatedTypeFactory factory)
Either returns the exact value of the given tree according to the Constant Value Checker, or
null if the exact value is not known.
|
static Long |
getMaxValue(Tree tree,
ValueAnnotatedTypeFactory factory)
Finds the maximum value in a Value Checker type.
|
static int |
getMinLen(AnnotationMirror anm)
Returns the MinLen value of the given annotation mirror, or -1 if the annotation mirror is
null.
|
static int |
getMinLen(Tree tree,
MinLenAnnotatedTypeFactory minLenAnnotatedTypeFactory)
Queries the MinLen Checker to determine if there is a known minimum length for the array
represented by
tree . |
static Long |
getMinValue(Tree tree,
ValueAnnotatedTypeFactory factory)
Finds the minimum value in a Value Checker type.
|
static List<Long> |
getPossibleValues(AnnotatedTypeMirror valueType)
Get the list of possible values from an AnnotatedTypeMirror containing an IntVal.
|
static List<String> |
getValueOfAnnotationWithStringArgument(AnnotationMirror anno)
Gets the value field of an annotation with a list of strings in its value field.
|
public static List<String> getValueOfAnnotationWithStringArgument(AnnotationMirror anno)
For the Index Checker, this will get a list of array names from an Upper Bound or SameLen annotation. making this safe to call on any Upper Bound or SameLen annotation.
public static List<Long> getPossibleValues(AnnotatedTypeMirror valueType)
public static Long getExactValue(Tree tree, ValueAnnotatedTypeFactory factory)
public static Long getMinValue(Tree tree, ValueAnnotatedTypeFactory factory)
public static Long getMaxValue(Tree tree, ValueAnnotatedTypeFactory factory)
public static int getMinLen(Tree tree, MinLenAnnotatedTypeFactory minLenAnnotatedTypeFactory)
tree
. If not, returns -1.public static int getMinLen(AnnotationMirror anm)