Best pretty-printing library for Java? [closed]

浪尽此生 提交于 2019-11-30 04:21:03

问题


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.

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

[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.


回答1:


Is it jpplib?




回答2:


Since you talk about boxes, break hints and so on I assume you mean to build a text-based windowing application. So I guess that you are looking for something similar to Ncurses but in Java. Maybe charva could help you.




回答3:


You may also try javacurses.

According to Dr. Dobb's Code Talk it is cute.




回答4:


I would say its still easier using Xalan + Sax, like in this example.



来源:https://stackoverflow.com/questions/332166/best-pretty-printing-library-for-java

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!