Package org.apache.creadur.whisker.model
Class WithLicense
java.lang.Object
org.apache.creadur.whisker.model.WithLicense
- All Implemented Interfaces:
Comparable<WithLicense>
,ContentElement
Groups resources sharing a license and claimed copyright.
-
Constructor Summary
ConstructorDescriptionWithLicense
(License license, String copyrightNotice, Map<String, String> parameters, Collection<ByOrganisation> organisations) Groups resources sharing a license and copyright claim. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Accepts a visit.int
compareTo
(WithLicense other) Based on license.Gets the copyright claim shared by the resources contained.Gets license meta-data shared by the resources contained.getName()
Gets the presentation name for the license shared by the resources contained.Gets resources grouped by responsible organisation.Gets the parameters substituted into the license template when generating the license legalise.getText()
Gets the license legalise shared by the resources contained.getURL()
Gets a locator for the license shared by the resources contained.boolean
Indicates whether a copyright notice accumpianies this license.boolean
Should information about the source distribution of contained resources be included?
-
Constructor Details
-
WithLicense
public WithLicense(License license, String copyrightNotice, Map<String, String> parameters, Collection<ByOrganisation> organisations) Groups resources sharing a license and copyright claim.- Parameters:
license
- License shared by contained resources, not nullcopyrightNotice
- copyright claim shared by contained resources, possibly nullparameters
- parameters to specialise the license family template, not nullorganisations
- resources grouped by responsible organisation, not null
-
-
Method Details
-
getCopyrightNotice
Gets the copyright claim shared by the resources contained.- Returns:
- possibly null
-
hasCopyrightNotice
public boolean hasCopyrightNotice()Indicates whether a copyright notice accumpianies this license.- Returns:
- true when
getCopyrightNotice()
is not null, false whengetCopyrightNotice()
is null
-
getName
Gets the presentation name for the license shared by the resources contained.- Returns:
- not null
-
getURL
Gets a locator for the license shared by the resources contained.- Returns:
- not null
-
getLicense
Gets license meta-data shared by the resources contained.- Returns:
- not null
-
getText
Gets the license legalise shared by the resources contained. Computed by applying the parameters to the license template.- Returns:
- not null
- Throws:
LicenseTemplateException
- when the license text cannot be generated from the template
-
getOrganisations
Gets resources grouped by responsible organisation.- Returns:
- not null
-
getParameters
Gets the parameters substituted into the license template when generating the license legalise.- Returns:
- not null
-
compareTo
Based on license.- Specified by:
compareTo
in interfaceComparable<WithLicense>
- Parameters:
other
- possibly null- Returns:
- license comparison
- See Also:
-
accept
Accepts a visit.- Specified by:
accept
in interfaceContentElement
- Parameters:
visitor
- possibly null
-
isSourceRequired
public boolean isSourceRequired()Should information about the source distribution of contained resources be included?- Returns:
- true when license asks that information about the source distribution is included, false otherwise
-