1 package jfun.yan; 2 3 import jfun.yan.function.Signature; 4 5 6 class IntrospectionDependency implements Dependency { 7 private final ComponentMap cmap; 8 private final Object key; 9 10 public IntrospectionDependency(ComponentMap cmap, Object key) { 11 this.cmap = cmap; 12 this.key = key; 13 } 14 15 public Object getArgument(Signature source, int i, Class type) 16 throws IrresolveableArgumentException, ParameterTypeMismatchException, 17 AmbiguousComponentResolutionException, ComponentInstantiationException, 18 YanException { 19 throw new UnsupportedOperationException ("getArgument cannot be called for introspection"); 20 } 21 22 public Class verifyArgument(Signature source, int i, Class type) 23 throws IrresolveableArgumentException, ParameterTypeMismatchException, 24 AmbiguousComponentResolutionException, YanException { 25 return type; 26 } 27 28 public Object getProperty(Class component_type, Object key, Class type) 29 throws IrresolveablePropertyException, PropertyTypeMismatchException, 30 AmbiguousComponentResolutionException, ComponentInstantiationException, 31 YanException { 32 throw new UnsupportedOperationException ("getArgument cannot be called for introspection"); 33 } 34 35 public Class verifyProperty(Class component_type, Object key, Class type) 36 throws IrresolveablePropertyException, PropertyTypeMismatchException, 37 AmbiguousComponentResolutionException, YanException { 38 return type; 39 } 40 public Dependency seal(){ 41 return this; 42 } 43 public Dependency getOriginal() { 44 return this; 45 } 46 47 public ComponentMap getComponentMap() { 48 return cmap; 49 } 50 51 public Object getComponentKey() { 52 return key; 53 } 54 55 public Dependency getParent() { 56 return null; 57 } 58 59 } 60 | Popular Tags |