gpt4 book ai didi

org.openl.rules.lang.xls.XlsNodeTypes类的使用及代码示例

转载 作者:知者 更新时间:2024-03-24 05:49:05 26 4
gpt4 key购买 nike

本文整理了Java中org.openl.rules.lang.xls.XlsNodeTypes类的一些代码示例,展示了XlsNodeTypes类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XlsNodeTypes类的具体详情如下:
包路径:org.openl.rules.lang.xls.XlsNodeTypes
类名称:XlsNodeTypes

XlsNodeTypes介绍

暂无

代码示例

代码示例来源:origin: openl-tablets/openl-tablets

public WorkbookSyntaxNode(WorksheetSyntaxNode[] nodes,
    TableSyntaxNode[] mergedTableParts,
    XlsWorkbookSourceCodeModule module) {
  super(XlsNodeTypes.XLS_WORKBOOK.toString(), null, nodes, module);
  this.mergedTableParts = mergedTableParts;
}

代码示例来源:origin: openl-tablets/openl-tablets

public static String str2name(String methodHeader, XlsNodeTypes tableType) {
  String resultName = methodHeader;
  if (StringUtils.isBlank(resultName)) {
    resultName = "NO NAME";
  } else if (tableType.equals(XlsNodeTypes.XLS_DATATYPE)) {
    String[] tokens = StringUtils.split(resultName.replaceAll(ROUND_BRACKETS_WITH_ANY_TEXT, ""));
    // ensure that the appropriate index exists
    //
    if (tokens.length > DatatypeNodeBinder.TYPE_INDEX) {
      resultName = tokens[DatatypeNodeBinder.TYPE_INDEX].trim();
    }            
  } else if (tableType.equals(XlsNodeTypes.XLS_DT) || tableType.equals(XlsNodeTypes.XLS_SPREADSHEET)
      || tableType.equals(XlsNodeTypes.XLS_TBASIC) || tableType.equals(XlsNodeTypes.XLS_COLUMN_MATCH)
      || tableType.equals(XlsNodeTypes.XLS_DATA)
      || tableType.equals(XlsNodeTypes.XLS_METHOD) || tableType.equals(XlsNodeTypes.XLS_TEST_METHOD)
      || tableType.equals(XlsNodeTypes.XLS_RUN_METHOD) || tableType.equals(XlsNodeTypes.XLS_CONSTANTS)
      || tableType.equals(XlsNodeTypes.XLS_ENVIRONMENT) || tableType.equals(XlsNodeTypes.XLS_PROPERTIES)) {
    String[] tokens = StringUtils.split(resultName.replaceAll(ROUND_BRACKETS_WITH_ANY_TEXT, ""));
    resultName = tokens[tokens.length - 1].trim();
  } else if (tableType.equals(XlsNodeTypes.XLS_OTHER)) {
    if (resultName != null && resultName.length() > 57) {
      resultName = resultName.substring(0, 57) + "...";
    }
  }
  return resultName;
}

代码示例来源:origin: openl-tablets/openl-tablets

/**
 * Use this method instead of {@link #getType()}. Returns the enum constant for 
 * the current node.
 * 
 * @return the {@link XlsNodeTypes} for current TableSyntaxNode
 */
public XlsNodeTypes getNodeType() {
  return XlsNodeTypes.getEnumByValue(getType());
}

代码示例来源:origin: openl-tablets/openl-tablets

public StringBuilder genLiteralTableType(XlsNodeTypes value, StringBuilder sb) {
  return sb.append(XlsNodeTypes.class.getSimpleName()).append(".").append(value.name());
}

代码示例来源:origin: openl-tablets/openl-tablets

return "Properties";
default:
  return tableSyntaxNode.getNodeType().name();

代码示例来源:origin: openl-tablets/openl-tablets

public OpenlSyntaxNode(String openlName, ILocation location, IOpenSourceCodeModule module) {
  super(XlsNodeTypes.XLS_OPENL.toString(), location, module);
  this.openlName = openlName;
}

代码示例来源:origin: openl-tablets/openl-tablets

private boolean isExecutableTableSyntaxNode(TableSyntaxNode tableSyntaxNode) {
  return XlsNodeTypes.XLS_DT.equals(tableSyntaxNode.getNodeType()) || XlsNodeTypes.XLS_TBASIC
    .equals(tableSyntaxNode.getNodeType()) || XlsNodeTypes.XLS_METHOD
      .equals(tableSyntaxNode.getNodeType()) || XlsNodeTypes.XLS_COLUMN_MATCH.equals(tableSyntaxNode
        .getNodeType()) || XlsNodeTypes.XLS_SPREADSHEET.equals(tableSyntaxNode.getNodeType());
}

代码示例来源:origin: org.openl.rules/org.openl.rules.webstudio

private String getName(IOpenLTable table) {
  String tableName = table.getDisplayName();
  if (tableName == null || tableName.isEmpty()) {
    tableName = TableSyntaxNodeUtils.str2name(table.getGridTable().getCell(0, 0).getStringValue()
      , XlsNodeTypes.getEnumByValue(table.getType()));
  }
  String[] dimensionProps = TablePropertyDefinitionUtils.getDimensionalTablePropertiesNames();
  ITableProperties tableProps = table.getProperties();
  StringBuilder dimensionBuilder = new StringBuilder();
  if (tableProps != null) {
    for (String dimensionProp : dimensionProps) {
      String propValue = tableProps.getPropertyValueAsString(dimensionProp);
      if (propValue != null && !propValue.isEmpty()) {
        dimensionBuilder.append(dimensionBuilder.length() == 0 ? "" : ", ").append(dimensionProp).append(" = ").append(propValue);
      }
    }
  }
  if (dimensionBuilder.length() > 0) {
    return tableName +"["+ dimensionBuilder.toString() +"]";
  } else {
    return tableName;
  }
}

代码示例来源:origin: openl-tablets/openl-tablets

public WorksheetSyntaxNode(TableSyntaxNode[] nodes, XlsSheetSourceCodeModule module) {
  super(XlsNodeTypes.XLS_WORKSHEET.toString(), null, nodes, module);
}

代码示例来源:origin: openl-tablets/openl-tablets

private boolean isSpreadsheetResultTableSyntaxNode(TableSyntaxNode tableSyntaxNode) {
  return XlsNodeTypes.XLS_SPREADSHEET.equals(tableSyntaxNode.getNodeType());
}

代码示例来源:origin: openl-tablets/openl-tablets

private String getName(IOpenLTable table) {
  String tableName = table.getDisplayName();
  if (tableName == null || tableName.isEmpty()) {
    tableName = TableSyntaxNodeUtils.str2name(table.getGridTable().getCell(0, 0).getStringValue()
      , XlsNodeTypes.getEnumByValue(table.getType()));
  }
  String[] dimensionProps = TablePropertyDefinitionUtils.getDimensionalTablePropertiesNames();
  ITableProperties tableProps = table.getProperties();
  StringBuilder dimensionBuilder = new StringBuilder();
  if (tableProps != null) {
    for (String dimensionProp : dimensionProps) {
      String propValue = tableProps.getPropertyValueAsString(dimensionProp);
      if (propValue != null && !propValue.isEmpty()) {
        dimensionBuilder.append(dimensionBuilder.length() == 0 ? "" : ", ").append(dimensionProp).append(" = ").append(propValue);
      }
    }
  }
  if (dimensionBuilder.length() > 0) {
    return tableName +"["+ dimensionBuilder.toString() +"]";
  } else {
    return tableName;
  }
}

代码示例来源:origin: openl-tablets/openl-tablets

private boolean isRunMethod(String type) {
    return XlsNodeTypes.XLS_RUN_METHOD.toString().equals(type);
  }
}

代码示例来源:origin: openl-tablets/openl-tablets

private static boolean isSpreadsheet(TableSyntaxNode o1) {
  return XlsNodeTypes.XLS_SPREADSHEET.equals(o1.getNodeType());
}

代码示例来源:origin: org.openl.rules/org.openl.rules.webstudio

private void initTableName() {
  if (table != null) {
    String name = table.getName();
    if (StringUtils.isEmpty(name)) {
      // If table contains errors, it will not contain compiled name. Try to parse table header instead.
      String methodHeader = table.getGridTable().getCell(0, 0).getStringValue();
      name = TableSyntaxNodeUtils.str2name(methodHeader, XlsNodeTypes.getEnumByValue(table.getType()));
    }
    tableTechnicalName = name;
  }
}

代码示例来源:origin: openl-tablets/openl-tablets

public XlsModuleSyntaxNode(WorkbookSyntaxNode[] nodes,
    IOpenSourceCodeModule module,
    OpenlSyntaxNode openlNode,
    Collection<String> imports) {
  super(XlsNodeTypes.XLS_MODULE.toString(), null, nodes, module);
  this.openlNode = openlNode;
  this.imports.addAll(imports);
  this.libraries.addAll(libraries);
}

代码示例来源:origin: openl-tablets/openl-tablets

/**
 * TODO: This method should be generic for the TableSyntaxNode
 * and return the type of the table
 * e.g. TableSyntaxNode.getTableReturnType()
 */
public static String getDatatypeName(TableSyntaxNode tsn) throws OpenLCompilationException {
  if (XlsNodeTypes.XLS_DATATYPE.equals(tsn.getNodeType())) {
    IOpenSourceCodeModule src = tsn.getHeader().getModule();
    IdentifierNode[] parsedHeader = tokenizeHeader(src);
    return parsedHeader[DatatypeNodeBinder.TYPE_INDEX].getIdentifier();
  }
  return null;
}

代码示例来源:origin: openl-tablets/openl-tablets

private void initTableName() {
  if (table != null) {
    String name = table.getName();
    if (StringUtils.isEmpty(name)) {
      // If table contains errors, it will not contain compiled name. Try to parse table header instead.
      String methodHeader = table.getGridTable().getCell(0, 0).getStringValue();
      name = TableSyntaxNodeUtils.str2name(methodHeader, XlsNodeTypes.getEnumByValue(table.getType()));
    }
    tableTechnicalName = name;
  }
}

代码示例来源:origin: openl-tablets/openl-tablets

private boolean isTestMethod(String type) {
  return XlsNodeTypes.XLS_TEST_METHOD.toString().equals(type);
}

代码示例来源:origin: openl-tablets/openl-tablets

private String getParentDatatypeName(TableSyntaxNode tsn) {
  if (XlsNodeTypes.XLS_DATATYPE.equals(tsn.getNodeType())) {
    IOpenSourceCodeModule src = tsn.getHeader().getModule();
    IdentifierNode[] parsedHeader = new IdentifierNode[0];
    try {
      parsedHeader = DatatypeHelper.tokenizeHeader(src);
    } catch (OpenLCompilationException e) {
      // Suppress the exception
      // This exception has already been processed when parsing the table header
      //
    }
    if (parsedHeader.length == 4) {
      return parsedHeader[DatatypeNodeBinder.PARENT_TYPE_INDEX].getIdentifier();
    } else {
      return null;
    }
  }
  return null;
}

代码示例来源:origin: org.openl.rules/org.openl.rules.webstudio.java

public boolean isServiceTable() {
  String tableType = table.getType();
  if (XlsNodeTypes.XLS_ENVIRONMENT.toString().equals(tableType)
      || XlsNodeTypes.XLS_OTHER.toString().equals(tableType)
      || XlsNodeTypes.XLS_PROPERTIES.toString().equals(tableType)) {
    return true;
  }
  return false;
}

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com