KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > swt > tools > internal > FieldData


1 /*******************************************************************************
2  * Copyright (c) 2004 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.swt.tools.internal;
12
13 import java.lang.reflect.Field JavaDoc;
14
15 public class FieldData extends ItemData {
16     
17     Field JavaDoc field;
18     
19 public FieldData(Field JavaDoc field, String JavaDoc str) {
20     super(str);
21     this.field = field;
22 }
23
24 public static String JavaDoc[] getAllFlags() {
25     return new String JavaDoc[]{"no_gen", "no_wince"};
26 }
27
28 public String JavaDoc getAccessor() {
29     return (String JavaDoc)getParam("accessor");
30 }
31
32 public String JavaDoc getCast() {
33     String JavaDoc cast = ((String JavaDoc)getParam("cast")).trim();
34     if (cast.length() > 0) {
35         if (!cast.startsWith("(")) cast = "(" + cast;
36         if (!cast.endsWith(")")) cast = cast + ")";
37     }
38     return cast;
39 }
40
41 public String JavaDoc getExclude() {
42     return (String JavaDoc)getParam("exclude");
43 }
44
45 public Field JavaDoc getField() {
46     return field;
47 }
48
49 public void setAccessor(String JavaDoc str) {
50     setParam("accessor", str);
51 }
52
53 public void setCast(String JavaDoc str) {
54     setParam("cast", str);
55 }
56
57 public void setExclude(String JavaDoc str) {
58     setParam("exclude", str);
59 }
60
61 }
62
Popular Tags