views:

83

answers:

3

Hello,

I need a library for Java that is able to beautify/format source code from a textual representation (String, file, etc).

I've already searched for something like this but didn't find anything that does exactly this. Only tools that parse their own tree structures, or that are IDE plugins or are standalone applications.

At first it seems that Jalopy does that, but I couldn't manage to use it due to poor documentation.

Any ideas?

EDIT:

I accidentally found what I was looking for: Eclipse JDT's CodeFormatter API.

http://help.eclipse.org/helios/topic/org.eclipse.jdt.doc.isv/guide/jdt_api_codeformatter.htm

+1  A: 

if you are looking for a syntax highlighter check following:

http://syntax.jedit.org/

https://jhighlight.dev.java.net/

Andy Lin
A: 

I accidentally found what I was looking for: Eclipse JDT's CodeFormatter API.

http://help.eclipse.org/helios/topic/org.eclipse.jdt.doc.isv/guide/jdt_api_codeformatter.htm

halfwarp