KickJava   Java API By Example, From Geeks To Geeks.

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


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.Method JavaDoc;
14
15 public class ParameterData extends ItemData {
16     
17     Method JavaDoc method;
18     int parameter;
19
20 public ParameterData(Method JavaDoc method, int parameter, String JavaDoc str) {
21     super(str);
22     this.method = method;
23     this.parameter = parameter;
24 }
25
26 public static String JavaDoc[] getAllFlags() {
27     return new String JavaDoc[]{"no_in", "no_out", "critical", "init", "struct", "unicode"};
28 }
29
30 public String JavaDoc getCast() {
31     String JavaDoc cast = ((String JavaDoc)getParam("cast")).trim();
32     if (cast.length() > 0) {
33         if (!cast.startsWith("(")) cast = "(" + cast;
34         if (!cast.endsWith(")")) cast = cast + ")";
35     }
36     return cast;
37 }
38
39 public Method JavaDoc getMethod() {
40     return method;
41 }
42
43 public int getParameter() {
44     return parameter;
45 }
46
47 public void setCast(String JavaDoc str) {
48     setParam("cast", str);
49 }
50
51 }
52
Popular Tags