当前位置: 首页 > news >正文

手机可以建立网站吗深圳品牌设计公司排行榜

手机可以建立网站吗,深圳品牌设计公司排行榜,wordpress解释,iis新建网站文章目录 问题解决方案覆盖方法代码yaml配置#xff1a;指定保存历史命令文件的路径 问题 最近工作上遇到的一个小问题#xff0c;在Spring Shell中#xff0c;我们可以自己定义一些命令#xff0c;已完成我们想要的功能#xff0c;也可以使用内置命令如help、history、c… 文章目录 问题解决方案覆盖方法代码yaml配置指定保存历史命令文件的路径 问题 最近工作上遇到的一个小问题在Spring Shell中我们可以自己定义一些命令已完成我们想要的功能也可以使用内置命令如help、history、clear。但当一些内置命令达不到我们想要的功能时就需要对其进行重新。如本次遇到的histroy命令显示的格式是一个List列表所有命令在一行。而我想要其以每一条命令一行的格式输出就需要对其进行覆盖。 解决方案 覆盖方法 实现History.Command 接口。类路径org.springframework.shell.standard.commands.History添加注解ShellCommandGroup(“Built-In Commands”) 表示这个是一个内置命令。直接复用History中的history方法保留其原有功能在这个基础上将命令每个一行输出。 代码 import org.springframework.shell.standard.commands.History;import java.io.File; import java.io.FileWriter; import java.io.IOException;ShellComponent ShellCommandGroup(Built-In Commands) public class MyHistory implements History.Command {private org.jline.reader.History jLineHistory null;public MyHistory(org.jline.reader.History jLineHistory) {this.jLineHistory jLineHistory;}// 函数名要保持不变ShellMethod(value Display or save the history of previously run commands)public String history(ShellOption(help A file to save history to., defaultValue ShellOption.NULL) File file) throws IOException {StringBuffer buffer new StringBuffer();if (file null) {jLineHistory.forEach(line - buffer.append(line).append(\n));return buffer.toString();} else {try (FileWriter w new FileWriter(file)) {for (org.jline.reader.History.Entry entry : jLineHistory) {w.append(entry.line()).append(System.lineSeparator());}}return String.format(Wrote %d entries to %s, jLineHistory.size(), file);}} }org.springframework.shell.standard.commands.History 代码 ShellComponent public class History {private final org.jline.reader.History jLineHistory;public History(org.jline.reader.History jLineHistory) {this.jLineHistory jLineHistory;}public interface Command {}ShellMethod(value Display or save the history of previously run commands)public ListString history(ShellOption(help A file to save history to., defaultValue ShellOption.NULL) File file) throws IOException {if (file null) {ListString result new ArrayList(jLineHistory.size());jLineHistory.forEach(e - result.add(e.line()));return result;} else {try (FileWriter w new FileWriter(file)) {for (org.jline.reader.History.Entry entry : jLineHistory) {w.append(entry.line()).append(System.lineSeparator());}}return Collections.singletonList(String.format(Wrote %d entries to %s, jLineHistory.size(), file));}} } yaml配置指定保存历史命令文件的路径 spring:main:banner-mode: CONSOLEshell:interactive:enabled: truehistory:name: log/history.log
http://www.pierceye.com/news/959793/

相关文章:

  • 四川省营山县西城建筑公司网站租服务器 wordpress
  • 绿色蔬菜网站模板昆明软件开发公司排名
  • 东台做淘宝网站爱站seo工具包免费版
  • 做网站运营的简历学做家庭树网站
  • 专业做企业网站网页制作与网站建设 在线作业
  • 开放大学门户网站建设方案动易网站模版的制作
  • 怎样做个网站聊城网站推广动态
  • 门户网站优化南阳网站制作哪家好
  • 环球易购招聘网站建设宜昌最权威网站建设公司
  • 建设银行官网首页网站南山片区怎么免费制作一个网站
  • 100个免费推广网站的排名wordpress改变默认后台登录地址
  • 做爰片免费观看网站腾讯广点通
  • 上海小企业网站建设我想找个人做网站
  • 第一代网站建设技术wordpress设置金币
  • 邯郸移动网站建设价格制作移动端网站价格
  • wordpress设置多站点盐城公司做网站
  • 便宜建站空间深圳品牌网站设计格
  • 网站 建设可行性报告做公司网站的平台
  • 什么网站内链建设建设专业网站怎样收费
  • wordpress 图片站主题seo前景
  • jsp编写网站网站开发售后工作
  • 门户网站建站目标泰安招聘信息最新招聘2022
  • 电商网站建设效果app技术
  • 关于文化的网站模板做免费小说网站怎样赚钱
  • 做外贸的人常用的网站黄骅贴吧二手房
  • 网站建设科目提供网站建设教学视频
  • iis搭建网站教程win10淘宝客网站建设的策略
  • 怎么做一个网站 免费90平方设计
  • 网站建设的目的与意义是什么东营网站建设教程
  • 盐城seo网站优化珠海微信网站