<%@ jet package="be.ac.vub.smart_annotations.wizards" imports="java.util.ArrayList" class="SmartAnnotation" %> <% AnnotationModel am = (AnnotationModel) argument; boolean target = false; boolean retention = false; if(am.getTarget() != null) { target = true; } if(am.getRetention() != null) { retention = true; } %> package <%= am.getPackageName() %>; <% if(target) { %> import java.lang.annotation.ElementType; import java.lang.annotation.Target; <% } %> <% if(retention) { %> import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; <% } %> import be.ac.vub.smart_annotations_library.*; <% if(target) { %> @Target(ElementType.<%= am.getTarget().toUpperCase().replace(' ', '_') %>) <% } if(retention) { %> @Retention(RetentionPolicy.<%= am.getRetention().toUpperCase() %>) <% } %> <% if(am.hasClassTargetVariables()) { ArrayList vars = am.getClassTargetVariables(); for(String v: vars) { %> @TargetVariable("<%= v %>") <% } } %> public @interface <%= am.getClassName() %> { <% if(am.hasRules()) { ArrayList rules = am.getRules(); for(RuleModel r: rules) { if(r.hasAnnotations()) { ArrayList annotations = r.getAnnotations(); for(String ann: annotations) { %> @<%= ann %> <% } } %> public static final String <%= r.getName() %> = "<%= r.getRule() %>"; <% } } %> }