Class ContractsFromMethod
java.lang.Object
org.checkerframework.framework.util.ContractsFromMethod
A utility class to retrieve pre- and postconditions from a method.
-
Field Summary
Modifier and TypeFieldDescriptionprotected final GenericAnnotatedTypeFactory<?,
?, ?, ?> The factory that this ContractsFromMethod is associated with.protected final ExecutableElement
The QualifierArgument.value field/element. -
Constructor Summary
ConstructorDescriptionContractsFromMethod
(GenericAnnotatedTypeFactory<?, ?, ?, ?> factory) Creates a ContractsFromMethod for the given factory. -
Method Summary
Modifier and TypeMethodDescriptiongetConditionalPostconditions
(ExecutableElement methodElement) Returns the conditional postcondition contracts on methodmethodElement
.getContracts
(ExecutableElement executableElement) Returns all the contracts on method or constructorexecutableElement
.getPostconditions
(ExecutableElement executableElement) Returns the postcondition contracts onexecutableElement
.getPreconditions
(ExecutableElement executableElement) Returns the precondition contracts on method or constructorexecutableElement
.
-
Field Details
-
qualifierArgumentValueElement
The QualifierArgument.value field/element. -
factory
The factory that this ContractsFromMethod is associated with.
-
-
Constructor Details
-
ContractsFromMethod
Creates a ContractsFromMethod for the given factory.- Parameters:
factory
- the type factory associated with the newly-created ContractsFromMethod
-
-
Method Details
-
getContracts
Returns all the contracts on method or constructorexecutableElement
.- Parameters:
executableElement
- the method or constructor whose contracts to retrieve- Returns:
- the contracts on
executableElement
-
getPreconditions
Returns the precondition contracts on method or constructorexecutableElement
.- Parameters:
executableElement
- the method whose contracts to return- Returns:
- the precondition contracts on
executableElement
-
getPostconditions
Returns the postcondition contracts onexecutableElement
.- Parameters:
executableElement
- the method whose contracts to return- Returns:
- the postcondition contracts on
executableElement
-
getConditionalPostconditions
public Set<Contract.ConditionalPostcondition> getConditionalPostconditions(ExecutableElement methodElement) Returns the conditional postcondition contracts on methodmethodElement
.- Parameters:
methodElement
- the method whose contracts to return- Returns:
- the conditional postcondition contracts on
methodElement
-