diff options
author | lauzond | 2006-09-01 20:52:43 +0000 |
---|---|---|
committer | lauzond | 2006-09-01 20:52:43 +0000 |
commit | 414a7aa7ffd4a82ba7b3865d52ef40d826bbee14 (patch) | |
tree | 398ca9f5f00de1e74a42f44921d58a123bedaa8e /bundles/org.eclipse.wst.wsi/src/org/eclipse/wst | |
parent | 0621aafc931901b5b31d7a4ca6abe3601f58a1bb (diff) | |
download | webtools.webservices-414a7aa7ffd4a82ba7b3865d52ef40d826bbee14.tar.gz webtools.webservices-414a7aa7ffd4a82ba7b3865d52ef40d826bbee14.tar.xz webtools.webservices-414a7aa7ffd4a82ba7b3865d52ef40d826bbee14.zip |
137829 Allow the dynamic registration of valid TAD versions
Diffstat (limited to 'bundles/org.eclipse.wst.wsi/src/org/eclipse/wst')
-rw-r--r-- | bundles/org.eclipse.wst.wsi/src/org/eclipse/wst/wsi/internal/core/util/Utils.java | 53 |
1 files changed, 34 insertions, 19 deletions
diff --git a/bundles/org.eclipse.wst.wsi/src/org/eclipse/wst/wsi/internal/core/util/Utils.java b/bundles/org.eclipse.wst.wsi/src/org/eclipse/wst/wsi/internal/core/util/Utils.java index 2b850f274..5b8251a80 100644 --- a/bundles/org.eclipse.wst.wsi/src/org/eclipse/wst/wsi/internal/core/util/Utils.java +++ b/bundles/org.eclipse.wst.wsi/src/org/eclipse/wst/wsi/internal/core/util/Utils.java @@ -28,7 +28,9 @@ import java.net.URL; import java.util.ArrayList; import java.util.Collection; import java.util.Date; +import java.util.HashMap; import java.util.Iterator; +import java.util.Map; import java.util.ResourceBundle; import com.ibm.icu.util.StringTokenizer; import java.util.Vector; @@ -53,6 +55,22 @@ public final class Utils public static final byte CR = (byte) '\r'; public static final byte LF = (byte) '\n'; + + private static Map validProfileTADVersions; + + /* Register Basic Profile TAD versions */ + static { + validProfileTADVersions = new HashMap(); + registerValidProfileTADVersion(WSIConstants.BASIC_PROFILE_TAD_NAME, + WSIConstants.BASIC_PROFILE_TAD_VERSION); + registerValidProfileTADVersion(WSIConstants.BASIC_PROFILE_1_1_TAD_NAME, + WSIConstants.BASIC_PROFILE_1_1_TAD_VERSION); + registerValidProfileTADVersion(WSIConstants.SIMPLE_SOAP_BINDINGS_PROFILE_TAD_NAME, + WSIConstants.SIMPLE_SOAP_BINDINGS_PROFILE_TAD_VERSION); + registerValidProfileTADVersion(WSIConstants.ATTACHMENTS_PROFILE_TAD_NAME, + WSIConstants.ATTACHMENTS_PROFILE_TAD_VERSION); + } + /** * Common timestamp format. */ @@ -1133,6 +1151,17 @@ public final class Utils v.add(array[i]); return v; } + + /** + * Designates legal versions for the profile test assertion document + * @param name - the TAD name + * @param version - the legal version + */ + public static void registerValidProfileTADVersion(String name, String version) + { + validProfileTADVersions.put(name, version); + } + /** * Checks to ensure that version of the profile test assertion * document is supported in this version of the test tools. @@ -1142,29 +1171,15 @@ public final class Utils */ public static boolean isValidProfileTADVersion(ProfileAssertions profileAssertions) { - boolean result = false; String name = profileAssertions.getTADName(); String version = profileAssertions.getTADVersion(); - if (WSIConstants.BASIC_PROFILE_TAD_NAME.equals(name)) - { - result = - checkVersionNumber(WSIConstants.BASIC_PROFILE_TAD_VERSION, version); - } else if (WSIConstants.BASIC_PROFILE_1_1_TAD_NAME.equals(name)) - { - result = - checkVersionNumber(WSIConstants.BASIC_PROFILE_1_1_TAD_VERSION, version); - } else if (WSIConstants.SIMPLE_SOAP_BINDINGS_PROFILE_TAD_NAME.equals(name)) - { - result = - checkVersionNumber(WSIConstants.SIMPLE_SOAP_BINDINGS_PROFILE_TAD_VERSION, version); - } else if (WSIConstants.ATTACHMENTS_PROFILE_TAD_NAME.equals(name)) - { - result = - checkVersionNumber(WSIConstants.ATTACHMENTS_PROFILE_TAD_VERSION, version); - } - return result; + if (validProfileTADVersions.containsKey(name)) + return checkVersionNumber((String) validProfileTADVersions.get(name), + version); + else + return false; } /** |