@Override
public IMemberBoundNode preBind(TableSyntaxNode tsn, OpenL openl, IBindingContext cxt, XlsModuleOpenClass module)
throws Exception {
assert cxt instanceof RulesModuleBindingContext;
PropertyTableBoundNode propertyNode = (PropertyTableBoundNode) makeNode(tsn, module, cxt);
String tableName = parseHeader(tsn);
propertyNode.setTableName(tableName);
if (tableName == null) {
tableName = DEFAULT_TABLE_NAME_PREFIX + tsn.getUri();
}
ITable propertyTable = module.getDataBase().registerTable(tableName, tsn);
IOpenClass propertiesClass = JavaOpenClass.getOpenClass(TableProperties.class);
ILogicalTable propTableBody = getTableBody(tsn);
try {
processTable(module, propertyTable, propTableBody, tableName, propertiesClass, cxt, openl, false);
} catch (SyntaxNodeException ex) {
throw SyntaxNodeExceptionUtils.createError("Table definiton is wrong.", ex, ex.getSyntaxNode());
}
TableProperties propertiesInstance = ((TableProperties[]) propertyTable.getDataArray())[0];
propertiesInstance.setPropertiesSection(tsn.getTable().getRows(1));
propertiesInstance.setCurrentTableType(tsn.getType());
PropertiesChecker.checkProperties(cxt, propertiesInstance.getAllProperties().keySet(), tsn,
InheritanceLevel.getEnumByValue(propertiesInstance.getPropertyValueAsString(SCOPE_PROPERTY_NAME)));
tsn.setTableProperties(propertiesInstance);
analysePropertiesNode(tsn, propertiesInstance, (RulesModuleBindingContext) cxt, propertyNode);
propertyNode.setPropertiesInstance(propertiesInstance);
return propertyNode;
}