适用于Java的最佳漂亮打印库? [英] Best pretty-printing library for Java?

查看:727
本文介绍了适用于Java的最佳漂亮打印库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

什么是Java最好的漂亮打印库?我的意思是一个用于打印带缩进,中断提示等格式化输出的库,不是用于美化/重新格式化Java代码本身的库。理想情况下,图书馆将与 System.out.println 和朋友玩得很开心。

What is the single best pretty-printing library for Java? I mean a library for printing formatted output with indentation, break hints, etc., not a library for beautifying/re-formatting Java code itself. Ideally, the library would "play nice" with System.out.println and friends.

想一想我正在寻找的,请参阅OCaml的格式模块,特别是 Format.fprintf

For an idea of what I'm looking for, see OCaml's Format module, particularly Format.fprintf.

[更新]我不是在寻找控制台窗口库。漂亮的打印库允许您定义格式化任意值的方法,以便保留缩进并在合理的位置选择换行符。这些库存在于 Haskell 标准ML OCaml F# Scheme XTC库 xtc.tree.Printer中提供了部分功能,但它不像其他语言的库那么灵活。

[UPDATE] I am not looking for a console windowing library. A pretty-printing library allows you to define methods for formatting arbitrary values such that indentation is preserved and line breaks are chosen at sensible locations. Such libraries exist for Haskell, Standard ML, OCaml, F#, and Scheme. The XTC library provides some of this functionality in xtc.tree.Printer, but it is not nearly as flexible as the libraries in other languages.

推荐答案

jpplib

这篇关于适用于Java的最佳漂亮打印库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆