com.borland.jbuilder.jot
Interface JotPackages


public interface JotPackages

This interface represents the manager of paths, packages, classes & files.


Field Summary
static int NEED_ANY
           
static int NEED_CLASS
           
static int NEED_SOURCE
           
 
Method Summary
 boolean checkReread(JotSourceFile file)
          Returns true if the jot source file has changed out from under the objects, and forces a re-read if this is the case.
 void commit(JotSourceFile file)
          commit changes in the jot source objects back down to the source buffer or stream
 void commitAs(JotSourceFile file, java.lang.String fileName)
          Deprecated.  
 void commitTo(JotSourceFile file, java.lang.String fileName)
          Deprecated.  
 JotClass getClass(JotSourceFile importContext, java.lang.String className, int needs)
          Returns the JotClass object representing the specified class within the specified import context.
 JotClass getClass(java.lang.String classname, int needs)
          Get a JotType or JotClass by full classname.
 java.lang.String getEncoding()
          Returns the character encoding used that should be used by JOT for parsing.
 JotFile getFile(Url url)
          Returns a JotFile for the given filename.
 java.util.Iterator getFiles(java.lang.String packageName, int needs)
          Returns an interator over file urls (jbuilder.addin.Url)--either readOnly (.class) or readWrite (.java) based on needs & availability, given a package name string in dot or file.separator form
 java.util.ArrayList getFilesArray(java.lang.String packageName, int needs)
          Returns an array of file urls (jbuilder.addin.Url)--either readOnly (.class) or readWrite (.java) based on needs & availability, given a package name string in dot or file.separator form
 java.lang.String getPackage(JotSourceFile importContext, java.lang.String className, int needs)
          Given a classname reference in an import context, determine its package
 java.util.Iterator getPackages(int needs)
          Returns an iterator over package name Strings in dot separated form
 java.util.ArrayList getPackagesArray(int needs)
          Returns an array of package name Strings in dot separated form
 JotSourceFile getSourceFile(Url url)
          Returns a JotSourceFile for the given Url.
 Url getUrl(java.lang.String classname, int needs)
          Get the Url for the file that holds a given class
 java.lang.Class loadClass(java.lang.String className)
          Returns a java.lang.Class definition for a classname.
 void release(JotFile file)
          release all objects and resources allocated by the source or class file, & flush caches to it
 void releaseAll()
          release all objects and resources allocated by all files & classes of this package manager
 void shutdown()
          shutdown the package manager, clear all caches
 

Field Detail

NEED_ANY

public static final int NEED_ANY

NEED_CLASS

public static final int NEED_CLASS

NEED_SOURCE

public static final int NEED_SOURCE
Method Detail

getEncoding

public java.lang.String getEncoding()
Returns the character encoding used that should be used by JOT for parsing.

getClass

public JotClass getClass(java.lang.String classname,
                         int needs)
Get a JotType or JotClass by full classname. Returns null if the class does not exist.

getClass

public JotClass getClass(JotSourceFile importContext,
                         java.lang.String className,
                         int needs)
Returns the JotClass object representing the specified class within the specified import context. Returns null if the class is not included in the import context.

getUrl

public Url getUrl(java.lang.String classname,
                  int needs)
Get the Url for the file that holds a given class

loadClass

public java.lang.Class loadClass(java.lang.String className)
                          throws java.lang.ClassNotFoundException
Returns a java.lang.Class definition for a classname.

getFile

public JotFile getFile(Url url)
Returns a JotFile for the given filename.

getSourceFile

public JotSourceFile getSourceFile(Url url)
Returns a JotSourceFile for the given Url.

release

public void release(JotFile file)
release all objects and resources allocated by the source or class file, & flush caches to it

releaseAll

public void releaseAll()
release all objects and resources allocated by all files & classes of this package manager

shutdown

public void shutdown()
shutdown the package manager, clear all caches

getPackagesArray

public java.util.ArrayList getPackagesArray(int needs)
Returns an array of package name Strings in dot separated form

getPackages

public java.util.Iterator getPackages(int needs)
Returns an iterator over package name Strings in dot separated form

getFilesArray

public java.util.ArrayList getFilesArray(java.lang.String packageName,
                                         int needs)
Returns an array of file urls (jbuilder.addin.Url)--either readOnly (.class) or readWrite (.java) based on needs & availability, given a package name string in dot or file.separator form

getFiles

public java.util.Iterator getFiles(java.lang.String packageName,
                                   int needs)
Returns an interator over file urls (jbuilder.addin.Url)--either readOnly (.class) or readWrite (.java) based on needs & availability, given a package name string in dot or file.separator form

commit

public void commit(JotSourceFile file)
commit changes in the jot source objects back down to the source buffer or stream

commitTo

public void commitTo(JotSourceFile file,
                     java.lang.String fileName)
Deprecated.  


commitAs

public void commitAs(JotSourceFile file,
                     java.lang.String fileName)
Deprecated.  


checkReread

public boolean checkReread(JotSourceFile file)
Returns true if the jot source file has changed out from under the objects, and forces a re-read if this is the case. Any cached object references become invalid at this point.

getPackage

public java.lang.String getPackage(JotSourceFile importContext,
                                   java.lang.String className,
                                   int needs)
Given a classname reference in an import context, determine its package