1 12 package org.displaytag.util; 13 14 import javax.servlet.jsp.JspTagException ; 15 16 import org.displaytag.Messages; 17 18 19 25 public final class DependencyChecker 26 { 27 28 31 private static boolean commonsLangChecked; 32 33 36 private DependencyChecker() 37 { 38 } 40 41 45 public static void check() throws JspTagException 46 { 47 if (commonsLangChecked) 48 { 49 return; 50 } 51 try 52 { 53 Class stringUtils = Class.forName("org.apache.commons.lang.StringUtils"); try 56 { 57 stringUtils.getMethod("splitPreserveAllTokens", new Class []{String .class}); } 60 catch (NoSuchMethodException ee) 61 { 62 throw new JspTagException (Messages.getString("DependencyChecker.lib.incompatible", new Object []{"commons-lang", "2.1", "http://jakarta.apache.org/commons/lang"} )); 65 } 66 } 67 catch (ClassNotFoundException e) 68 { 69 throw new JspTagException (Messages.getString("DependencyChecker.lib.missing", new Object []{"commons-lang", "2.1", "http://jakarta.apache.org/commons/lang"} )); 72 } 73 commonsLangChecked = true; 74 } 75 76 } | Popular Tags |