Interface Annotations


  • public interface Annotations
    A utility to check the annotations of the methods in a given jar.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      Optional<Class<?>> getFromContractArgument​(String className, String methodName, org.apache.bcel.generic.Type[] formals, org.apache.bcel.generic.Type returnType)
      Determines the argument of the @@FromContract annotation of the given constructor or method, if any.
      boolean isFromContract​(String className, String methodName, org.apache.bcel.generic.Type[] formals, org.apache.bcel.generic.Type returnType)
      Determines if the given constructor or method is annotated as @@FromContract.
      boolean isPayable​(String className, String methodName, org.apache.bcel.generic.Type[] formals, org.apache.bcel.generic.Type returnType)
      Determines if the given constructor or method is annotated as payable.
      boolean isRedPayable​(String className, String methodName, org.apache.bcel.generic.Type[] formals, org.apache.bcel.generic.Type returnType)
      Determines if the given constructor or method is annotated as red payable.
      boolean isSelfCharged​(String className, String methodName, org.apache.bcel.generic.Type[] formals, org.apache.bcel.generic.Type returnType)
      Determines if the given constructor or method is annotated as self charged.
      boolean isThrowsExceptions​(String className, String methodName, org.apache.bcel.generic.Type[] formals, org.apache.bcel.generic.Type returnType)
      Determines if the given constructor or method is annotated as @@ThrowsExceptions.
    • Method Detail

      • isPayable

        boolean isPayable​(String className,
                          String methodName,
                          org.apache.bcel.generic.Type[] formals,
                          org.apache.bcel.generic.Type returnType)
        Determines if the given constructor or method is annotated as payable.
        Parameters:
        className - the class of the constructor or method
        methodName - the name of the constructor or method
        formals - the types of the formal arguments of the method
        returnType - the return type of the method
        Returns:
        true if and only if that condition holds
      • isRedPayable

        boolean isRedPayable​(String className,
                             String methodName,
                             org.apache.bcel.generic.Type[] formals,
                             org.apache.bcel.generic.Type returnType)
        Determines if the given constructor or method is annotated as red payable.
        Parameters:
        className - the class of the constructor or method
        methodName - the name of the constructor or method
        formals - the types of the formal arguments of the method
        returnType - the return type of the method
        Returns:
        true if and only if that condition holds
      • isSelfCharged

        boolean isSelfCharged​(String className,
                              String methodName,
                              org.apache.bcel.generic.Type[] formals,
                              org.apache.bcel.generic.Type returnType)
        Determines if the given constructor or method is annotated as self charged.
        Parameters:
        className - the class of the constructor or method
        methodName - the name of the constructor or method
        formals - the types of the formal arguments of the method
        returnType - the return type of the method
        Returns:
        true if and only if that condition holds
      • isThrowsExceptions

        boolean isThrowsExceptions​(String className,
                                   String methodName,
                                   org.apache.bcel.generic.Type[] formals,
                                   org.apache.bcel.generic.Type returnType)
        Determines if the given constructor or method is annotated as @@ThrowsExceptions.
        Parameters:
        className - the class of the constructor or method
        methodName - the name of the constructor or method
        formals - the types of the formal arguments of the method
        returnType - the return type of the method
        Returns:
        true if and only if that condition holds
      • getFromContractArgument

        Optional<Class<?>> getFromContractArgument​(String className,
                                                   String methodName,
                                                   org.apache.bcel.generic.Type[] formals,
                                                   org.apache.bcel.generic.Type returnType)
        Determines the argument of the @@FromContract annotation of the given constructor or method, if any.
        Parameters:
        className - the class of the constructor or method
        methodName - the name of the constructor or method
        formals - the types of the formal arguments of the method
        returnType - the return type of the method
        Returns:
        the argument of the annotation, if any. For instance, for @@FromContract(PayableContract.class) this return value will be takamaka.lang.PayableContract.class. If no argument is specified, the result is io.takamaka.code.lang.Contract. If the argument cannot be determined, the result is an empty optional
      • isFromContract

        boolean isFromContract​(String className,
                               String methodName,
                               org.apache.bcel.generic.Type[] formals,
                               org.apache.bcel.generic.Type returnType)
        Determines if the given constructor or method is annotated as @@FromContract.
        Parameters:
        className - the class of the constructor or method
        methodName - the name of the constructor or method
        formals - the types of the formal arguments of the method
        returnType - the return type of the method
        Returns:
        true if and only if that condition holds