-
public interface VerifiedJarA jar that has undergone static verification, before being installed into blockchain.
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description Stream<VerifiedClass>classes()Yields the stream of the classes of the jar that passed verification.AnnotationsgetAnnotations()Yields the utility object that can be used to check the annotations in the methods in this jar.BcelToClassgetBcelToClass()Yields the utility object that can be used to transform BCEL types into their corresponding Java class tag, by using the class loader of this jar.TakamakaClassLoadergetClassLoader()Yields the class loader used to load this jar.Optional<Error>getFirstError()Yields the first error (hence not a warning) that occurred during the verification of the origin jar.booleanhasErrors()Determines if the verification of at least one class of the jar failed with an error.Stream<Issue>issues()Yields the issues generated during the verification of the classes of the jar.static VerifiedJarof(byte[] jar, TakamakaClassLoader classLoader, boolean duringInitialization, boolean allowSelfCharged, boolean skipsVerification)Creates a verified jar from the given file.
-
-
-
Method Detail
-
of
static VerifiedJar of(byte[] jar, TakamakaClassLoader classLoader, boolean duringInitialization, boolean allowSelfCharged, boolean skipsVerification) throws IOException
Creates a verified jar from the given file. This verification might fail if at least a class did not verify. In that case, the issues generated during verification will contain at least an error.- Parameters:
jar- the jar file to verify, given as an array of bytesclassLoader- the class loader that can be used to resolve the classes of the program, including those oforiginduringInitialization- true if and only if verification occurs during the initialization of the nodeallowSelfCharged- true if and only if@@SelfChargedmethods are allowedskipsVerification- true if and only if the static verification of the classes of the jar must be skipped- Throws:
IOException- if there was a problem accessing the classes on disk
-
hasErrors
boolean hasErrors()
Determines if the verification of at least one class of the jar failed with an error.- Returns:
- true if and only if that condition holds
-
getFirstError
Optional<Error> getFirstError()
Yields the first error (hence not a warning) that occurred during the verification of the origin jar.
-
classes
Stream<VerifiedClass> classes()
Yields the stream of the classes of the jar that passed verification.- Returns:
- the classes, in increasing order
-
issues
Stream<Issue> issues()
Yields the issues generated during the verification of the classes of the jar.- Returns:
- the issues, in increasing order
-
getClassLoader
TakamakaClassLoader getClassLoader()
Yields the class loader used to load this jar.- Returns:
- the class loader
-
getAnnotations
Annotations getAnnotations()
Yields the utility object that can be used to check the annotations in the methods in this jar.- Returns:
- the utility object
-
getBcelToClass
BcelToClass getBcelToClass()
Yields the utility object that can be used to transform BCEL types into their corresponding Java class tag, by using the class loader of this jar.- Returns:
- the utility object
-
-