1 23 package com.sun.enterprise.deployment.annotation.context; 24 25 import java.lang.annotation.ElementType ; 26 import java.lang.reflect.AnnotatedElement ; 27 28 import com.sun.enterprise.deployment.WebComponentDescriptor; 29 import com.sun.enterprise.deployment.annotation.ProcessingContext; 30 31 37 public class WebComponentsContext extends AnnotationContext 38 implements ComponentContext { 39 40 private WebComponentContext[] webCompContexts; 41 private String componentClassName; 42 43 public WebComponentsContext(WebComponentDescriptor[] webComps) { 44 webCompContexts = new WebComponentContext[webComps.length]; 45 for (int i = 0; i < webComps.length ; i++) { 46 webCompContexts[i] = new WebComponentContext(webComps[i]); 47 } 48 if (webComps[0].isServlet()) { 49 componentClassName = webComps[0].getWebComponentImplementation(); 50 } 51 } 52 53 57 public WebComponentsContext(WebComponentContext[] webCompContexts) { 58 this.webCompContexts = webCompContexts; 59 this.componentClassName = webCompContexts[0].getComponentClassName(); 60 } 61 62 65 public WebComponentContext[] getWebComponentContexts() { 66 return webCompContexts; 67 } 68 69 public void endElement(ElementType type, AnnotatedElement element) { 70 71 if (ElementType.TYPE.equals(type)) { 72 getProcessingContext().popHandler(); 74 } 75 } 76 77 public String getComponentClassName() { 78 return componentClassName; 79 } 80 } 81 | Popular Tags |