1 package org.apache.beehive.netui.xdoclet; 2 3 import org.apache.beehive.netui.compiler.processor.PageFlowAnnotationProcessor; 4 import org.apache.beehive.netui.compiler.typesystem.declaration.AnnotationTypeDeclaration; 5 import org.apache.beehive.netui.compiler.typesystem.env.AnnotationProcessorEnvironment; 6 import org.apache.beehive.netui.compiler.xdoclet.typesystem.impl.declaration.DeclarationImpl; 7 import org.apache.beehive.netui.compiler.xdoclet.typesystem.impl.env.AnnotationProcessorEnvironmentImpl; 8 import xdoclet.DocletContext; 9 import xdoclet.SubTask; 10 import xdoclet.XDocletException; 11 import xjavadoc.SourceClass; 12 import xjavadoc.XJavaDoc; 13 14 import java.util.Collection ; 15 import java.util.Iterator ; 16 17 18 23 public class NetuiSubTask extends SubTask 24 { 25 private SourceClass _currentSourceClass; 26 27 33 public void execute() throws XDocletException 34 { 35 40 Collection classes = getXJavaDoc().getSourceClasses(); 41 42 52 53 Iterator iter = classes.iterator(); 54 while ( iter.hasNext() ) 55 { 56 SourceClass sourceClass = ( SourceClass ) iter.next(); 57 AnnotationProcessorEnvironment env = AnnotationProcessorEnvironmentImpl.get( getContext(), this, sourceClass ); 58 AnnotationTypeDeclaration[] decls = DeclarationImpl.getAllAnnotations(); 60 PageFlowAnnotationProcessor pfap = new PageFlowAnnotationProcessor( decls, env ); 61 62 try 63 { 64 _currentSourceClass = sourceClass; 65 pfap.process(); 66 } 67 finally 68 { 69 _currentSourceClass = null; 70 } 71 } 72 } 73 74 public static NetuiSubTask get() 75 { 76 SubTask subtask = DocletContext.getInstance().getActiveSubTask(); 77 assert subtask instanceof NetuiSubTask : subtask.getClass().getName(); 78 return ( NetuiSubTask ) subtask; 79 } 80 81 public XJavaDoc getXJavaDoc() 82 { 83 return super.getXJavaDoc(); 84 } 85 86 public SourceClass getCurrentSourceClass() 87 { 88 return _currentSourceClass; 89 } 90 } 91 | Popular Tags |