codesimian
Class JavaTextTransform

java.lang.Object
  extended by codesimian.JavaTextTransform

public class JavaTextTransform
extends java.lang.Object


Constructor Summary
JavaTextTransform()
           
 
Method Summary
static java.lang.String removeEverythingExceptComments(java.lang.String textOfJavaFile)
          this uses a simple algorithm that usually works, but not always
static java.lang.String writeCommentAtTop(java.lang.String javaComment, java.lang.String textOfJavaFile, boolean overwrite)
          writes javaComment at the top of a .java file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JavaTextTransform

public JavaTextTransform()
Method Detail

writeCommentAtTop

public static java.lang.String writeCommentAtTop(java.lang.String javaComment,
                                                 java.lang.String textOfJavaFile,
                                                 boolean overwrite)
writes javaComment at the top of a .java file.

Parameters:
javaComment - must start with / * and end with * / (without the space between * and /).
overwrite - Optionally overwrite first comment found before first java code. WARNING: does not notice that * / may be after a // and therefore does not apply. WARNING: does not notice if comments are in a string literal.

removeEverythingExceptComments

public static java.lang.String removeEverythingExceptComments(java.lang.String textOfJavaFile)
this uses a simple algorithm that usually works, but not always