You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@creadur.apache.org by rd...@apache.org on 2012/05/20 17:51:34 UTC
svn commit: r1340756 -
/creadur/whisker/trunk/apache-whisker-model/src/main/java/org/apache/creadur/whisker/model/WithLicense.java
Author: rdonkin
Date: Sun May 20 15:51:33 2012
New Revision: 1340756
URL: http://svn.apache.org/viewvc?rev=1340756&view=rev
Log:
Fixed some checkstyle violations
Modified:
creadur/whisker/trunk/apache-whisker-model/src/main/java/org/apache/creadur/whisker/model/WithLicense.java
Modified: creadur/whisker/trunk/apache-whisker-model/src/main/java/org/apache/creadur/whisker/model/WithLicense.java
URL: http://svn.apache.org/viewvc/creadur/whisker/trunk/apache-whisker-model/src/main/java/org/apache/creadur/whisker/model/WithLicense.java?rev=1340756&r1=1340755&r2=1340756&view=diff
==============================================================================
--- creadur/whisker/trunk/apache-whisker-model/src/main/java/org/apache/creadur/whisker/model/WithLicense.java (original)
+++ creadur/whisker/trunk/apache-whisker-model/src/main/java/org/apache/creadur/whisker/model/WithLicense.java Sun May 20 15:51:33 2012
@@ -23,18 +23,29 @@ import java.util.Collections;
import java.util.Map;
/**
- *
+ * Groups resources sharing a license and claimed copyright.
*/
public class WithLicense implements Comparable<WithLicense> {
+ /** License shared by contained resources, not null. */
private final License license;
+ /** Resources grouped by responsible organisation. */
private final Collection<ByOrganisation> organisations;
+ /** Copyright claim shared by contained resources. */
private final String copyrightNotice;
+ /** Parameters to specialise the license family template. */
private final Map<String, String> parameters;
/**
- * @param license
- * @param element
+ * Groups resources sharing a license and copyright claim.
+ * @param license License shared by contained resources,
+ * not null
+ * @param copyrightNotice copyright claim
+ * shared by contained resources, not null
+ * @param parameters parameters to specialise
+ * the license family template, not null
+ * @param organisations resources grouped by
+ * responsible organisation, not null
*/
public WithLicense(final License license, final String copyrightNotice,
final Map<String, String> parameters,
@@ -46,43 +57,84 @@ public class WithLicense implements Comp
this.organisations = Collections.unmodifiableCollection(organisations);
}
+ /**
+ * Gets the copyright claim shared
+ * by the resources contained.
+ * @return not null
+ */
public String getCopyrightNotice() {
return this.copyrightNotice;
}
+ /**
+ * Gets the presentation name for the license
+ * shared by the resources contained.
+ * @return not null
+ */
public String getName() {
return this.license.getName();
}
+ /**
+ * Gets a locator for the license
+ * shared by the resources contained.
+ * @return not null
+ */
public String getURL() {
return this.license.getURL();
}
+ /**
+ * Gets license meta-data shared by the resources
+ * contained.
+ * @return not null
+ */
public License getLicense() {
return this.license;
}
+ /**
+ * Gets the license legalise shared by the resources
+ * contained. Computed by applying the parameters
+ * to the license template.
+ * @return not null
+ * @throws LicenseTemplateException when the license
+ * text cannot be generated from the template
+ */
public String getText() throws LicenseTemplateException {
return this.license.getText(this.parameters);
}
+ /**
+ * Gets resources grouped by responsible organisation.
+ * @return not null
+ */
public Collection<ByOrganisation> getOrganisations() {
return this.organisations;
}
+ /**
+ * Gets the parameters substituted into the license
+ * template when generating the license legalise.
+ * @return not null
+ */
public Map<String, String> getParameters() {
return this.parameters;
}
/**
+ * Based on license.
* @see java.lang.Comparable#compareTo(java.lang.Object)
+ * @param other possibly null
+ * @return license comparison
*/
public int compareTo(final WithLicense other) {
return this.license.compareTo(other.getLicense());
}
/**
- * @param visitor
+ * Accepts a visit.
+ * @param visitor possibly null
*/
public void accept(final Visitor visitor) {
if (visitor != null && visitor.traverseWithLicense()) {
@@ -94,10 +146,13 @@ public class WithLicense implements Comp
}
/**
- * @return
+ * Should information about the source distribution of
+ * contained resources be included?
+ * @return true when license asks that information
+ * about the source distribution is included,
+ * false otherwise
*/
public boolean isSourceRequired() {
return this.license.isSourceRequired();
}
-
}