jaxp/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/compiler/FunctionTable.java
equal
deleted
inserted
replaced
22 /* |
22 /* |
23 * $Id: FunctionTable.java,v 1.3 2005/09/28 13:49:34 pvedula Exp $ |
23 * $Id: FunctionTable.java,v 1.3 2005/09/28 13:49:34 pvedula Exp $ |
24 */ |
24 */ |
25 package com.sun.org.apache.xpath.internal.compiler; |
25 package com.sun.org.apache.xpath.internal.compiler; |
26 |
26 |
27 import com.sun.org.apache.xpath.internal.Expression; |
|
28 import com.sun.org.apache.xpath.internal.functions.Function; |
27 import com.sun.org.apache.xpath.internal.functions.Function; |
29 import java.util.HashMap; |
28 import java.util.HashMap; |
30 import javax.xml.transform.TransformerException; |
29 import javax.xml.transform.TransformerException; |
31 |
30 |
32 /** |
31 /** |
339 */ |
338 */ |
340 Function getFunction(int which) |
339 Function getFunction(int which) |
341 throws javax.xml.transform.TransformerException |
340 throws javax.xml.transform.TransformerException |
342 { |
341 { |
343 try{ |
342 try{ |
344 if (which < NUM_BUILT_IN_FUNCS) |
343 if (which < NUM_BUILT_IN_FUNCS) { |
345 return (Function) m_functions[which].newInstance(); |
344 return (Function) m_functions[which].newInstance(); |
346 else |
345 } else { |
347 return (Function) m_functions_customer[ |
346 Class<?> c = m_functions_customer[which-NUM_BUILT_IN_FUNCS]; |
348 which-NUM_BUILT_IN_FUNCS].newInstance(); |
347 return (Function) c.newInstance(); |
|
348 } |
349 }catch (IllegalAccessException ex){ |
349 }catch (IllegalAccessException ex){ |
350 throw new TransformerException(ex.getMessage()); |
350 throw new TransformerException(ex.getMessage()); |
351 }catch (InstantiationException ex){ |
351 }catch (InstantiationException ex){ |
352 throw new TransformerException(ex.getMessage()); |
352 throw new TransformerException(ex.getMessage()); |
353 } |
353 } |