KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > java > plugin > tools > mocks > MockLibrary


1 /*****************************************************************************
2  * Java Plug-in Framework (JPF)
3  * Copyright (C) 2006 Dmitry Olshansky
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18  *****************************************************************************/

19 package org.java.plugin.tools.mocks;
20
21 import java.util.Collection JavaDoc;
22 import java.util.Collections JavaDoc;
23 import java.util.LinkedList JavaDoc;
24
25 import org.java.plugin.registry.Library;
26 import org.java.plugin.registry.Version;
27
28 /**
29  * @version $Id: MockLibrary.java,v 1.2 2006/09/14 18:10:39 ddimon Exp $
30  */

31 public class MockLibrary extends MockPluginElement implements Library {
32     private boolean isCodeLibrary;
33     private String JavaDoc path;
34     private Version version;
35     private LinkedList JavaDoc exports = new LinkedList JavaDoc();
36
37     /**
38      * @see org.java.plugin.registry.Library#getExports()
39      */

40     public Collection JavaDoc getExports() {
41         return Collections.unmodifiableCollection(exports);
42     }
43     
44     /**
45      * @param exportPrefix export prefix to add
46      * @return this instance
47      */

48     public MockLibrary addExport(final String JavaDoc exportPrefix) {
49         exports.add(exportPrefix);
50         return this;
51     }
52
53     /**
54      * @see org.java.plugin.registry.Library#getPath()
55      */

56     public String JavaDoc getPath() {
57         return path;
58     }
59     
60     /**
61      * @param value the path to set
62      * @return this instance
63      */

64     public MockLibrary setPath(final String JavaDoc value) {
65         path = value;
66         return this;
67     }
68
69     /**
70      * @see org.java.plugin.registry.Library#getVersion()
71      */

72     public Version getVersion() {
73         return version;
74     }
75     
76     /**
77      * @param value the version to set
78      * @return this instance
79      */

80     public MockLibrary setVersion(final Version value) {
81         version = value;
82         return this;
83     }
84
85     /**
86      * @see org.java.plugin.registry.Library#isCodeLibrary()
87      */

88     public boolean isCodeLibrary() {
89         return isCodeLibrary;
90     }
91     
92     /**
93      * @param value the code library flag to set
94      * @return this instance
95      */

96     public MockLibrary setCodeLibrary(final boolean value) {
97         isCodeLibrary = value;
98         return this;
99     }
100
101     /**
102      * @see org.java.plugin.registry.UniqueIdentity#getUniqueId()
103      */

104     public String JavaDoc getUniqueId() {
105         return getDeclaringPluginDescriptor().getId() + '@' + getId();
106     }
107 }
108
Popular Tags