mirror of
https://github.com/ysoftdevs/DependencyCheck.git
synced 2026-03-24 18:11:47 +01:00
added counts for imported quantities
Former-commit-id: f3ceb36af76814dac70175126b1e10f32d5aef69
This commit is contained in:
@@ -67,6 +67,34 @@ public class NvdCve20Handler extends DefaultHandler {
|
|||||||
*/
|
*/
|
||||||
private boolean hasApplicationCpe = false;
|
private boolean hasApplicationCpe = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The total number of entries parsed.
|
||||||
|
*/
|
||||||
|
private int totalNumberOfEntries;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the value of totalNumberOfEntries.
|
||||||
|
*
|
||||||
|
* @return the value of totalNumberOfEntries
|
||||||
|
*/
|
||||||
|
public int getTotalNumberOfEntries() {
|
||||||
|
return totalNumberOfEntries;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The total number of application entries parsed.
|
||||||
|
*/
|
||||||
|
private int totalNumberOfApplicationEntries;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the value of totalNumberOfApplicationEntries.
|
||||||
|
*
|
||||||
|
* @return the value of totalNumberOfApplicationEntries
|
||||||
|
*/
|
||||||
|
public int getTotalNumberOfApplicationEntries() {
|
||||||
|
return totalNumberOfApplicationEntries;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException {
|
public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException {
|
||||||
current.setNode(qName);
|
current.setNode(qName);
|
||||||
@@ -125,7 +153,9 @@ public class NvdCve20Handler extends DefaultHandler {
|
|||||||
public void endElement(String uri, String localName, String qName) throws SAXException {
|
public void endElement(String uri, String localName, String qName) throws SAXException {
|
||||||
current.setNode(qName);
|
current.setNode(qName);
|
||||||
if (current.isEntryNode()) {
|
if (current.isEntryNode()) {
|
||||||
|
totalNumberOfEntries += 1;
|
||||||
if (hasApplicationCpe) {
|
if (hasApplicationCpe) {
|
||||||
|
totalNumberOfApplicationEntries += 1;
|
||||||
try {
|
try {
|
||||||
saveEntry(vulnerability);
|
saveEntry(vulnerability);
|
||||||
} catch (DatabaseException ex) {
|
} catch (DatabaseException ex) {
|
||||||
|
|||||||
Reference in New Issue
Block a user