| 1 32 package net.sf.retrotranslator.runtime.java.lang.reflect; 33 34 import java.lang.reflect.*; 35 import net.sf.retrotranslator.runtime.java.lang._Class; 36 37 40 public class _GenericDeclaration { 41 42 public static boolean executeInstanceOfInstruction(Object object) { 43 return object instanceof Class || 44 object instanceof Constructor || 45 object instanceof Method || 46 object instanceof GenericDeclaration_; 47 } 48 49 public static Object executeCheckCastInstruction(Object object) { 50 if (object instanceof Class ) { 51 return (Class ) object; 52 } 53 if (object instanceof Constructor) { 54 return (Constructor) object; 55 } 56 if (object instanceof Method) { 57 return (Method) object; 58 } 59 return (GenericDeclaration_) object; 60 } 61 62 public static TypeVariable[] getTypeParameters(Object object) { 63 if (object instanceof Class ) { 64 return _Class.getTypeParameters((Class ) object); 65 } 66 if (object instanceof Constructor) { 67 return _Constructor.getTypeParameters((Constructor) object); 68 } 69 if (object instanceof Method) { 70 return _Method.getTypeParameters((Method) object); 71 } 72 return ((GenericDeclaration_) object).getTypeParameters(); 73 } 74 } 75 | Popular Tags |