public class ContractsUtils extends Object
Modifier and Type | Field and Description |
---|---|
protected GenericAnnotatedTypeFactory<?,?,?,?> |
factory
The factory that this ContractsUtils is associated with.
|
protected static @InternedDistinct ContractsUtils |
instance
The currently-used ContractsUtils object.
|
Modifier and Type | Method and Description |
---|---|
Set<Contract.ConditionalPostcondition> |
getConditionalPostconditions(ExecutableElement methodElement)
Returns the contracts on method
methodElement . |
Set<Contract> |
getContracts(ExecutableElement executableElement)
Returns all the contracts on method or constructor
executableElement . |
static ContractsUtils |
getInstance(GenericAnnotatedTypeFactory<?,?,?,?> factory)
Returns an instance of the
ContractsUtils class for the given factory. |
Set<Contract.Postcondition> |
getPostconditions(ExecutableElement executableElement)
Returns the contracts on
executableElement . |
Set<Contract.Precondition> |
getPreconditions(ExecutableElement executableElement)
Returns the contracts on method or constructor
executableElement . |
protected static @InternedDistinct ContractsUtils instance
protected GenericAnnotatedTypeFactory<?,?,?,?> factory
public static ContractsUtils getInstance(GenericAnnotatedTypeFactory<?,?,?,?> factory)
ContractsUtils
class for the given factory. Also sets it
as the currently-used ContractsUtils object.factory
- the factory to create a ContractsUtils forpublic Set<Contract> getContracts(ExecutableElement executableElement)
executableElement
.executableElement
- the method or constructor whose contracts to retrieveexecutableElement
public Set<Contract.Precondition> getPreconditions(ExecutableElement executableElement)
executableElement
.executableElement
- the method whose contracts to returnexecutableElement
public Set<Contract.Postcondition> getPostconditions(ExecutableElement executableElement)
executableElement
.executableElement
- the method whose contracts to returnexecutableElement
public Set<Contract.ConditionalPostcondition> getConditionalPostconditions(ExecutableElement methodElement)
methodElement
.methodElement
- the method whose contracts to returnmethodElement