public XmlRulesModuleOpenClass(XlsModuleSyntaxNode moduleNode, OpenL openl, IDataBase dbase, Set<CompiledDependency> moduleDependencies, IBindingContext bindingContext) { super(XlsHelper.getModuleName(moduleNode), new XlsMetaInfo(moduleNode), openl, dbase, moduleDependencies, Thread.currentThread().getContextClassLoader(), OpenLSystemProperties.isDTDispatchingMode(bindingContext.getExternalParams()), OpenLSystemProperties.isDispatchingValidationEnabled(bindingContext.getExternalParams())); this.projectData = ((XmlRulesModuleSyntaxNode) moduleNode).getProjectData(); }
public static String getModuleName(XlsModuleSyntaxNode node) { String uri = node.getModule().getUri(); try { URL url = new URL(uri); String file = url.getFile(); int index = file.lastIndexOf('/'); file = index < 0 ? file : file.substring(index + 1); index = file.lastIndexOf('.'); if (index > 0) { file = file.substring(0, index); } return makeJavaIdentifier(file); } catch (MalformedURLException e) { if(VirtualSourceCodeModule.SOURCE_URI.equals(uri)){ return "VirtualModule"; }else{ Log.error("Error URI to name conversion", e); return "UndefinedXlsType"; } } }
private TableSyntaxNode preprocessTable(IGridTable table, XlsSheetSourceCodeModule source, TablePartProcessor tablePartProcessor, Collection<OpenLMessage> messages) throws OpenLCompilationException { TableSyntaxNode tsn = XlsHelper.createTableSyntaxNode(table, source); String type = tsn.getType(); if (type.equals(XlsNodeTypes.XLS_TABLEPART.toString())) { try { tablePartProcessor.register(table, source); } catch (Exception e) { tsn = new TableSyntaxNode(XlsNodeTypes.XLS_OTHER .toString(), tsn.getGridLocation(), source, table, tsn.getHeader()); SyntaxNodeException sne = SyntaxNodeExceptionUtils.createError(e, tsn); tsn.addError(sne); messages.add(OpenLMessagesUtils.newErrorMessage(sne)); } } return tsn; }
private TableSyntaxNode preprocessTable(IGridTable table, XlsSheetSourceCodeModule source, TablePartProcessor tablePartProcessor) throws OpenLCompilationException { TableSyntaxNode tsn = XlsHelper.createTableSyntaxNode(table, source); String type = tsn.getType(); if (type.equals(XlsNodeTypes.XLS_ENVIRONMENT.toString())) { preprocessEnvironmentTable(tsn, source); } else if (type.equals(XlsNodeTypes.XLS_TABLEPART.toString())) { try { tablePartProcessor.register(table, source); } catch (Exception t) { tsn = new TableSyntaxNode(XlsNodeTypes.XLS_OTHER .toString(), tsn.getGridLocation(), source, table, tsn.getHeader()); SyntaxNodeException sne = SyntaxNodeExceptionUtils.createError(t, tsn); addError(sne); tsn.addError(sne); } } return tsn; }
@Override protected XlsLazyModuleOpenClass createModuleOpenClass(XlsModuleSyntaxNode moduleNode, OpenL openl, IDataBase dbase, Set<CompiledDependency> moduleDependencies, IBindingContext bindingContext) { return new XlsLazyModuleOpenClass(XlsHelper.getModuleName(moduleNode), new XlsMetaInfo(moduleNode), openl, dbase, prebindHandler, moduleDependencies, Thread.currentThread().getContextClassLoader(), OpenLSystemProperties.isDTDispatchingMode(bindingContext.getExternalParams()), OpenLSystemProperties.isDispatchingValidationEnabled((bindingContext.getExternalParams()))); } }
tsn = XlsHelper.createTableSyntaxNode(decisionTableSource, sheetSource); } catch (OpenLCompilationException e) { moduleContext.addMessages(OpenLMessagesUtils.newErrorMessages(e));
/** * Creates {@link XlsModuleOpenClass} * * @param moduleDependencies set of dependent modules for creating module. */ protected XlsModuleOpenClass createModuleOpenClass(XlsModuleSyntaxNode moduleNode, OpenL openl, IDataBase dbase, Set<CompiledDependency> moduleDependencies, IBindingContext bindingContext) { return new XlsModuleOpenClass(XlsHelper.getModuleName(moduleNode), new XlsMetaInfo(moduleNode), openl, dbase, moduleDependencies, Thread.currentThread().getContextClassLoader(), OpenLSystemProperties.isDTDispatchingMode(bindingContext.getExternalParams()), OpenLSystemProperties.isDispatchingValidationEnabled(bindingContext.getExternalParams())); }