blob: 9ce6be80430449a6ac143ba7a7bd130566cde1de [file] [log] [blame]
Richard S. Hall85bafab2009-07-13 13:25:46 +00001/*
2 * Licensed to the Apache Software Foundation (ASF) under one
3 * or more contributor license agreements. See the NOTICE file
4 * distributed with this work for additional information
5 * regarding copyright ownership. The ASF licenses this file
6 * to you under the Apache License, Version 2.0 (the
7 * "License"); you may not use this file except in compliance
8 * with the License. You may obtain a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing,
13 * software distributed under the License is distributed on an
14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 * KIND, either express or implied. See the License for the
16 * specific language governing permissions and limitations
17 * under the License.
18 */
19
20package org.cauldron.bld.core.internal.model.eclipse;
21
22import java.util.Collection;
23import java.util.HashSet;
24import java.util.Set;
25
26import org.cauldron.sigil.model.AbstractCompoundModelElement;
27import org.cauldron.sigil.model.eclipse.ILibrary;
28import org.cauldron.sigil.model.osgi.IPackageImport;
29import org.cauldron.sigil.model.osgi.IRequiredBundle;
30import org.osgi.framework.Version;
31
32public class Library extends AbstractCompoundModelElement implements ILibrary {
33
34 private static final long serialVersionUID = 1L;
35
36 private String name;
37 private Version version;
38 private Set<IRequiredBundle> bundles;
39 private Set<IPackageImport> imports;
40
41 public Library() {
42 super("Library");
43 bundles = new HashSet<IRequiredBundle>();
44 imports = new HashSet<IPackageImport>();
45 }
46
47 public void addBundle(IRequiredBundle bundle) {
48 bundles.add(bundle);
49 }
50
51 public void addImport(IPackageImport pi) {
52 imports.add(pi);
53 }
54
55 public Collection<IRequiredBundle> getBundles() {
56 return bundles;
57 }
58
59 public Collection<IPackageImport> getImports() {
60 return imports;
61 }
62
63 public String getName() {
64 return name;
65 }
66
67 public Version getVersion() {
68 return version;
69 }
70
71 public void removeBundle(IRequiredBundle bundle) {
72 bundles.remove(bundle);
73 }
74
75 public void removeImport(IPackageImport pi) {
76 imports.remove(pi);
77 }
78
79 public void setName(String name) {
80 this.name = name;
81 }
82
83 public void setVersion(Version version) {
84 this.version = version;
85 }
86}