1 11 package org.eclipse.swt.tools.internal; 12 13 import java.lang.reflect.Method ; 14 15 public class ParameterData extends ItemData { 16 17 Method method; 18 int parameter; 19 20 public ParameterData(Method method, int parameter, String str) { 21 super(str); 22 this.method = method; 23 this.parameter = parameter; 24 } 25 26 public static String [] getAllFlags() { 27 return new String []{"no_in", "no_out", "critical", "init", "struct", "unicode"}; 28 } 29 30 public String getCast() { 31 String cast = ((String )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 getMethod() { 40 return method; 41 } 42 43 public int getParameter() { 44 return parameter; 45 } 46 47 public void setCast(String str) { 48 setParam("cast", str); 49 } 50 51 } 52 | Popular Tags |