Skip to content

Commit

Permalink
mjson seems to be abandoned, so it has been replaced by
Browse files Browse the repository at this point in the history
everit-json-schema
  • Loading branch information
Manuel Domínguez Dorado committed Feb 13, 2022
1 parent 6fccd52 commit 13e2478
Show file tree
Hide file tree
Showing 18 changed files with 655 additions and 46 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

import com.manolodominguez.openlrae.analysis.RiskAnalysisResult;
import com.manolodominguez.openlrae.baseofknowledge.basevalues.SupportedRisks;
import com.manolodominguez.openlrae.arquitecture.SwProject;
import com.manolodominguez.openlrae.arquitecture.Project;
import com.manolodominguez.openlrae.i18n.ILanguageChangeEventEmitter;
import com.manolodominguez.openlrae.i18n.ILanguageChangeListener;
import com.manolodominguez.openlrae.i18n.LanguageChangeEvent;
Expand All @@ -46,7 +46,7 @@
public abstract class AbstractRiskAnalyser implements ILanguageChangeEventEmitter, ILanguageChangeListener {

protected Logger logger;
protected SwProject project = null;
protected Project project = null;
protected SupportedRisks handledRiskType;
protected float riskExposure;
protected float riskImpact;
Expand All @@ -64,7 +64,7 @@ public abstract class AbstractRiskAnalyser implements ILanguageChangeEventEmitte
* @param project The software project to be analised.
* @param handledRiskType The type of risk the subclass addresses.
*/
protected AbstractRiskAnalyser(SwProject project, SupportedRisks handledRiskType) {
protected AbstractRiskAnalyser(Project project, SupportedRisks handledRiskType) {
logger = LoggerFactory.getLogger(AbstractRiskAnalyser.class);
if (project == null) {
logger.error("Project cannot be null");
Expand Down Expand Up @@ -103,7 +103,7 @@ private void reset() {
*
* @return the project on wich the risk analysis is going to be done.
*/
public SwProject getProject() {
public Project getProject() {
return project;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
import com.manolodominguez.openlrae.baseofknowledge.basevalues.SupportedCompatibilities;
import com.manolodominguez.openlrae.baseofknowledge.basevalues.SupportedRisks;
import com.manolodominguez.openlrae.baseofknowledge.licenseproperties.LicensesCompatibilityFactory;
import com.manolodominguez.openlrae.arquitecture.SwProject;
import com.manolodominguez.openlrae.arquitecture.Project;
import com.manolodominguez.openlrae.arquitecture.ComponentBinding;
import com.manolodominguez.openlrae.baseofknowledge.basevalues.SupportedLicenses;
import com.manolodominguez.openlrae.i18n.LanguageChangeEvent;
Expand Down Expand Up @@ -75,7 +75,7 @@ public class RiskAnalyserComponentsLicensesIncompatibleWithProjectLicenses exten
*
* @param project. The software project to be analised.
*/
public RiskAnalyserComponentsLicensesIncompatibleWithProjectLicenses(SwProject project) {
public RiskAnalyserComponentsLicensesIncompatibleWithProjectLicenses(Project project) {
// Project is checked at superclass
super(project, SupportedRisks.HAVING_COMPONENTS_LICENSES_INCOMPATIBLE_WITH_PROJECT_LICENSES);
logger = LoggerFactory.getLogger(RiskAnalyserComponentsLicensesIncompatibleWithProjectLicenses.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
package com.manolodominguez.openlrae.analysis.riskanalysers;

import com.manolodominguez.openlrae.baseofknowledge.basevalues.SupportedRisks;
import com.manolodominguez.openlrae.arquitecture.SwProject;
import com.manolodominguez.openlrae.arquitecture.Project;
import com.manolodominguez.openlrae.arquitecture.ComponentBinding;
import com.manolodominguez.openlrae.baseofknowledge.basevalues.SupportedLicenses;
import com.manolodominguez.openlrae.i18n.LanguageChangeEvent;
Expand Down Expand Up @@ -71,7 +71,7 @@ public class RiskAnalyserComponentsLicensesMisalignedFromProjectLicenses extends
*
* @param project. The software project to be analised.
*/
public RiskAnalyserComponentsLicensesMisalignedFromProjectLicenses(SwProject project) {
public RiskAnalyserComponentsLicensesMisalignedFromProjectLicenses(Project project) {
// Project is ckecked at superclass
super(project, SupportedRisks.HAVING_COMPONENTS_LICENSES_MISALIGNED_FROM_PROJECT_LICENSES);
logger = LoggerFactory.getLogger(RiskAnalyserComponentsLicensesMisalignedFromProjectLicenses.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
package com.manolodominguez.openlrae.analysis.riskanalysers;

import com.manolodominguez.openlrae.baseofknowledge.basevalues.SupportedRisks;
import com.manolodominguez.openlrae.arquitecture.SwProject;
import com.manolodominguez.openlrae.arquitecture.Project;
import com.manolodominguez.openlrae.arquitecture.ComponentBinding;
import com.manolodominguez.openlrae.baseofknowledge.basevalues.SupportedLicenses;
import com.manolodominguez.openlrae.i18n.LanguageChangeEvent;
Expand Down Expand Up @@ -82,7 +82,7 @@ public class RiskAnalyserHeterogeneousComponentsLicenses extends AbstractRiskAna
*
* @param project. The software project to be analised.
*/
public RiskAnalyserHeterogeneousComponentsLicenses(SwProject project) {
public RiskAnalyserHeterogeneousComponentsLicenses(Project project) {
// Project is ckecked at superclass
super(project, SupportedRisks.HAVING_HETEROGENEOUS_COMPONENTS_LICENSES);
logger = LoggerFactory.getLogger(RiskAnalyserHeterogeneousComponentsLicenses.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
import com.manolodominguez.openlrae.baseofknowledge.basevalues.SupportedLicenses;
import com.manolodominguez.openlrae.baseofknowledge.basevalues.SupportedRisks;
import com.manolodominguez.openlrae.baseofknowledge.licenseproperties.LicensesCompatibilityFactory;
import com.manolodominguez.openlrae.arquitecture.SwProject;
import com.manolodominguez.openlrae.arquitecture.Project;
import com.manolodominguez.openlrae.baseofknowledge.basevalues.SupportedComponentWeights;
import com.manolodominguez.openlrae.baseofknowledge.basevalues.SupportedLinks;
import com.manolodominguez.openlrae.i18n.LanguageChangeEvent;
Expand Down Expand Up @@ -81,7 +81,7 @@ public class RiskAnalyserLimitedSetOfPotentialComponentsLicenses extends Abstrac
*
* @param project. The software project to be analised.
*/
public RiskAnalyserLimitedSetOfPotentialComponentsLicenses(SwProject project) {
public RiskAnalyserLimitedSetOfPotentialComponentsLicenses(Project project) {
// Project is ckecked at superclass
super(project, SupportedRisks.HAVING_A_LIMITED_SET_OF_POTENTIAL_COMPONENTS_LICENSES);
logger = LoggerFactory.getLogger(RiskAnalyserLimitedSetOfPotentialComponentsLicenses.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import com.manolodominguez.openlrae.baseofknowledge.basevalues.SupportedLicenses;
import com.manolodominguez.openlrae.baseofknowledge.basevalues.SupportedRisks;
import com.manolodominguez.openlrae.baseofknowledge.licenseproperties.LicensesCompatibilityFactory;
import com.manolodominguez.openlrae.arquitecture.SwProject;
import com.manolodominguez.openlrae.arquitecture.Project;
import com.manolodominguez.openlrae.arquitecture.ComponentBinding;
import com.manolodominguez.openlrae.i18n.LanguageChangeEvent;
import com.manolodominguez.openlrae.i18n.Translations;
Expand Down Expand Up @@ -76,7 +76,7 @@ public class RiskAnalyserLimitedSetOfPotentialProjectLicenses extends AbstractRi
*
* @param project. The software project to be analised.
*/
public RiskAnalyserLimitedSetOfPotentialProjectLicenses(SwProject project) {
public RiskAnalyserLimitedSetOfPotentialProjectLicenses(Project project) {
// Project is ckecked at superclass
super(project, SupportedRisks.HAVING_A_LIMITED_SET_OF_POTENTIAL_PROJECT_LICENSES);
logger = LoggerFactory.getLogger(RiskAnalyserLimitedSetOfPotentialProjectLicenses.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
import com.manolodominguez.openlrae.baseofknowledge.basevalues.SupportedObsolescences;
import com.manolodominguez.openlrae.baseofknowledge.basevalues.SupportedRisks;
import com.manolodominguez.openlrae.baseofknowledge.licenseproperties.LicensesObsolescencesFactory;
import com.manolodominguez.openlrae.arquitecture.SwProject;
import com.manolodominguez.openlrae.arquitecture.Project;
import com.manolodominguez.openlrae.arquitecture.ComponentBinding;
import com.manolodominguez.openlrae.i18n.LanguageChangeEvent;
import com.manolodominguez.openlrae.i18n.Translations;
Expand Down Expand Up @@ -71,7 +71,7 @@ public class RiskAnalyserObsoleteComponentsLicenses extends AbstractRiskAnalyser
*
* @param project. The software project to be analised.
*/
public RiskAnalyserObsoleteComponentsLicenses(SwProject project) {
public RiskAnalyserObsoleteComponentsLicenses(Project project) {
// Project is ckecked at superclass
super(project, SupportedRisks.HAVING_OBSOLETE_COMPONENTS_LICENSES);
logger = LoggerFactory.getLogger(RiskAnalyserObsoleteComponentsLicenses.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
import com.manolodominguez.openlrae.baseofknowledge.basevalues.SupportedObsolescences;
import com.manolodominguez.openlrae.baseofknowledge.basevalues.SupportedRisks;
import com.manolodominguez.openlrae.baseofknowledge.licenseproperties.LicensesObsolescencesFactory;
import com.manolodominguez.openlrae.arquitecture.SwProject;
import com.manolodominguez.openlrae.arquitecture.Project;
import com.manolodominguez.openlrae.baseofknowledge.basevalues.SupportedLicenses;
import com.manolodominguez.openlrae.i18n.LanguageChangeEvent;
import com.manolodominguez.openlrae.i18n.Translations;
Expand Down Expand Up @@ -69,7 +69,7 @@ public class RiskAnalyserObsoleteProjectLicenses extends AbstractRiskAnalyser {
*
* @param project. The software project to be analised.
*/
public RiskAnalyserObsoleteProjectLicenses(SwProject project) {
public RiskAnalyserObsoleteProjectLicenses(Project project) {
// Project is ckecked at superclass
super(project, SupportedRisks.HAVING_OBSOLETE_PROJECT_LICENSES);
logger = LoggerFactory.getLogger(RiskAnalyserObsoleteProjectLicenses.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
import com.manolodominguez.openlrae.baseofknowledge.basevalues.SupportedRisks;
import com.manolodominguez.openlrae.baseofknowledge.basevalues.SupportedSpreadings;
import com.manolodominguez.openlrae.baseofknowledge.licenseproperties.LicensesSpreadingFactory;
import com.manolodominguez.openlrae.arquitecture.SwProject;
import com.manolodominguez.openlrae.arquitecture.Project;
import com.manolodominguez.openlrae.arquitecture.ComponentBinding;
import com.manolodominguez.openlrae.i18n.LanguageChangeEvent;
import com.manolodominguez.openlrae.i18n.Translations;
Expand Down Expand Up @@ -72,7 +72,7 @@ public class RiskAnalyserScarcelySpreadComponentsLicenses extends AbstractRiskAn
*
* @param project. The software project to be analised.
*/
public RiskAnalyserScarcelySpreadComponentsLicenses(SwProject project) {
public RiskAnalyserScarcelySpreadComponentsLicenses(Project project) {
// Project is ckecked at superclass
super(project, SupportedRisks.HAVING_SCARCELY_SPREAD_COMPONENTS_LICENSES);
logger = LoggerFactory.getLogger(RiskAnalyserScarcelySpreadComponentsLicenses.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
package com.manolodominguez.openlrae.analysis.riskanalysers;

import com.manolodominguez.openlrae.baseofknowledge.basevalues.SupportedRisks;
import com.manolodominguez.openlrae.arquitecture.SwProject;
import com.manolodominguez.openlrae.arquitecture.Project;
import com.manolodominguez.openlrae.baseofknowledge.basevalues.SupportedLicenses;
import com.manolodominguez.openlrae.baseofknowledge.basevalues.SupportedSpreadings;
import com.manolodominguez.openlrae.baseofknowledge.licenseproperties.LicensesSpreadingFactory;
Expand Down Expand Up @@ -69,7 +69,7 @@ public class RiskAnalyserScarcelySpreadProjectLicenses extends AbstractRiskAnaly
*
* @param project. The software project to be analised.
*/
public RiskAnalyserScarcelySpreadProjectLicenses(SwProject project) {
public RiskAnalyserScarcelySpreadProjectLicenses(Project project) {
// Project is ckecked at superclass
super(project, SupportedRisks.HAVING_SCARCELY_SPREAD_PROJECT_LICENSES);
logger = LoggerFactory.getLogger(RiskAnalyserScarcelySpreadProjectLicenses.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
import com.manolodominguez.openlrae.baseofknowledge.basevalues.SupportedRisks;
import com.manolodominguez.openlrae.baseofknowledge.basevalues.SupportedTrends;
import com.manolodominguez.openlrae.baseofknowledge.licenseproperties.LicensesTrendFactory;
import com.manolodominguez.openlrae.arquitecture.SwProject;
import com.manolodominguez.openlrae.arquitecture.Project;
import com.manolodominguez.openlrae.arquitecture.ComponentBinding;
import com.manolodominguez.openlrae.i18n.LanguageChangeEvent;
import com.manolodominguez.openlrae.i18n.Translations;
Expand Down Expand Up @@ -71,7 +71,7 @@ public class RiskAnalyserUnfashionableComponentsLicenses extends AbstractRiskAna
*
* @param project. The software project to be analised.
*/
public RiskAnalyserUnfashionableComponentsLicenses(SwProject project) {
public RiskAnalyserUnfashionableComponentsLicenses(Project project) {
// Project is ckecked at superclass
super(project, SupportedRisks.HAVING_UNFASHIONABLE_COMPONENTS_LICENSES);
logger = LoggerFactory.getLogger(RiskAnalyserUnfashionableComponentsLicenses.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
package com.manolodominguez.openlrae.analysis.riskanalysers;

import com.manolodominguez.openlrae.baseofknowledge.basevalues.SupportedRisks;
import com.manolodominguez.openlrae.arquitecture.SwProject;
import com.manolodominguez.openlrae.arquitecture.Project;
import com.manolodominguez.openlrae.baseofknowledge.basevalues.SupportedLicenses;
import com.manolodominguez.openlrae.baseofknowledge.basevalues.SupportedTrends;
import com.manolodominguez.openlrae.baseofknowledge.licenseproperties.LicensesTrendFactory;
Expand Down Expand Up @@ -68,7 +68,7 @@ public class RiskAnalyserUnfashionableProjectLicenses extends AbstractRiskAnalys
*
* @param project. The software project to be analised.
*/
public RiskAnalyserUnfashionableProjectLicenses(SwProject project) {
public RiskAnalyserUnfashionableProjectLicenses(Project project) {
// Project is ckecked at superclass
super(project, SupportedRisks.HAVING_UNFASHIONABLE_PROJECT_LICENSES);
logger = LoggerFactory.getLogger(RiskAnalyserUnfashionableProjectLicenses.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@
*
* @author Manuel Domínguez Dorado - [email protected]
*/
public class SwProject implements ILanguageChangeEventEmitter, ILanguageChangeListener {
public class Project implements ILanguageChangeEventEmitter, ILanguageChangeListener {

private Logger logger = LoggerFactory.getLogger(SwProject.class);
private Logger logger = LoggerFactory.getLogger(Project.class);

private String name;
private String version;
Expand Down Expand Up @@ -93,7 +93,7 @@ public class SwProject implements ILanguageChangeEventEmitter, ILanguageChangeLi
* add additional component bindings, you have to use
* addComponentBinding(...) method.
*/
public SwProject(String name, String version, SupportedLicenses firstLicense, SupportedRedistributions redistribution, ComponentBinding firstComponentBinding) {
public Project(String name, String version, SupportedLicenses firstLicense, SupportedRedistributions redistribution, ComponentBinding firstComponentBinding) {
if (name == null) {
logger.error("name cannot be null");
throw new IllegalArgumentException("name cannot be null");
Expand Down Expand Up @@ -151,7 +151,7 @@ public SwProject(String name, String version, SupportedLicenses firstLicense, Su
* @param projectDefinitionAsJSONString a JSON project definition as a
* String.
*/
public SwProject(String projectDefinitionAsJSONString) {
public Project(String projectDefinitionAsJSONString) {
if (projectDefinitionAsJSONString == null) {
logger.error("projectDefinitionAsJSONString cannot be null");
throw new IllegalArgumentException("projectDefinitionAsJSONString cannot be null");
Expand Down Expand Up @@ -184,7 +184,7 @@ public SwProject(String projectDefinitionAsJSONString) {
*
* @param projectDefinitionURL a URL containing a JSON project definition.
*/
public SwProject(URL projectDefinitionURL) {
public Project(URL projectDefinitionURL) {
if (projectDefinitionURL == null) {
logger.error("projectDefinition URL cannot be null");
throw new IllegalArgumentException("projectDefinition URL cannot be null");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
import com.manolodominguez.openlrae.analysis.riskanalysers.RiskAnalyserUnfashionableProjectLicenses;
import com.manolodominguez.openlrae.analysis.riskanalysers.RiskAnalyserComponentsLicensesMisalignedFromProjectLicenses;
import com.manolodominguez.openlrae.analysis.riskanalysers.RiskAnalyserHeterogeneousComponentsLicenses;
import com.manolodominguez.openlrae.arquitecture.SwProject;
import com.manolodominguez.openlrae.arquitecture.Project;
import com.manolodominguez.openlrae.baseofknowledge.basevalues.SupportedCompatibilities;
import com.manolodominguez.openlrae.baseofknowledge.basevalues.SupportedComponentWeights;
import com.manolodominguez.openlrae.baseofknowledge.basevalues.SupportedLicenses;
Expand Down Expand Up @@ -134,7 +134,7 @@ public void runAnalysis(String fileName) {
} else {
try {

SwProject project = new SwProject(file.toURI().toURL());
Project project = new Project(file.toURI().toURL());
// Define desired risk analysers we want to use for this project
RiskAnalyserLimitedSetOfPotentialProjectLicenses riskAnalyser1 = new RiskAnalyserLimitedSetOfPotentialProjectLicenses(project);
RiskAnalyserObsoleteComponentsLicenses riskAnalyser2 = new RiskAnalyserObsoleteComponentsLicenses(project);
Expand Down Expand Up @@ -206,7 +206,7 @@ public void runExample() {
}
// Define the project. In this case, it is defined from a JSON file.
URL projectURL = getClass().getResource(FilesPaths.PROJECT_EXAMPLE.getFilePath());
SwProject project = new SwProject(projectURL);
Project project = new Project(projectURL);

// Define desired risk analysers we want to use for this project
RiskAnalyserLimitedSetOfPotentialProjectLicenses riskAnalyser1 = new RiskAnalyserLimitedSetOfPotentialProjectLicenses(project);
Expand Down
Loading

0 comments on commit 13e2478

Please sign in to comment.