2 * Copyright 2000-2009 JetBrains s.r.o.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
16 package com
.intellij
.ide
.util
.importProject
;
19 import java
.util
.Collection
;
20 import java
.util
.Collections
;
23 * @author Eugene Zhuravlev
26 public class LibraryDescriptor
{
28 public static enum Level
{
29 GLOBAL
, PROJECT
, MODULE
32 private String myName
;
33 private final Collection
<File
> myJars
;
34 private Level myLevel
;
36 public LibraryDescriptor(String name
, Collection
<File
> jars
) {
41 public String
getName() {
42 return myName
!= null? myName
: "";
45 public void setName(final String name
) {
49 public Level
getLevel() {
50 if (myLevel
!= null) {
53 return myJars
.size() > 1? Level
.PROJECT
: Level
.MODULE
;
56 public void setLevel(final Level level
) {
60 public Collection
<File
> getJars() {
61 return Collections
.unmodifiableCollection(myJars
);
64 public void addJars(Collection
<File
> jars
) {
68 public void removeJars(Collection
<File
> jars
) {
69 myJars
.removeAll(jars
);
72 public String
toString() {
73 return "Lib[" + myName
+ "]";