1 11 package org.eclipse.jdt.internal.core; 12 13 import org.eclipse.jdt.core.*; 14 import org.eclipse.jdt.core.JavaModelException; 15 import org.eclipse.jdt.core.compiler.CharOperation; 16 import org.eclipse.jdt.internal.compiler.env.ISourceMethod; 17 18 21 public abstract class SourceMethodElementInfo extends MemberElementInfo implements ISourceMethod { 22 23 31 protected char[][] argumentNames; 32 33 40 protected char[][] exceptionTypes; 41 42 45 protected ITypeParameter[] typeParameters = TypeParameter.NO_TYPE_PARAMETERS; 46 47 public char[][] getArgumentNames() { 48 return this.argumentNames; 49 } 50 public char[][] getExceptionTypeNames() { 51 return this.exceptionTypes; 52 } 53 public abstract char[] getReturnTypeName(); 54 55 public char[][][] getTypeParameterBounds() { 56 int length = this.typeParameters.length; 57 char[][][] typeParameterBounds = new char[length][][]; 58 for (int i = 0; i < length; i++) { 59 try { 60 TypeParameterElementInfo info = (TypeParameterElementInfo) ((JavaElement)this.typeParameters[i]).getElementInfo(); 61 typeParameterBounds[i] = info.bounds; 62 } catch (JavaModelException e) { 63 } 65 } 66 return typeParameterBounds; 67 } 68 public char[][] getTypeParameterNames() { 69 int length = this.typeParameters.length; 70 if (length == 0) return CharOperation.NO_CHAR_CHAR; 71 char[][] typeParameterNames = new char[length][]; 72 for (int i = 0; i < length; i++) { 73 typeParameterNames[i] = this.typeParameters[i].getElementName().toCharArray(); 74 } 75 return typeParameterNames; 76 } 77 public abstract boolean isConstructor(); 78 public abstract boolean isAnnotationMethod(); 79 protected void setArgumentNames(char[][] names) { 80 this.argumentNames = names; 81 } 82 protected void setExceptionTypeNames(char[][] types) { 83 this.exceptionTypes = types; 84 } 85 protected abstract void setReturnType(char[] type); 86 } 87 | Popular Tags |