1 19 24 25 package org.netbeans.modules.j2ee.sun.share.configbean; 26 27 32 public final class ApplicationVersion extends J2EEBaseVersion { 33 34 36 public static final ApplicationVersion APPLICATION_1_3 = new ApplicationVersion( 37 "1.3", 1300, "1.3", 1300, DTDRegistryLink.SUN_APPLICATION_130_DTD_PUBLIC_ID, 40 DTDRegistryLink.SUN_APPLICATION_130_DTD_SYSTEM_ID); 41 42 44 public static final ApplicationVersion APPLICATION_1_4 = new ApplicationVersion( 45 "1.4", 1400, "1.4", 1400, DTDRegistryLink.SUN_APPLICATION_140_DTD_PUBLIC_ID, 48 DTDRegistryLink.SUN_APPLICATION_140_DTD_SYSTEM_ID); 49 50 52 public static final ApplicationVersion APPLICATION_5_0 = new ApplicationVersion( 53 "5.0", 5000, "5.0", 5000, DTDRegistryLink.SUN_APPLICATION_500_DTD_PUBLIC_ID, 56 DTDRegistryLink.SUN_APPLICATION_500_DTD_SYSTEM_ID); 57 58 61 62 64 private ApplicationVersion(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 ApplicationVersion target = (ApplicationVersion) obj; 77 return numericCompare(target); 78 } 79 80 public static ApplicationVersion getApplicationVersion(String version) { 81 ApplicationVersion result = null; 82 83 if(APPLICATION_1_3.toString().equals(version)) { 84 result = APPLICATION_1_3; 85 } else if(APPLICATION_1_4.toString().equals(version)) { 86 result = APPLICATION_1_4; 87 } else if(APPLICATION_5_0.toString().equals(version)) { 88 result = APPLICATION_5_0; 89 } 90 91 return result; 92 } 93 } 94 | Popular Tags |