Class CreatesMustCallForToJavaExpression
- java.lang.Object
-
- org.checkerframework.checker.mustcall.CreatesMustCallForToJavaExpression
-
public class CreatesMustCallForToJavaExpression extends java.lang.Object
Utility methods to convert targets of@CreatesMustCallFor
annotations toJavaExpression
s.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.util.List<JavaExpression>
getCreatesMustCallForExpressionsAtInvocation(MethodInvocationNode n, GenericAnnotatedTypeFactory<?,?,?,?> atypeFactory, CreatesMustCallForElementSupplier supplier)
Returns the elements of the @CreatesMustCallFor annotations on the invoked method, as JavaExpressions.static java.util.List<JavaExpression>
getCreatesMustCallForExpressionsAtMethodDeclaration(com.sun.source.tree.MethodTree tree, GenericAnnotatedTypeFactory<?,?,?,?> atypeFactory, CreatesMustCallForElementSupplier supplier)
Returns the elements of the @CreatesMustCallFor annotations on the method declaration, as JavaExpressions.
-
-
-
Method Detail
-
getCreatesMustCallForExpressionsAtInvocation
public static java.util.List<JavaExpression> getCreatesMustCallForExpressionsAtInvocation(MethodInvocationNode n, GenericAnnotatedTypeFactory<?,?,?,?> atypeFactory, CreatesMustCallForElementSupplier supplier)
Returns the elements of the @CreatesMustCallFor annotations on the invoked method, as JavaExpressions. Returns the empty set if the given method has no @CreatesMustCallFor annotation.If any expression is unparseable, this method reports an error and returns the empty set.
- Parameters:
n
- a method invocationatypeFactory
- the type factory to report errors and parse the expression stringsupplier
- a type factory that can supply the executable elements for CreatesMustCallFor and CreatesMustCallFor.List's value elements. Usually, you should just pass atypeFactory again. The arguments are different so that the given type factory's adherence to both protocols are checked by the type system.- Returns:
- the arguments of the method's @CreatesMustCallFor annotation, or an empty list
-
getCreatesMustCallForExpressionsAtMethodDeclaration
public static java.util.List<JavaExpression> getCreatesMustCallForExpressionsAtMethodDeclaration(com.sun.source.tree.MethodTree tree, GenericAnnotatedTypeFactory<?,?,?,?> atypeFactory, CreatesMustCallForElementSupplier supplier)
Returns the elements of the @CreatesMustCallFor annotations on the method declaration, as JavaExpressions. Returns the empty set if the given method has no @CreatesMustCallFor annotation.If any expression is unparseable, this method reports an error and returns the empty set.
- Parameters:
tree
- a method declarationatypeFactory
- the type factory to report errors and parse the expression stringsupplier
- a type factory that can supply the executable elements for CreatesMustCallFor and CreatesMustCallFor.List's value elements. Usually, you should just pass atypeFactory again. The arguments are different so that the given type factory's adherence to both protocols are checked by the type system.- Returns:
- the arguments of the method's @CreatesMustCallFor annotation, or an empty list
-
-