KickJava   Java API By Example, From Geeks To Geeks.

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


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 org.java.plugin.registry.PluginPrerequisite;
22 import org.java.plugin.registry.Version;
23
24 /**
25  * @version $Id: MockPluginPrerequisite.java,v 1.2 2006/09/14 18:10:39 ddimon Exp $
26  */

27 public class MockPluginPrerequisite extends MockPluginElement implements
28         PluginPrerequisite {
29     private String JavaDoc match;
30     private String JavaDoc pluginId;
31     private Version pluginVersion;
32     private boolean isExported;
33     private boolean isOptional;
34     private boolean isReverseLookup;
35     private boolean matches = true;
36
37     /**
38      * @see org.java.plugin.registry.PluginPrerequisite#getMatch()
39      */

40     public String JavaDoc getMatch() {
41         return match;
42     }
43     
44     /**
45      * @param value the match rule to set
46      * @return this instance
47      */

48     public MockPluginPrerequisite setMatch(final String JavaDoc value) {
49         match = value;
50         return this;
51     }
52
53     /**
54      * @see org.java.plugin.registry.PluginPrerequisite#getPluginId()
55      */

56     public String JavaDoc getPluginId() {
57         return pluginId;
58     }
59     
60     /**
61      * @param value the plug-in id to set
62      * @return this instance
63      */

64     public MockPluginPrerequisite setPluginId(final String JavaDoc value) {
65         pluginId = value;
66         return this;
67     }
68
69     /**
70      * @see org.java.plugin.registry.PluginPrerequisite#getPluginVersion()
71      */

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

80     public MockPluginPrerequisite setPluginVersion(final Version value) {
81         pluginVersion = value;
82         return this;
83     }
84
85     /**
86      * @see org.java.plugin.registry.PluginPrerequisite#isExported()
87      */

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

96     public MockPluginPrerequisite setExported(final boolean value) {
97         isExported = value;
98         return this;
99     }
100
101     /**
102      * @see org.java.plugin.registry.PluginPrerequisite#isOptional()
103      */

104     public boolean isOptional() {
105         return isOptional;
106     }
107     
108     /**
109      * @param value the optional flag to set
110      * @return this instance
111      */

112     public MockPluginPrerequisite setOptional(final boolean value) {
113         isOptional = value;
114         return this;
115     }
116
117     /**
118      * @see org.java.plugin.registry.PluginPrerequisite#isReverseLookup()
119      */

120     public boolean isReverseLookup() {
121         return isReverseLookup;
122     }
123     
124     /**
125      * @param value the reverse look-up flag to set
126      * @return this instance
127      */

128     public MockPluginPrerequisite setReverseLookup(final boolean value) {
129         isReverseLookup = value;
130         return this;
131     }
132
133     /**
134      * @see org.java.plugin.registry.PluginPrerequisite#matches()
135      */

136     public boolean matches() {
137         return matches;
138     }
139     
140     /**
141      * @param value the matches flag to set
142      * @return this instance
143      */

144     public MockPluginPrerequisite setMatches(final boolean value) {
145         matches = value;
146         return this;
147     }
148
149     /**
150      * @see org.java.plugin.registry.UniqueIdentity#getUniqueId()
151      */

152     public String JavaDoc getUniqueId() {
153         return getDeclaringPluginDescriptor().getId() + '@' + getId();
154     }
155 }
156
Popular Tags