001: /*
002: * Author: Mike Atkinson
003: *
004: * This software has been developed under the copyleft
005: * rules of the GNU General Public License. Please
006: * consult the GNU General Public License for more
007: * details about use and distribution of this software.
008: */
009: package net.sourceforge.jrefactory.ast;
010:
011: /**
012: * Holds a description of the modifiers for a field or a class
013: *
014: * @author Mike Atkinson
015: * @since jRefactory 2.9.0, created October 16, 2003
016: */
017: public interface ModifierHolder {
018:
019: /**
020: * The <code>int</code> value representing the <code>public</code> modifier.
021: *
022: * @since v 1.0
023: */
024: final static int PUBLIC = 0x00000001;
025:
026: /**
027: * The <code>int</code> value representing the <code>private</code> modifier.
028: *
029: * @since v 1.0
030: */
031: final static int PRIVATE = 0x00000002;
032:
033: /**
034: * The <code>int</code> value representing the <code>protected</code> modifier.
035: *
036: * @since v 1.0
037: */
038: final static int PROTECTED = 0x00000004;
039:
040: /**
041: * The <code>int</code> value representing the <code>static</code> modifier.
042: *
043: * @since v 1.0
044: */
045: final static int STATIC = 0x00000008;
046:
047: /**
048: * The <code>int</code> value representing the <code>final</code> modifier.
049: *
050: * @since v 1.0
051: */
052: final static int FINAL = 0x00000010;
053:
054: /**
055: * The <code>int</code> value representing the <code>synchronized</code> modifier.
056: *
057: * @since v 1.0
058: */
059: final static int SYNCHRONIZED = 0x00000020;
060:
061: /**
062: * The <code>int</code> value representing the <code>volatile</code> modifier.
063: *
064: * @since v 1.0
065: */
066: final static int VOLATILE = 0x00000040;
067:
068: /**
069: * The <code>int</code> value representing the <code>transient</code> modifier.
070: *
071: * @since v 1.0
072: */
073: final static int TRANSIENT = 0x00000080;
074:
075: /**
076: * The <code>int</code> value representing the <code>native</code> modifier.
077: *
078: * @since v 1.0
079: */
080: final static int NATIVE = 0x00000100;
081:
082: /**
083: * The <code>int</code> value representing the <code>interface</code> modifier.
084: *
085: * @since v 1.0
086: */
087: final static int INTERFACE = 0x00000200;
088:
089: /**
090: * The <code>int</code> value representing the <code>abstract</code> modifier.
091: *
092: * @since v 1.0
093: */
094: final static int ABSTRACT = 0x00000400;
095:
096: /**
097: * The <code>int</code> value representing the <code>strictfp</code> modifier.
098: *
099: * @since v 1.0
100: */
101: final static int STRICTFP = 0x00000800;
102:
103: /**
104: * Description of the Field
105: *
106: * @since v 1.0
107: */
108: final static int EXPLICIT = 0x2000;
109:
110: /**
111: * Description of the Field
112: *
113: * @since v 1.0
114: */
115: final static String[] names = { "abstract", "explicit", "final",
116: "interface", "native", "private", "protected", "public",
117: "static", "strict", "strictfp", "synchronized",
118: "transient", "volatile" };
119:
120: /**
121: * Gets the modifier bits
122: *
123: * @return the modifier bits
124: * @since v 1.0
125: */
126: int getModifiers();
127:
128: /**
129: * Sets the modifier bits
130: *
131: * @param modifiers the modifier bits
132: * @since v 1.0
133: */
134: void setModifiers(int modifiers);
135:
136: /**
137: * Sets the private bit in the modifiers
138: *
139: * @param value true if we are setting the private modifier
140: * @since v 1.0
141: */
142: void setPrivate(boolean value);
143:
144: /**
145: * Sets the private bit (to true) in the modifiers
146: *
147: * @since v 1.0
148: */
149: void setPrivate();
150:
151: /**
152: * Sets the protected bit in the modifiers
153: *
154: * @param value true if we are setting the protected modifier
155: * @since v 1.0
156: */
157: void setProtected(boolean value);
158:
159: /**
160: * Sets the protected bit (to true) in the modifiers
161: *
162: * @since v 1.0
163: */
164: void setProtected();
165:
166: /**
167: * Sets the public bit in the modifiers
168: *
169: * @param value true if we are setting the public modifier
170: * @since v 1.0
171: */
172: void setPublic(boolean value);
173:
174: /**
175: * Sets the public bit (to true) in the modifiers
176: *
177: * @since v 1.0
178: */
179: void setPublic();
180:
181: /**
182: * Sets the abstract bit in the modifiers
183: *
184: * @param value true if we are setting the modifier
185: * @since v 1.0
186: */
187: void setAbstract(boolean value);
188:
189: /**
190: * Sets the abstract bit (to true) in the modifiers
191: *
192: * @since v 1.0
193: */
194: void setAbstract();
195:
196: /**
197: * Sets the Synchronized bit of the in the modifiers
198: *
199: * @param value The new Synchronized value
200: * @since v 1.0
201: */
202: void setSynchronized(boolean value);
203:
204: /**
205: * Sets the Synchronized bit (to true) in the modifiers
206: *
207: * @since v 1.0
208: */
209: void setSynchronized();
210:
211: /**
212: * Sets the Static bit of the in the modifiers
213: *
214: * @param value The new Static value
215: * @since v 1.0
216: */
217: void setStatic(boolean value);
218:
219: /**
220: * Sets the Static bit (to true) of the in the modifiers
221: *
222: * @since v 1.0
223: */
224: void setStatic();
225:
226: /**
227: * Sets the Final bit (to true) of the in the modifiers
228: *
229: * @since v 1.0
230: */
231: void setFinal();
232:
233: /**
234: * Sets the StrictFP bit (to true) of the in the modifiers
235: *
236: * @since v 1.0
237: */
238: void setStrict();
239:
240: /**
241: * Determine if the node is abstract
242: *
243: * @return true if this stores an ABSTRACT flag
244: * @since v 1.0
245: */
246: boolean isAbstract();
247:
248: /**
249: * Determine if the node is explicit
250: *
251: * @return true if this stores an EXPLICIT flag
252: * @since v 1.0
253: */
254: boolean isExplicit();
255:
256: /**
257: * Determine if the node is final
258: *
259: * @return true if this stores an FINAL flag
260: * @since v 1.0
261: */
262: boolean isFinal();
263:
264: /**
265: * Determine if the node is interface
266: *
267: * @return true if this stores an INTERFACE flag
268: * @since v 1.0
269: */
270: boolean isInterface();
271:
272: /**
273: * Determine if the node is native
274: *
275: * @return true if this stores an NATIVE flag
276: * @since v 1.0
277: */
278: boolean isNative();
279:
280: /**
281: * Determine if the node is private
282: *
283: * @return true if this stores an PRIVATE flag
284: * @since v 1.0
285: */
286: boolean isPrivate();
287:
288: /**
289: * Determine if the node is protected
290: *
291: * @return true if this stores an PROTECTED flag
292: * @since v 1.0
293: */
294: boolean isProtected();
295:
296: /**
297: * Determine if the node is public
298: *
299: * @return true if this stores an PUBLIC flag
300: * @since v 1.0
301: */
302: boolean isPublic();
303:
304: /**
305: * Determine if the node is static
306: *
307: * @return true if this stores an static flag
308: * @since v 1.0
309: */
310: boolean isStatic();
311:
312: /**
313: * Determine if the node is strictFP
314: *
315: * @return true if this stores an STRICTFP flag
316: * @since v 1.0
317: */
318: boolean isStrictFP();
319:
320: /**
321: * Determine if the node is synchronized
322: *
323: * @return true if this stores an SYNCHRONIZED flag
324: * @since v 1.0
325: */
326: boolean isSynchronized();
327:
328: /**
329: * Determine if the node is transient
330: *
331: * @return true if this stores an TRANSIENT flag
332: * @since v 1.0
333: */
334: boolean isTransient();
335:
336: /**
337: * Determine if the node is volatile
338: *
339: * @return true if this stores an VOLATILE flag
340: * @since v 1.0
341: */
342: boolean isVolatile();
343:
344: /**
345: * Determines if this has package scope
346: *
347: * @return true if this has package scope
348: * @since v 1.0
349: */
350: boolean isPackage();
351:
352: /**
353: * Add a modifier
354: *
355: * @param mod the new modifier
356: * @since v 1.0
357: */
358: void addModifier(String mod);
359:
360: /**
361: * Description of the Method
362: *
363: * @param source Description of Parameter
364: * @since v 1.0
365: */
366: void copyModifiers(ModifierHolder source);
367: }
|