-
-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Removed setAuthors, moved manufacurer to component section
Signed-off-by: Björn Kornefalk <bjorn.kornefalk@gi-de.com>
- Loading branch information
Showing
5 changed files
with
191 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
69 changes: 69 additions & 0 deletions
69
src/main/java/org/cyclonedx/maven/DeveloperInformation.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
/* | ||
* Copyright (c) Giesecke+Devrient Mobile Security GmbH 2018-2024 | ||
*/ | ||
package org.cyclonedx.maven; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
import org.cyclonedx.model.OrganizationalContact; | ||
|
||
/** | ||
* Help class for parse a list of developers | ||
*/ | ||
class DeveloperInformation { | ||
|
||
private final List<OrganizationalContact> contacts = new ArrayList<>(); | ||
private String organization; | ||
private final List<String> urls = new ArrayList<>(); | ||
|
||
/** | ||
* Add contact information | ||
* | ||
* @param contact The contact | ||
*/ | ||
void addOrganizationalContact(OrganizationalContact contact) { | ||
contacts.add(contact); | ||
} | ||
|
||
/** | ||
* If Maven section "<organization>" is missing, see if we can find any organization information from | ||
* a developers section | ||
* @param organization The organization name | ||
*/ | ||
void setOrganization(String organization) { | ||
if (this.organization == null && organization != null) { | ||
this.organization = organization; | ||
} | ||
} | ||
|
||
/** | ||
* Add a defined url | ||
* @param url The url | ||
*/ | ||
void addUrl(String url) { | ||
if (url != null) { | ||
urls.add(url); | ||
} | ||
} | ||
|
||
/** | ||
* @return List of contacts | ||
*/ | ||
public List<OrganizationalContact> getContacts() { | ||
return contacts; | ||
} | ||
|
||
/** | ||
* @return First organization name if found | ||
*/ | ||
public String getOrganization() { | ||
return organization; | ||
} | ||
|
||
/** | ||
* @return List of configured urls | ||
*/ | ||
public List<String> getUrls() { | ||
return urls; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters