1 16 19 package org.apache.xml.utils.synthetic.reflection; 20 21 import org.apache.xml.utils.synthetic.SynthesisException; 22 23 41 public class Method extends EntryPoint implements Member 42 { 43 44 53 public Method(String name, 54 org.apache.xml.utils.synthetic.Class declaringclass) 55 { 56 57 super(declaringclass); 58 59 this.name = name; 60 } 61 62 71 public Method(java.lang.reflect.Method ctor, 72 org.apache.xml.utils.synthetic.Class declaringclass) 73 { 74 super(ctor, declaringclass); 75 } 76 77 85 public Method(java.lang.reflect.Method realmethod) 86 { 87 super(realmethod); 88 } 89 90 97 98 104 public int hashCode() 105 { 106 return getDeclaringClass().getName().hashCode() ^ getName().hashCode(); 107 } 108 109 200 public Object invoke(Object obj, Object args[]) 201 throws IllegalAccessException , IllegalArgumentException , 202 java.lang.reflect.InvocationTargetException 203 { 204 205 if (realep != null) 206 return ((java.lang.reflect.Method ) realep).invoke(obj, args); 207 else 208 throw new IllegalAccessException ( 209 "Un-reified org.apache.xml.utils.synthetic.Class doesn't yet support invocation"); 210 } 211 212 220 public void setReturnType(org.apache.xml.utils.synthetic.Class returntype) 221 throws SynthesisException 222 { 223 224 if (realep != null) 225 throw new SynthesisException(SynthesisException.REIFIED); 226 227 this.returntype = returntype; 228 } 229 } 230 | Popular Tags |