1 15 package org.apache.tapestry.annotations; 16 17 import java.lang.reflect.Method ; 18 19 import org.apache.hivemind.Location; 20 import org.apache.tapestry.enhance.EnhancementOperation; 21 import org.apache.tapestry.enhance.InjectComponentWorker; 22 import org.apache.tapestry.spec.IComponentSpecification; 23 24 32 public class InjectComponentAnnotationWorker implements MethodAnnotationEnhancementWorker 33 { 34 final InjectComponentWorker _delegate; 35 36 InjectComponentAnnotationWorker(InjectComponentWorker delegate) 37 { 38 _delegate = delegate; 39 } 40 41 public InjectComponentAnnotationWorker() 42 { 43 this(new InjectComponentWorker()); 44 } 45 46 public void performEnhancement(EnhancementOperation op, IComponentSpecification spec, 47 Method method, Location location) 48 { 49 InjectComponent ic = method.getAnnotation(InjectComponent.class); 50 String propertyName = AnnotationUtils.getPropertyName(method); 51 52 _delegate.injectComponent(op, ic.value(), propertyName); 53 } 54 55 } 56 | Popular Tags |