1 16 19 package org.apache.xalan.extensions; 20 21 import java.io.IOException ; 22 import java.util.Vector ; 23 24 import javax.xml.transform.TransformerException ; 25 26 import org.apache.xalan.templates.ElemTemplateElement; 27 import org.apache.xalan.templates.Stylesheet; 28 import org.apache.xalan.transformer.TransformerImpl; 29 import org.apache.xpath.functions.FuncExtFunction; 30 31 40 public abstract class ExtensionHandler 41 { 42 43 44 protected String m_namespaceUri; 45 46 47 protected String m_scriptLang; 48 49 55 static Class getClassForName(String className) 56 throws ClassNotFoundException 57 { 58 if(className.equals("org.apache.xalan.xslt.extensions.Redirect")) { 60 className = "org.apache.xalan.lib.Redirect"; 61 } 62 63 return ObjectFactory.findProviderClass( 64 className, ObjectFactory.findClassLoader(), true); 65 } 66 67 74 protected ExtensionHandler(String namespaceUri, String scriptLang) 75 { 76 m_namespaceUri = namespaceUri; 77 m_scriptLang = scriptLang; 78 } 79 80 85 public abstract boolean isFunctionAvailable(String function); 86 87 94 public abstract boolean isElementAvailable(String element); 95 96 108 public abstract Object callFunction( 109 String funcName, Vector args, Object methodKey, 110 ExpressionContext exprContext) throws TransformerException ; 111 112 123 public abstract Object callFunction( 124 FuncExtFunction extFunction, Vector args, 125 ExpressionContext exprContext) throws TransformerException ; 126 127 148 public abstract void processElement( 149 String localPart, ElemTemplateElement element, TransformerImpl transformer, 150 Stylesheet stylesheetTree, Object methodKey) throws TransformerException , IOException ; 151 } 152 | Popular Tags |