com.threerings.presents.tools
Class SourceFile

java.lang.Object
  extended by com.threerings.presents.tools.SourceFile

public class SourceFile
extends Object

Reads in a source file, allows the replacement of a "generated fields" and "generated methods" section and writing of the file back out to the disk.


Constructor Summary
SourceFile()
           
 
Method Summary
 boolean containsString(String text)
          Returns true if the supplied text appears in the non-auto-generated section.
 String generate(String fsection, String msection)
          Writes the code out to the specified file.
 void readFrom(File source)
          Reads the code from the supplied source file.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SourceFile

public SourceFile()
Method Detail

readFrom

public void readFrom(File source)
              throws IOException
Reads the code from the supplied source file.

Throws:
IOException

containsString

public boolean containsString(String text)
Returns true if the supplied text appears in the non-auto-generated section.


generate

public String generate(String fsection,
                       String msection)
                throws IOException
Writes the code out to the specified file.

Parameters:
fsection - the new "generated fields" to write to the file, or null.
msection - the new "generated methods" to write to the file, or null.
Throws:
IOException


Copyright © 2011. All Rights Reserved.