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.spec.IComponentSpecification; 22 import org.apache.tapestry.spec.InjectSpecification; 23 import org.apache.tapestry.spec.InjectSpecificationImpl; 24 25 33 public class InjectPageAnnotationWorker implements MethodAnnotationEnhancementWorker 34 { 35 36 public void performEnhancement(EnhancementOperation op, IComponentSpecification spec, 37 Method method, Location location) 38 { 39 InjectPage injectPage = method.getAnnotation(InjectPage.class); 40 41 String propertyName = AnnotationUtils.getPropertyName(method); 42 43 InjectSpecification is = new InjectSpecificationImpl(); 44 45 is.setProperty(propertyName); 46 is.setType("page"); 47 is.setObject(injectPage.value()); 48 is.setLocation(location); 49 50 spec.addInjectSpecification(is); 51 } 52 53 } 54 | Popular Tags |