CBMC
|
Base class for maintaining classpath. More...
#include <java_class_loader_base.h>
Classes | |
struct | classpath_entryt |
An entry in the classpath. More... | |
Public Member Functions | |
void | clear_classpath () |
Clear all classpath entries. | |
void | add_classpath_entry (const std::string &, message_handlert &) |
Appends an entry to the class path, used for loading classes. | |
Static Public Member Functions | |
static std::string | file_to_class_name (const std::string &) |
Convert a file name to the class name. | |
static std::string | class_name_to_os_file (const irep_idt &) |
Convert a class name to a file name, with OS-dependent syntax. | |
static std::string | class_name_to_jar_file (const irep_idt &) |
Convert a class name to a file name, does the inverse of file_to_class_name. | |
Public Attributes | |
jar_poolt | jar_pool |
a cache for jar_filet, by path name | |
Protected Member Functions | |
std::optional< java_bytecode_parse_treet > | load_class (const irep_idt &class_name, const classpath_entryt &, message_handlert &) |
attempt to load a class from a classpath_entry | |
std::optional< java_bytecode_parse_treet > | get_class_from_jar (const irep_idt &class_name, const std::string &jar_file, message_handlert &) |
attempt to load a class from a given jar file | |
std::optional< java_bytecode_parse_treet > | get_class_from_directory (const irep_idt &class_name, const std::string &path, message_handlert &) |
attempt to load a class from a given directory | |
Protected Attributes | |
std::list< classpath_entryt > | classpath_entries |
List of entries in the classpath. | |
Base class for maintaining classpath.
Definition at line 22 of file java_class_loader_base.h.
void java_class_loader_baset::add_classpath_entry | ( | const std::string & | path, |
message_handlert & | message_handler | ||
) |
Appends an entry to the class path, used for loading classes.
The argument may be 1) The name of a directory, used for searching for .class files 2) The name of a JAR file
Definition at line 22 of file java_class_loader_base.cpp.
Convert a class name to a file name, does the inverse of file_to_class_name.
class_name | the name of the class |
Definition at line 94 of file java_class_loader_base.cpp.
Convert a class name to a file name, with OS-dependent syntax.
class_name | the name of the class |
Definition at line 113 of file java_class_loader_base.cpp.
|
inline |
Clear all classpath entries.
Definition at line 26 of file java_class_loader_base.h.
|
static |
Convert a file name to the class name.
Java interprets folders as packages, therefore a prefix of ./
is removed if necessary, and all /
are converted to .
. For example a class file ./com/diffblue/test.class
is converted to the class name com.diffblue.test
.
file | the name of the class file |
Definition at line 62 of file java_class_loader_base.cpp.
|
protected |
attempt to load a class from a given directory
Load class from directory.
class_name | name of class to load in Java source format |
path | directory to load from |
message_handler | message handler |
Definition at line 193 of file java_class_loader_base.cpp.
|
protected |
attempt to load a class from a given jar file
Load class from jar file.
class_name | name of class to load in Java source format |
jar_file | path of the jar file |
message_handler | message handler |
Definition at line 158 of file java_class_loader_base.cpp.
|
protected |
attempt to load a class from a classpath_entry
Definition at line 135 of file java_class_loader_base.cpp.
|
protected |
List of entries in the classpath.
Definition at line 59 of file java_class_loader_base.h.
jar_poolt java_class_loader_baset::jar_pool |
a cache for jar_filet, by path name
Definition at line 42 of file java_class_loader_base.h.