Class FormatterTreeUtil.FormatCall
java.lang.Object
org.checkerframework.checker.formatter.FormatterTreeUtil.FormatCall
- Enclosing class:
- FormatterTreeUtil
Represents a format method invocation in the syntax tree.
-
Method Summary
Modifier and TypeMethodDescriptionReturns an error description if the format-string argument's type is not annotated as@Format
.final FormatterTreeUtil.Result<TypeMirror>[]
Returns the types of the arguments to the call.final ConversionCategory[]
Returns the conversion category for every parameter.Returns the type of method invocation.final boolean
isArgumentNull
(TypeMirror type) Checks if the argument returned fromgetArgTypes()
is anull
expression.final boolean
isValidArgument
(ConversionCategory formatCat, TypeMirror argType) Checks if the type of an argument returned fromgetArgTypes()
is valid for the passed ConversionCategory.
-
Method Details
-
errMissingFormatAnnotation
Returns an error description if the format-string argument's type is not annotated as@Format
. Returns null if it is annotated.- Returns:
- an error description if the format string is not annotated as
@Format
, or null if it is
-
getInvocationType
Returns the type of method invocation.- See Also:
-
getFormatCategories
Returns the conversion category for every parameter.- Returns:
- the conversion categories of all the parameters
- See Also:
-
getArgTypes
Returns the types of the arguments to the call. UseisValidArgument(org.checkerframework.checker.formatter.qual.ConversionCategory, javax.lang.model.type.TypeMirror)
andisArgumentNull(javax.lang.model.type.TypeMirror)
to work with the result.- Returns:
- the types of the arguments to the call
-
isValidArgument
Checks if the type of an argument returned fromgetArgTypes()
is valid for the passed ConversionCategory.- Parameters:
formatCat
- a format specifierargType
- an argument type- Returns:
- true if the argument can be passed to the format specifier
-
isArgumentNull
Checks if the argument returned fromgetArgTypes()
is anull
expression.- Parameters:
type
- a type- Returns:
- true if the argument is a
null
expression
-