org.apache.creadur.whisker.model
public class Descriptor extends Object
Constructor and Description |
---|
Descriptor(License primaryLicense,
String primaryOrganisationId,
String primaryNotice,
Map<String,License> licenses,
Map<String,String> notices,
Map<String,Organisation> organisations,
Collection<WithinDirectory> contents)
Constructs a description of the expected licensing qualities of a
distribution, with no additional primary copyright notice.
|
Descriptor(License primaryLicense,
String primaryCopyrightNotice,
String primaryOrganisationId,
String primaryNotice,
Map<String,License> licenses,
Map<String,String> notices,
Map<String,Organisation> organisations,
Collection<WithinDirectory> contents)
Constructs a description of the expected licensing qualities of a
distribution, with a primary additional copyright notice.
|
Modifier and Type | Method and Description |
---|---|
Collection<WithinDirectory> |
getContents()
Gets the contents expected in the distribution.
|
Map<String,Organisation> |
getOrganisations()
Gets the organisations described.
|
Set<String> |
getOtherNotices()
Collates NOTICE meta-data not linked to any resource.
|
String |
getPrimaryCopyrightNotice()
Gets an additional copyright notice needed
for some primary licenses.
|
License |
getPrimaryLicense()
Gets the principle license under which the work is licensed.
|
String |
getPrimaryNotice()
Gets the principle NOTICE for the main work.
|
Map<String,Collection<Resource>> |
getResourceNotices()
Collates NOTICE meta-data for resources.
|
boolean |
isNoticeRequired()
Is a NOTICE document required?
|
boolean |
isOnlyPrimary(ContentElement contentElement)
Is this collection of resources expected to contain only material
licensed under the primary license by the
primary organisation with the primary copyright notice?
|
boolean |
isPrimary(ByOrganisation byOrganisation)
Is the given individual or group the principle organisation with
responsibility for the main work.
|
boolean |
isPrimary(License license)
Is the given license the principle license for the main work?
|
boolean |
isPrimaryCopyrightNotice()
Is there a primary copyright notice?
|
boolean |
isPrimaryOnly()
Is this the work of the primary organisation only?
|
License |
license(String id)
Gets the license with the given id.
|
boolean |
primaryNoticeExists()
Does the work described have a primary notice?
|
boolean |
resourceNoticesExist()
Does any resource have a required notice?
|
void |
traverse(Visitor visitor)
Traverses the content directories.
|
void |
traverseDirectory(Visitor visitor,
String directoryName)
Traverses the given directory.
|
public Descriptor(License primaryLicense, String primaryOrganisationId, String primaryNotice, Map<String,License> licenses, Map<String,String> notices, Map<String,Organisation> organisations, Collection<WithinDirectory> contents)
primaryLicense
- not nullprimaryOrganisationId
- not nullprimaryNotice
- possibly nulllicenses
- not null, possibly emptynotices
- not null, possibly emptyorganisations
- not null, possibly emptycontents
- not null, possibly emptypublic Descriptor(License primaryLicense, String primaryCopyrightNotice, String primaryOrganisationId, String primaryNotice, Map<String,License> licenses, Map<String,String> notices, Map<String,Organisation> organisations, Collection<WithinDirectory> contents)
primaryLicense
- not nullprimaryCopyrightNotice
- optional primary copyright notice, possibly nullprimaryOrganisationId
- not nullprimaryNotice
- possibly nulllicenses
- not null, possibly emptynotices
- not null, possibly emptyorganisations
- not null, possibly emptycontents
- not null, possibly emptypublic String getPrimaryCopyrightNotice()
public boolean isPrimaryCopyrightNotice()
public String getPrimaryNotice()
public Map<String,Collection<Resource>> getResourceNotices()
public Map<String,Organisation> getOrganisations()
public Set<String> getOtherNotices()
public License license(String id)
id
- not nullpublic License getPrimaryLicense()
public Collection<WithinDirectory> getContents()
public boolean isPrimary(License license)
license
- not nullpublic boolean isPrimary(ByOrganisation byOrganisation)
byOrganisation
- not nullpublic boolean isOnlyPrimary(ContentElement contentElement)
contentElement
- not nullpublic void traverse(Visitor visitor)
visitor
- possibly nullpublic void traverseDirectory(Visitor visitor, String directoryName)
visitor
- possibly nulldirectoryName
- not nullpublic boolean isNoticeRequired()
public boolean resourceNoticesExist()
public boolean primaryNoticeExists()
public boolean isPrimaryOnly()
Copyright © 2011-2013 Apache Software Foundation. All Rights Reserved.