-
public interface AnnotationsA 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@@FromContractannotation of the given constructor or method, if any.booleanisFromContract(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.booleanisPayable(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.booleanisRedPayable(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.booleanisSelfCharged(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.booleanisThrowsExceptions(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 methodmethodName- the name of the constructor or methodformals- the types of the formal arguments of the methodreturnType- 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 methodmethodName- the name of the constructor or methodformals- the types of the formal arguments of the methodreturnType- 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 methodmethodName- the name of the constructor or methodformals- the types of the formal arguments of the methodreturnType- 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 methodmethodName- the name of the constructor or methodformals- the types of the formal arguments of the methodreturnType- 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@@FromContractannotation of the given constructor or method, if any.- Parameters:
className- the class of the constructor or methodmethodName- the name of the constructor or methodformals- the types of the formal arguments of the methodreturnType- the return type of the method- Returns:
- the argument of the annotation, if any. For instance, for
@@FromContract(PayableContract.class)this return value will betakamaka.lang.PayableContract.class. If no argument is specified, the result isio.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 methodmethodName- the name of the constructor or methodformals- the types of the formal arguments of the methodreturnType- the return type of the method- Returns:
- true if and only if that condition holds
-
-