类 Auxiliary

java.lang.Object
com.sh.javax.util.Auxiliary

public class Auxiliary extends Object
网页处理辅助类
  • 字段详细资料

    • checkOrderList

      public static final List<String> checkOrderList
  • 构造器详细资料

    • Auxiliary

      public Auxiliary(DataCenter dc)
      构造函数,传入数据中心实例
      参数:
      dc - 数据中心实例
  • 方法详细资料

    • getTemplate

      public String getTemplate(String fileName) throws FileNotFoundException, IOException
      将指定的文件作为一个输入流
      参数:
      fileName - 文件名称
      返回:
      文件输入流
      抛出:
      FileNotFoundException - FileNotFoundException
      IOException
    • getPagesNavigator

      public String getPagesNavigator(String baseUrl, int currentPage, int totalPages, int totalRows)
      通过指定的参数,生成用于上下翻页的html语法
      参数:
      baseUrl - 用于翻页类的URL
      currentPage - 当前页编号
      totalPages - 总页数
      totalRows - 总行数
      返回:
      生成后的语法
    • replaceHTMLTag

      public String replaceHTMLTag(String templateHTML, String tag, String value)
      替换某一字符串中的标记
      参数:
      templateHTML - 待替换的字符串
      tag - 标记
      value - 标记替换值
      返回:
      标记被替换后的html语法
    • getSubString

      public static String getSubString(String longStr, int len)
      对中英文混合的字符串取子串(中文视为两个半宽字符)
      参数:
      longStr - 用于取子串的字符串
      len - 子串的长度
      返回:
      取得的子串
    • getValueOfInc

      public Object getValueOfInc(String tableName, String colName, String colType) throws Exception
      取得表中某一字段的最大值不并且加一
      参数:
      tableName - 表名
      colName - 字段名
      colType - 字段的类型,integer/double/string
      返回:
      最大值加一后的值
      抛出:
      Exception - Exception
    • checkOrderby

      public String checkOrderby(String sql)
      检查SQL是否以order by 结尾
      参数:
      sql - String
      返回:
      String
    • calDatasetRows

      public int calDatasetRows(String sql, boolean cache)
      计算由某一条SQL查询出来的数据集的总行数
      参数:
      sql - String查询语句
      cache - boolean
      返回:
      int 数据集的行数
    • calDatasetRows

      public int calDatasetRows(String sql, String[] colsType, Object[] obj, boolean cache)
      计算由某一条SQL查询出来的数据集的总行数
      参数:
      sql - String查询语句
      colsType - String[]列类型
      obj - Object[]参数
      cache - boolean
      返回:
      int 数据集的行数
    • main

      public static void main(String[] args)