use of com.sun.org.apache.xml.internal.security.transforms.implementations.FuncHere in project jdk8u_jdk by JetBrains.
the class XalanXPathAPI method fixupFunctionTable.
private static synchronized void fixupFunctionTable() {
installed = false;
if (log.isLoggable(java.util.logging.Level.FINE)) {
log.log(java.util.logging.Level.FINE, "Registering Here function");
}
/**
* Try to register our here() implementation as internal function.
*/
try {
Class<?>[] args = { String.class, Expression.class };
Method installFunction = FunctionTable.class.getMethod("installFunction", args);
if ((installFunction.getModifiers() & Modifier.STATIC) != 0) {
Object[] params = { "here", new FuncHere() };
installFunction.invoke(null, params);
installed = true;
}
} catch (Exception ex) {
log.log(java.util.logging.Level.FINE, "Error installing function using the static installFunction method", ex);
}
if (!installed) {
try {
funcTable = new FunctionTable();
Class<?>[] args = { String.class, Class.class };
Method installFunction = FunctionTable.class.getMethod("installFunction", args);
Object[] params = { "here", FuncHere.class };
installFunction.invoke(funcTable, params);
installed = true;
} catch (Exception ex) {
log.log(java.util.logging.Level.FINE, "Error installing function using the static installFunction method", ex);
}
}
if (log.isLoggable(java.util.logging.Level.FINE)) {
if (installed) {
log.log(java.util.logging.Level.FINE, "Registered class " + FuncHere.class.getName() + " for XPath function 'here()' function in internal table");
} else {
log.log(java.util.logging.Level.FINE, "Unable to register class " + FuncHere.class.getName() + " for XPath function 'here()' function in internal table");
}
}
}
Aggregations