|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.borland.jbuilder.paths.PathSet
A PathSet represents a collection of Java paths and is typically used to define a library for use by a JBuilder project. In addition to the definition of class, source, and documentation paths, a library may also list a number of additional libraries that it needs path entries from to function correctly.
Each path has a total of three accessor methods, combining the typical getter and setter with a "full" getter that incorporates all of the path entries from other libraries required by this library.
Two specialized subclasses of PathSet, JDKPathSet and ProjectPathSet, provide additional characteristics for defining JDKs and projects, respectively.
Field Summary | |
protected PathSetCollection |
collection
|
static PathSet[] |
EMPTY_ARRAY
|
protected boolean |
hasChanged
This value tracks if changes have been made to this PathSet since it was last loaded or saved |
protected long |
lastFullUpdate
This value indicates the last change that has been incorporated into the "full path" caches and resolved libraries |
protected long |
lastModified
This value indicates the last change that has been made to this PathSet |
protected java.lang.String[] |
requiredNames
|
Constructor Summary | |
PathSet(java.lang.String name)
Creates a new library PathSet. |
Method Summary | |
int |
addEntries(Url url)
Recursively scans the specified directory for valid doc, source, and class paths. |
protected void |
addUniquePath(java.util.List list,
Url url)
Adds a path to a list of paths if and only if it is not already a member of the list. |
protected Url[] |
addUniquePath(Url[] oldPath,
Url url)
Adds a path to an array of paths if and only if it is not already a member of the array. |
protected void |
addUniquePaths(java.util.List list,
Url[] urls)
Adds several paths to a list, skipping paths that are already members of the list. |
protected void |
addUniquePathsIfEnabled(java.util.List list,
Url[] urls)
Adds several paths to a list, skipping paths that are already members of the list or are disabled in this SKU |
protected void |
buildFullPaths(java.util.List priorPathSets,
java.util.List classPathList,
java.util.List sourcePathList,
java.util.List docPathList)
Adds missing elements from the local path set to the full path list, then invokes buildFullPaths(List, List, List) on each required path set in turn. |
void |
delete()
Removes this PathSet from disk and from its collection |
Url[] |
getClassPath()
Returns the PathSet's current set of class path entries. |
PathSetCollection |
getCollection()
Returns the PathSet's collection |
Url[] |
getDocPath()
Returns the PathSet's current set of documentation path entries. |
Url[] |
getFullClassPath()
Retreives the combined class path of this path set and all required path sets. |
Url[] |
getFullDocPath()
Retreives the combined doc path of this path set and all required path sets. |
Url[] |
getFullSourcePath()
Retreives the combined source path of this path set and all required path sets. |
long |
getLastModified()
Reports the time that the last change was made directly to this PathSet. |
java.lang.String |
getName()
Returns the current name for a PathSet. |
protected static java.lang.String |
getNames(java.util.ArrayList pathSetList)
|
protected static java.lang.String |
getNames(PathSet[] pathSets)
|
PathSet[] |
getRequired()
Get the required path sets, after resolving the required names. |
java.lang.String[] |
getRequiredNames()
Get the names of required path sets. |
protected PathSetResolver |
getResolver()
Returns the PathSet's resolver |
Url[] |
getSourcePath()
Returns the PathSet's current set of source path entries. |
Url |
getUrl()
Returns the PathSet's storage Url |
boolean |
isEmpty()
Is this PathSet empty? By definition it is empty if all the simple paths are empty. |
boolean |
isEnabled()
Is this PathSet enabled? By definition it is enabled if all the entries on the class path are enabled |
boolean |
isReadOnly()
Tests if this PathSet is read-only. |
static PathSet |
load(Url url,
PathSetCollection collection)
Load a PathSet from disk. |
protected java.lang.String[] |
parseLibraries(java.lang.String required)
|
protected void |
resolveRequired()
|
void |
save()
Saves this PathSet to disk. |
void |
setClassPath(Url[] classPath)
Changes the PathSet's current set of class path entries. |
void |
setCollection(PathSetCollection collection)
Sets the PathSet's collection |
void |
setDocPath(Url[] docPath)
Changes the PathSet's current set of documentation path entries. |
void |
setName(java.lang.String name)
Changes this PathSet's name. |
void |
setRequired(PathSet[] required)
Deprecated. use setRequired(String[] required) instead |
void |
setRequired(java.lang.String required)
Set the required path sets. |
void |
setRequired(java.lang.String[] required)
Set the required path sets. |
void |
setSourcePath(Url[] sourcePath)
Changes the PathSet's current set of source path entries. |
void |
setUrl(Url storagePath)
Sets the PathSet's storage Url |
protected void |
updateFullPaths()
Updates the cached representation of a set of 'full paths' by constructing temporary lists, populating them using buildFullPaths(List, List, List) and then converting them into the requisite cached arrays. |
protected void |
updateLastModified()
Records a new last modified date for this path set and updates the global last updated time so that other path sets can rebuild their "full path" cache. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final PathSet[] EMPTY_ARRAY
protected PathSetCollection collection
protected java.lang.String[] requiredNames
protected long lastModified
protected long lastFullUpdate
protected boolean hasChanged
Constructor Detail |
public PathSet(java.lang.String name)
name
- The initial name for the PathSet. This value may not be null.Method Detail |
public java.lang.String getName()
public void setName(java.lang.String name)
name
- A new name for the PathSet. This value may not be null.protected void updateLastModified()
Records a new last modified date for this path set and updates the global last updated time so that other path sets can rebuild their "full path" cache.
Any method that modifies the state of the PathSet should invoke this method as a side-effect.
public long getLastModified()
public void setUrl(Url storagePath)
storageUrl
- A Url of a library file. This value may not be nullpublic Url getUrl()
public boolean isReadOnly()
public void setCollection(PathSetCollection collection)
collection
- The PathSetCollection that this is part of.public PathSetCollection getCollection()
protected PathSetResolver getResolver()
public Url[] getClassPath()
public Url[] getSourcePath()
public Url[] getDocPath()
public void setClassPath(Url[] classPath)
classPath
- An array of class path entries.public void setSourcePath(Url[] sourcePath)
sourcePath
- An array of source path entries.public void setDocPath(Url[] docPath)
docPath
- An array of documentation path entries.protected void resolveRequired()
public PathSet[] getRequired()
public java.lang.String[] getRequiredNames()
public void setRequired(java.lang.String[] required)
public void setRequired(java.lang.String required)
public void setRequired(PathSet[] required)
public boolean isEmpty()
public boolean isEnabled()
public int addEntries(Url url)
url
- The directory or JAR to scan.protected void updateFullPaths()
protected void buildFullPaths(java.util.List priorPathSets, java.util.List classPathList, java.util.List sourcePathList, java.util.List docPathList)
protected void addUniquePath(java.util.List list, Url url)
protected Url[] addUniquePath(Url[] oldPath, Url url)
protected void addUniquePaths(java.util.List list, Url[] urls)
protected void addUniquePathsIfEnabled(java.util.List list, Url[] urls)
public Url[] getFullClassPath()
public Url[] getFullSourcePath()
public Url[] getFullDocPath()
protected static java.lang.String getNames(PathSet[] pathSets)
protected static java.lang.String getNames(java.util.ArrayList pathSetList)
protected java.lang.String[] parseLibraries(java.lang.String required)
public void save()
public static PathSet load(Url url, PathSetCollection collection)
url
- The storage location of the JDK or library definitioncollection
- The PathSetCollection that the PathSet belongs topublic void delete()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |