InfoZoneTools API

org.infozone.tools.janalyzer
Class JavaCodeOutput

java.lang.Object
  |
  +--org.infozone.tools.janalyzer.JavaCodeOutput

public final class JavaCodeOutput
extends java.lang.Object

This class prints the lines of code and the affiliated comments of the output from the JavaCodeAnalyzer class. It makes line wrapping with splitting levels, correct indentation and comment creation. . This all is done after the Apache Source Conventions from SUN and therefore the ASF..


 TODO:
  - trailling comments
  - more documentation
  - doc comment cration for classes, constructors, fields, methods
 BUGS
  - comment items in "" are extracted to real comments
 

Version:
$Revision: 1.5 $ $Date: 2000/10/27 19:09:20 $
Author:
SMB
See Also:
org.infozone.janalyzer.JavaCodeAnalyzer

Constructor Summary
JavaCodeOutput(java.io.File fileIn, java.lang.String filenameOut, java.lang.String lineLength)
           
 
Method Summary
 java.lang.String getHighSplitLevel()
           
 java.lang.String getLowSplitLevel()
           
 java.lang.String getMiddleSplitLevel()
           
 java.lang.String getNextSplitLevel()
          Increase the split level and returns it.
 java.lang.String getObligateSplitLevel()
          If it present in a line and the line is longer then LINE_LENGTH then line must wrapped on this place.
 java.lang.String getSplitLevel()
          Splitting levels were used by the JavaCodeAnalyzer to set marker into the lines of code, were line wrapping is recommended.
 void increaseIndent()
          Increase the indentation String by oneIndent.
 java.lang.String mask(java.lang.String aText)
          If the split level String exits in the original source it must be masked
 void printClassComment(koala.dynamicjava.tree.Node aNode)
           
 void printComment()
          Invokes the method printOrigComment with the parameters commentStart, commentEnd.
 void printConstructorComment(koala.dynamicjava.tree.Node aNode)
           
 void printFieldComment(koala.dynamicjava.tree.Node aNode)
           
 void printImportComment(koala.dynamicjava.tree.Node aNode)
          Insert existing comments between Node.getBeginLine To lastline..
 void printInterfaceComment(koala.dynamicjava.tree.Node aNode)
           
 void println(java.lang.String aLine)
          This method print out the line.
 void printMethodComment(koala.dynamicjava.tree.MethodDeclaration method)
           
 void printPackageComment(koala.dynamicjava.tree.Node aNode)
           
 void printVariableComment(koala.dynamicjava.tree.Node aNode)
           
 void resetSplitLevel()
           
 void setCommentEnd(int end)
           
 void setCommentStart(int start)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JavaCodeOutput

public JavaCodeOutput(java.io.File fileIn,
                      java.lang.String filenameOut,
                      java.lang.String lineLength)
Method Detail

increaseIndent

public void increaseIndent()
Increase the indentation String by oneIndent.


mask

public java.lang.String mask(java.lang.String aText)
If the split level String exits in the original source it must be masked


getSplitLevel

public java.lang.String getSplitLevel()
Splitting levels were used by the JavaCodeAnalyzer to set marker into the lines of code, were line wrapping is recommended. Miscellaneous split level should give a priority were line wrapping is good or bad. A high level means a good place to wrap the line.

Returns:
The splitting level with splitting characters.

getLowSplitLevel

public java.lang.String getLowSplitLevel()
Returns:
The low splitting level with splitting characters.

getMiddleSplitLevel

public java.lang.String getMiddleSplitLevel()
Returns:
The middle splitting level with splitting characters.

getHighSplitLevel

public java.lang.String getHighSplitLevel()
Returns:
The high splitting level with splitting characters.

getObligateSplitLevel

public java.lang.String getObligateSplitLevel()
If it present in a line and the line is longer then LINE_LENGTH then line must wrapped on this place. Useful for correct indentation of e.g. ternary expressions.

Returns:
The obligation splitting level with splitting characters.

getNextSplitLevel

public java.lang.String getNextSplitLevel()
Increase the split level and returns it.


resetSplitLevel

public void resetSplitLevel()

println

public void println(java.lang.String aLine)
This method print out the line. It wrapping lines and so on. Code Convention Chapter 4.

Parameters:
aLine -

setCommentStart

public void setCommentStart(int start)

setCommentEnd

public void setCommentEnd(int end)

printComment

public void printComment()
Invokes the method printOrigComment with the parameters commentStart, commentEnd.


printImportComment

public void printImportComment(koala.dynamicjava.tree.Node aNode)
Insert existing comments between Node.getBeginLine To lastline.. This methods could be used to create empty comments.


printPackageComment

public void printPackageComment(koala.dynamicjava.tree.Node aNode)

printClassComment

public void printClassComment(koala.dynamicjava.tree.Node aNode)

printInterfaceComment

public void printInterfaceComment(koala.dynamicjava.tree.Node aNode)

printConstructorComment

public void printConstructorComment(koala.dynamicjava.tree.Node aNode)

printMethodComment

public void printMethodComment(koala.dynamicjava.tree.MethodDeclaration method)

printFieldComment

public void printFieldComment(koala.dynamicjava.tree.Node aNode)

printVariableComment

public void printVariableComment(koala.dynamicjava.tree.Node aNode)

InfoZoneTools API