@SuppressWarnings({"unchecked", "resource"}) private ElementScript getClassName(Node node, String normailzator) { String value = XMLUtil.getTextContent(node, ".", true); ValueSourceType qsSourceType = ValueSourceType.valueOf(XMLUtil.getTextContent(node, "@source", true, "STATIC", true)); try { if (qsSourceType == ValueSourceType.GROOVY_FILE || qsSourceType == ValueSourceType.FILE || qsSourceType == ValueSourceType.JAVA_CLASS) { return new ElementScript(qsSourceType, value); } else { AppEnv.logger.errorLogEntry( "Included script did not implemented, form rule=" + parentRule.getID() + ", node=" + node.getBaseURI()); } } catch (MultipleCompilationErrorsException e) { AppEnv.logger.errorLogEntry( "Script compilation error at form rule compiling=" + parentRule.getID() + ", node=" + node.getBaseURI()); AppEnv.logger.errorLogEntry(e.getMessage()); } return null; }
private static String getSystemIdFromNode(Node node) { if (node != null) { try { return node.getBaseURI(); } // If the DOM implementation is DOM Level 2 // then a NoSuchMethodError will be thrown. // Just ignore it. catch (NoSuchMethodError e) { return null; } // There was a failure for some other reason // Ignore it as well. catch (Exception e) { return null; } } return null; }