1 19 20 23 24 package org.netbeans.modules.j2ee.sun.ws7.j2ee; 25 26 30 public class ResourceType { 31 32 private static final int ENUM_JDBC=1; 33 private static final int ENUM_EXT_JNDI=2; 34 private static final int ENUM_CUSTOM=3; 35 private static final int ENUM_MAIL=4; 36 37 public static final ResourceType JDBC =new ResourceType(ENUM_JDBC); 38 public static final ResourceType JNDI =new ResourceType(ENUM_EXT_JNDI); 39 public static final ResourceType CUSTOM =new ResourceType(ENUM_CUSTOM); 40 public static final ResourceType MAIL =new ResourceType(ENUM_MAIL); 41 42 private int type; 43 44 public ResourceType(int type) { 45 this.type = type; 46 } 47 48 public int getType(){ 49 return type; 50 } 51 public boolean eqauls(ResourceType type){ 52 if(this.type == type.getType()){ 53 return true; 54 } 55 return false; 56 } 57 58 public String toString(){ 59 if(type==ENUM_JDBC){ 60 return "jdbc-resource"; } 62 if(type==ENUM_EXT_JNDI){ 63 return "external-jndi-resource"; } 65 if(type==ENUM_CUSTOM){ 66 return "custom-resource"; } 68 if(type==ENUM_MAIL){ 69 return "mail-resource"; } 71 72 return "UNKNOWN"; } 74 } 75 | Popular Tags |