1 15 package org.apache.tapestry.annotations; 16 17 import org.apache.hivemind.Location; 18 import org.apache.tapestry.TapestryUtils; 19 import org.apache.tapestry.enhance.EnhancementOperation; 20 import org.apache.tapestry.spec.IComponentSpecification; 21 22 30 public class ComponentClassAnnotationWorker implements ClassAnnotationEnhancementWorker 31 { 32 33 public void performEnhancement(EnhancementOperation op, IComponentSpecification spec, 34 Class baseClass, Location location) 35 { 36 ComponentClass component = (ComponentClass) baseClass.getAnnotation(ComponentClass.class); 37 38 spec.setAllowBody(component.allowBody()); 39 spec.setAllowInformalParameters(component.allowInformalParameters()); 40 spec.setLocation(location); 41 42 String [] names = TapestryUtils.split(component.reservedParameters()); 43 for (String name : names) 44 spec.addReservedParameterName(name); 45 46 if (baseClass.isAnnotationPresent(Deprecated .class)) 47 spec.setDeprecated(true); 48 } 49 50 } 51 | Popular Tags |