ppt4j 1.0
 
Loading...
Searching...
No Matches
ppt4j.factory.DatabaseFactory Class Reference

Classes

class  MemoryClassLoader
 
class  MemoryJavaFileManager
 

Static Public Member Functions

static Vulnerability makeDataset (@NonNull VulnerabilityInfo info)
 
static Vulnerability makeDataset (InputStream jsonInput) throws IOException
 
static Vulnerability getByDatabaseId (int id)
 

Member Function Documentation

◆ getByDatabaseId()

static Vulnerability ppt4j.factory.DatabaseFactory.getByDatabaseId ( int id)
static

Retrieves a Vulnerability object by its database id. If the Vulnerability object is already cached, it is returned from the cache. If the object is not cached, it is read from a JSON file using the id and returned as a Vulnerability object.

Parameters
idThe database id of the Vulnerability
Returns
A Vulnerability object with the specified id
Exceptions
IllegalStateExceptionif the JSON file is not found or if an IOException occurs during processing

◆ makeDataset() [1/2]

static Vulnerability ppt4j.factory.DatabaseFactory.makeDataset ( @NonNull VulnerabilityInfo info)
static

Creates a Vulnerability instance using the provided VulnerabilityInfo object, compiles and loads the instance, and adds it to the cached classes by Database ID and CVE ID. If a Vulnerability with the same Database ID or CVE ID already exists in the cache, an IllegalStateException is thrown.

Parameters
infothe VulnerabilityInfo object used to create the Vulnerability instance
Returns
the created Vulnerability instance

◆ makeDataset() [2/2]

static Vulnerability ppt4j.factory.DatabaseFactory.makeDataset ( InputStream jsonInput) throws IOException
static

Reads a JSON input stream and creates a Vulnerability object based on the information provided.

Parameters
jsonInputthe input stream containing JSON data
Returns
a Vulnerability object created from the JSON input
Exceptions
IOExceptionif an I/O error occurs while reading the input stream

The documentation for this class was generated from the following file: