Class LicenseAnalyst
java.lang.Object
org.apache.creadur.whisker.app.analysis.LicenseAnalyst
Analyses licenses.
-
Constructor Summary
ConstructorDescriptionConstructs empty analyst.LicenseAnalyst
(Collection<org.apache.creadur.whisker.scan.Directory> directories) Analyse the given directories. -
Method Summary
Modifier and TypeMethodDescriptionanalyse
(org.apache.creadur.whisker.model.Descriptor work) Discover discrepancies between meta-data and source directories.Gets duplicate resources.Gets surplus licenses.getIssues
(ResourceDefinitionError ofType) Gets issues by type.Gets missing license.Gets resources whose sources are missing.boolean
isValid()
Were any errors found?toString()
Describes suitably for logging.org.apache.creadur.whisker.model.Descriptor
validate
(org.apache.creadur.whisker.model.Descriptor work) Checks the descriptor against the source directories.
-
Constructor Details
-
LicenseAnalyst
public LicenseAnalyst()Constructs empty analyst. -
LicenseAnalyst
Analyse the given directories.- Parameters:
directories
- not null
-
-
Method Details
-
analyse
Discover discrepancies between meta-data and source directories.- Parameters:
work
- not null- Returns:
- this, not null
-
isValid
public boolean isValid()Were any errors found?- Returns:
- true when the meta-data is valid, false otherwise
-
validate
public org.apache.creadur.whisker.model.Descriptor validate(org.apache.creadur.whisker.model.Descriptor work) throws ResourceDefinitionException Checks the descriptor against the source directories.- Parameters:
work
- not null- Returns:
- valid meta-data
- Throws:
ResourceDefinitionException
- when issues are found
-
getResourcesMissingSources
Gets resources whose sources are missing.- Returns:
- not null, possibly empty
-
getExtraLicenses
Gets surplus licenses.- Returns:
- not null, possibly empty
-
getMissingLicenses
Gets missing license.- Returns:
- not null, possibly empty
-
getDuplicates
Gets duplicate resources.- Returns:
- the duplicates
-
getIssues
Gets issues by type.- Parameters:
ofType
- not null- Returns:
- issues of given type, not null, possibly empty
-
toString
Describes suitably for logging.
-