|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.soebes.maven.plugins.mlv.licenses.LicenseValidator
public class LicenseValidator
This class offers you methods to categorize licenses into the different categories.
Nested Class Summary | |
---|---|
static class |
LicenseValidator.Category
|
Field Summary | |
---|---|
private LicensesContainer |
licensesContainer
Where the licenses are stored. |
private boolean |
strictChecking
|
Constructor Summary | |
---|---|
LicenseValidator(LicensesContainer licensesContainer)
|
Method Summary | |
---|---|
private boolean |
check(List<LicenseItem> checkList,
org.apache.maven.model.License cl)
This will check the given License against the given list of licenses. |
private String |
checkId(List<LicenseItem> checkList,
org.apache.maven.model.License cl)
|
private boolean |
checkNames(LicenseItem item,
org.apache.maven.model.License cl)
Check the given License Name against the CheckLicense which can contain more than one. |
private boolean |
checkNamesAndURLs(LicenseItem item,
org.apache.maven.model.License cl)
This method will check if the given License name and URL is existing in the given CheckLicense class which contains a single License which can be described with multiple names and multiple URL's. |
private boolean |
checkNamesOrURLs(LicenseItem item,
org.apache.maven.model.License cl)
This method will check if the given License name or url is existing in the given CheckLicense class which contains a single License which can be described with multiple names and multiple URL's. |
private boolean |
checkUrls(LicenseItem item,
org.apache.maven.model.License cl)
Check the given License URL against the CheckLicense which can contain more than one. |
List<LicenseItem> |
getInvalid()
This will return the Invalid license list from the license.xml file or an empty list if no such area is defined in the license.xml file. |
String |
getInvalidId(org.apache.maven.model.License cl)
|
ArrayList<String> |
getInvalidIds(ArrayList<org.apache.maven.model.License> licenses)
|
List<LicenseItem> |
getValid()
This will return the valid licenses or an empty List if no such entry in the license.xml file exist. |
String |
getValidId(org.apache.maven.model.License cl)
This will return the Id of the License. |
ArrayList<String> |
getValidIds(ArrayList<org.apache.maven.model.License> licenses)
This method will get the Id's from the valid area of the licenses.xml file. |
List<LicenseItem> |
getWarning()
This will return the list of licenses which are defined in the warning area of the license.xml file or an empty list if no such area has been defined in the license.xml file. |
String |
getWarningId(org.apache.maven.model.License cl)
|
ArrayList<String> |
getWarningIds(ArrayList<org.apache.maven.model.License> licenses)
|
boolean |
isCategory(ArrayList<org.apache.maven.model.License> licenses,
LicenseValidator.Category category)
|
boolean |
isInvalid(ArrayList<org.apache.maven.model.License> licenses)
The given list of licenses has to be part of the invalid
section of the configuration file which means in other word an
conjunction (logical and). |
boolean |
isInvalid(org.apache.maven.model.License cl)
This will check if the given license is part of the invalid
category or not. |
boolean |
isStrictChecking()
|
boolean |
isUnknown(ArrayList<org.apache.maven.model.License> licenses)
TBD: Enhance description A list of licenses will be categorized as Unknown if one or
more licenses can be categorized into different categories. |
boolean |
isUnknown(org.apache.maven.model.License license)
Check if a given license is not part of one the categories invalid, valid or warning. |
boolean |
isValid(ArrayList<org.apache.maven.model.License> licenses)
The given list of licenses has to be part of the valid
section of the configuration file which means in other word an
conjunction (logical and). |
boolean |
isValid(org.apache.maven.model.License cl)
This will check if the given license is part of the valid
licenses or not. |
boolean |
isWarning(ArrayList<org.apache.maven.model.License> licenses)
The given list of licenses has to be part of the warning
section of the configuration file which means in other word an
conjunction (logical and). |
boolean |
isWarning(org.apache.maven.model.License cl)
This will check if the given license is part of the warning
category or not. |
void |
setInvalid(ArrayList<LicenseItem> invalid)
|
void |
setStrictChecking(boolean strictChecking)
|
void |
setValid(List<LicenseItem> valid)
|
void |
setWarning(ArrayList<LicenseItem> warning)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private final LicensesContainer licensesContainer
private boolean strictChecking
Constructor Detail |
---|
public LicenseValidator(LicensesContainer licensesContainer)
Method Detail |
---|
public List<LicenseItem> getValid()
public void setValid(List<LicenseItem> valid)
public List<LicenseItem> getInvalid()
public void setInvalid(ArrayList<LicenseItem> invalid)
public List<LicenseItem> getWarning()
public void setWarning(ArrayList<LicenseItem> warning)
private boolean checkNamesAndURLs(LicenseItem item, org.apache.maven.model.License cl)
item
- The Instance of the CheckLicense class.cl
- The instance of the License to check
private boolean checkNamesOrURLs(LicenseItem item, org.apache.maven.model.License cl)
item
- The Instance of the CheckLicense class.cl
- The instance of the License to check
private boolean check(List<LicenseItem> checkList, org.apache.maven.model.License cl)
checkList
- The list of licenses which will be used to check against.cl
- The license which will be check to be part of the above list.
private String checkId(List<LicenseItem> checkList, org.apache.maven.model.License cl)
public boolean isValid(org.apache.maven.model.License cl)
valid
licenses or not.
cl
- License which will be checked.
public String getValidId(org.apache.maven.model.License cl)
cl
-
public boolean isValid(ArrayList<org.apache.maven.model.License> licenses)
valid
section of the configuration file which means in other word an
conjunction (logical and).
licenses
-
public ArrayList<String> getValidIds(ArrayList<org.apache.maven.model.License> licenses)
licenses
-
public ArrayList<String> getInvalidIds(ArrayList<org.apache.maven.model.License> licenses)
public ArrayList<String> getWarningIds(ArrayList<org.apache.maven.model.License> licenses)
public boolean isInvalid(ArrayList<org.apache.maven.model.License> licenses)
invalid
section of the configuration file which means in other word an
conjunction (logical and).
licenses
-
public boolean isWarning(ArrayList<org.apache.maven.model.License> licenses)
warning
section of the configuration file which means in other word an
conjunction (logical and).
licenses
-
public boolean isUnknown(ArrayList<org.apache.maven.model.License> licenses)
Unknown
if one or
more licenses can be categorized into different categories.
For example if you have a list with three licenses
isValid isWarning isInvalid isUnknown A X B X C X
licenses
- The list with the licenses which will be checked.
public boolean isUnknown(org.apache.maven.model.License license)
license
-
public boolean isInvalid(org.apache.maven.model.License cl)
invalid
category or not.
cl
- License which will be checked.
public String getInvalidId(org.apache.maven.model.License cl)
public boolean isWarning(org.apache.maven.model.License cl)
warning
category or not.
cl
- License which will be checked.
public String getWarningId(org.apache.maven.model.License cl)
private boolean checkUrls(LicenseItem item, org.apache.maven.model.License cl)
item
- The CheckLicense instance which is used to check.cl
- The license which will be checked
private boolean checkNames(LicenseItem item, org.apache.maven.model.License cl)
item
- The CheckLicense instance which is used to check.cl
- The license which will be checked
public boolean isCategory(ArrayList<org.apache.maven.model.License> licenses, LicenseValidator.Category category)
public void setStrictChecking(boolean strictChecking)
public boolean isStrictChecking()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |