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.EnhanceUtils; 21 import org.apache.tapestry.enhance.EnhancementOperation; 22 import org.apache.tapestry.spec.IComponentSpecification; 23 import org.apache.tapestry.spec.InjectSpecification; 24 import org.apache.tapestry.spec.InjectSpecificationImpl; 25 26 30 public class InjectMetaAnnotationWorker implements MethodAnnotationEnhancementWorker 31 { 32 33 public void performEnhancement(EnhancementOperation op, IComponentSpecification spec, 34 Method method, Location location) 35 { 36 String propertyName = AnnotationUtils.getPropertyName(method); 37 38 InjectMeta annotation = method.getAnnotation(InjectMeta.class); 39 40 InjectSpecification is = new InjectSpecificationImpl(); 41 is.setProperty(propertyName); 42 is.setType("meta"); 43 is.setObject(annotation.value()); 44 is.setLocation(location); 45 46 spec.addInjectSpecification(is); 47 } 48 49 } 50 | Popular Tags |