com.borland.jbuilder.jot
Interface JotSourceFile

All Superinterfaces:
JotCommentable, JotFile, JotMarker

public interface JotSourceFile
extends JotFile, JotCommentable

This interface provides additional methods for manipulating a Java source file.


Method Summary
 JotClassSource addClass(JotMarker marker, boolean before, java.lang.String name, boolean isInterface)
          Creates a JotClassSource object with the specified name and inserts it into the file.
 JotImport addImport(java.lang.String name)
          Creates a JotImport object for the specified package or class and inserts it in the file.
 void addJotFileListener(JotFileListener l)
           
 int getComparableLocation(JotMarker m)
          Returns a value that can be used to determine the order of statements in this file.
 java.lang.String getFullClassName(java.lang.String className)
          Returns the fully-qualified name of the given className as if the class had been declared in this file.
 JotImport getImport(java.lang.String name)
          Returns the JotImport object which imports the specified class or package.
 JotImport[] getImports()
          Returns an array of JotImport objects which represent the import statements in this source file.
 JotPackages getPackageManager()
          convience method for getting the proper JotPackages object do deal with
 boolean isReadOnly()
          Returns true if this file cannot be modified.
 java.lang.String out()
           
 void removeClass(JotClass clazz)
          Removes the specified class from the file.
 void removeImport(JotImport imp)
          Removes the import statement represented by the specified JotImport object from the file.
 void removeJotFileListener(JotFileListener l)
           
 void reRead()
          Internal use only.
 void setPackage(java.lang.String packageName)
          Sets the package which contains this file.
 void setTimestamp(long t)
          Internal use only.
 
Methods inherited from interface com.borland.jbuilder.jot.JotFile
getClass, getClasses, getName, getPackage, getTimestamp, getUrl
 
Methods inherited from interface com.borland.jbuilder.jot.JotCommentable
addBlankLine, addComment, getComment, removeComment
 
Methods inherited from interface com.borland.jbuilder.jot.JotMarker
addUserData, getEndPosition, getStartPosition, getUserData
 

Method Detail

setPackage

public void setPackage(java.lang.String packageName)
Sets the package which contains this file.

getImports

public JotImport[] getImports()
Returns an array of JotImport objects which represent the import statements in this source file. If there are no import statements, then returns a zero-length array.

getImport

public JotImport getImport(java.lang.String name)
Returns the JotImport object which imports the specified class or package. Classes should be specified by a fully-qualified classname, and packages should be specified in import format, e.g. java.lang.*.

addImport

public JotImport addImport(java.lang.String name)
Creates a JotImport object for the specified package or class and inserts it in the file. Classes should be specified by a fully-qualified classname, and packages should be specified in import format, e.g. java.lang.*.

removeImport

public void removeImport(JotImport imp)
Removes the import statement represented by the specified JotImport object from the file.

addClass

public JotClassSource addClass(JotMarker marker,
                               boolean before,
                               java.lang.String name,
                               boolean isInterface)
Creates a JotClassSource object with the specified name and inserts it into the file. If isInterface is true, then the class will be declared as an interface.

removeClass

public void removeClass(JotClass clazz)
Removes the specified class from the file.

getFullClassName

public java.lang.String getFullClassName(java.lang.String className)
Returns the fully-qualified name of the given className as if the class had been declared in this file.

getComparableLocation

public int getComparableLocation(JotMarker m)
Returns a value that can be used to determine the order of statements in this file. When comparing two statements in the file, the value returned for the statement that comes first will be less than the value returned for the other.

setTimestamp

public void setTimestamp(long t)
Internal use only. Sets the last modified date of this file as a long.

addJotFileListener

public void addJotFileListener(JotFileListener l)

removeJotFileListener

public void removeJotFileListener(JotFileListener l)

isReadOnly

public boolean isReadOnly()
Returns true if this file cannot be modified.

getPackageManager

public JotPackages getPackageManager()
convience method for getting the proper JotPackages object do deal with
Specified by:
getPackageManager in interface JotFile

reRead

public void reRead()
Internal use only. Forces reread of the source file. After this method is invoked, all references to existing JotSourceElements in this file are invalid.

out

public java.lang.String out()