1 19 24 25 package org.netbeans.modules.j2ee.sun.share.configbean; 26 27 32 public final class ServletVersion extends J2EEBaseVersion { 33 34 36 public static final ServletVersion SERVLET_2_3 = new ServletVersion( 37 "2.3", 2300, "1.3", 1300, DTDRegistryLink.SUN_WEBAPP_230_DTD_PUBLIC_ID, 40 DTDRegistryLink.SUN_WEBAPP_230_DTD_SYSTEM_ID); 41 42 44 public static final ServletVersion SERVLET_2_4 = new ServletVersion( 45 "2.4", 2401, "1.4", 1400, DTDRegistryLink.SUN_WEBAPP_241_DTD_PUBLIC_ID, 48 DTDRegistryLink.SUN_WEBAPP_241_DTD_SYSTEM_ID); 49 50 52 public static final ServletVersion SERVLET_2_5 = new ServletVersion( 53 "2.5", 2500, "5.0", 5000, DTDRegistryLink.SUN_WEBAPP_250_DTD_PUBLIC_ID, 56 DTDRegistryLink.SUN_WEBAPP_250_DTD_SYSTEM_ID); 57 58 61 62 64 private ServletVersion(String version, int nv, String specVersion, int nsv, String pubId, String sysId) { 65 super(version, nv, specVersion, nsv, pubId, sysId); 66 } 67 68 75 public int compareTo(Object obj) { 76 ServletVersion target = (ServletVersion) obj; 77 return numericCompare(target); 78 } 79 80 public static ServletVersion getServletVersion(String version) { 81 ServletVersion result = null; 82 83 if(SERVLET_2_3.toString().equals(version)) { 84 result = SERVLET_2_3; 85 } else if(SERVLET_2_4.toString().equals(version)) { 86 result = SERVLET_2_4; 87 } else if(SERVLET_2_5.toString().equals(version)) { 88 result = SERVLET_2_5; 89 } 90 91 return result; 92 } 93 } 94 | Popular Tags |