1 16 19 package org.apache.xpath.compiler; 20 21 import javax.xml.transform.TransformerException ; 22 23 import org.apache.xpath.functions.Function; 24 25 30 public class FuncLoader 31 { 32 33 36 private int m_funcID; 37 38 39 private String m_funcName; 40 41 48 public String getName() 49 { 50 return m_funcName; 51 } 52 53 63 public FuncLoader(String funcName, int funcID) 64 { 65 66 super(); 67 68 m_funcID = funcID; 69 m_funcName = funcName; 70 } 71 72 80 public Function getFunction() throws TransformerException 81 { 82 try 83 { 84 String className = m_funcName; 85 if (className.indexOf(".") < 0) { 86 className = "org.apache.xpath.functions." + className; 87 } 88 89 return (Function) ObjectFactory.newInstance( 90 className, ObjectFactory.findClassLoader(), true); 91 } 92 catch (ObjectFactory.ConfigurationError e) 93 { 94 throw new TransformerException (e.getException()); 95 } 96 } 97 } 98 | Popular Tags |