1 2 package org.jahia.data.applications; 3 4 import java.io.Serializable ; 5 6 7 13 public class ServletBean implements Serializable { 14 15 public final static int SERVLET_TYPE = 1; 16 public final static int JSP_TYPE = 2; 17 public final static String SERVLET = "SERVLET"; 18 public final static String JSP = "JSP"; 19 private boolean isWelcomeFile = false; 20 21 private String name; private String context; private String servletName; private String servletsrc; private int webAppType = SERVLET_TYPE; private String desc; private String urlMappingPattern = "" ; 29 32 private boolean loaded = false; 33 34 35 38 public ServletBean( 39 int webAppType, 40 String name, 41 String servletName, 42 String servletsrc, 43 String context, 44 String desc 45 ) 46 { 47 this.webAppType = webAppType; 48 this.name = name; 49 this.context = context; 50 this.servletName = servletName; 51 this.servletsrc = servletsrc; 52 this.desc = desc; 53 54 if ( this.name == null ){ 55 this.name = ""; 56 } 57 58 if ( this.context == null ){ 59 this.context = ""; 60 } 61 62 if ( this.servletName == null ){ 63 this.servletName = ""; 64 } 65 66 if ( this.servletsrc == null ){ 67 this.servletsrc = ""; 68 } 69 70 } 72 73 74 78 public String getName() { return name; } 79 public String getContext() { return context; } 80 public String getServletName() { return servletName; } 81 public String getservletsrc() { return servletsrc; } 82 public int getWebAppType() { return webAppType; } 83 public String getdesc() { return desc; } 84 public String getUrlMappingPattern() { return urlMappingPattern; } 85 public boolean isLoaded() { return loaded; } 86 public boolean isWelcomeFile() { return isWelcomeFile; } 87 88 89 public String getWebAppTypeLabel(){ 90 91 if ( webAppType == SERVLET_TYPE ){ 92 return SERVLET; 93 } 94 return JSP; 95 } 96 97 98 public void setName( String name ) { this.name = name; } 99 public void setContext( String context ) { this.context = context; } 100 public void setServletName( String servletName ) { this.servletName = servletName; } 101 public void setservletsrc( String servletsrc ) { this.servletsrc = servletsrc; } 102 public void setWebAppType( int webAppType ) { this.webAppType = webAppType; } 103 public void setUrlMappingPattern( String pattern ) { this.urlMappingPattern = pattern; } 104 public void setdesc( String desc ) { this.desc = desc; } 105 public void setLoaded( boolean loaded ) { this.loaded = loaded; } 106 public void setIsWelcomeFile( boolean isWelcomeFile ) { this.isWelcomeFile = isWelcomeFile; } 107 108 109 111 112 } | Popular Tags |