Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 9098f377c22306916e17943b11a417983f78210c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
/*******************************************************************************
 * Copyright (c) 2008 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/
package org.eclipse.equinox.internal.p2.metadata;

import java.net.URI;
import org.eclipse.equinox.internal.provisional.p2.metadata.ICopyright;

/**
 * The <code>Copyright</code> class represents a software copyright.  A copyright has 
 * required body text which may be the full text or a summary.  An optional location field can be specified
 * which links to full text.  
 */
public class Copyright implements ICopyright {
	/**
	 * The <code>body</code> contains the descriptive text for the copyright. This may
	 * be a summary for a copyright specified in a URL.
	 */
	private final String body;

	/**
	 * The <code>location</code> is the location of a document containing a copyright notice.
	 */
	private URI location;

	/**
	 * Creates a new copyright. The body must contain the full text of the copyright.
	 * 
	 * @param location the location of a document containing the copyright notice, or <code>null</code>
	 * @param body the copyright body, cannot be <code>null</code>
	 * @throws IllegalArgumentException when the <code>body</code> is <code>null</code>
	 */
	public Copyright(URI location, String body) {
		if (body == null)
			throw new IllegalArgumentException("body cannot be null"); //$NON-NLS-1$
		this.location = location;
		this.body = body;
	}

	/**
	 * Returns the location of a document containing the copyright notice.
	 * 
	 * @return The location of the copyright notice, or <code>null</code>
	 */
	public URI getLocation() {
		return location;
	}

	/**
	 * Returns the license body.
	 * 
	 * @return the license body, never <code>null</code>
	 */
	public String getBody() {
		return body;
	}
}

Back to the top