|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.cayenne.project.Project
public abstract class Project
Describes a model of Cayenne project. Project is a set of files in the filesystem describing storing Cayenne DataMaps, DataNodes and other information.
Project has a project directory, which is a canonical directory. All project files are relative to the project directory.
Field Summary | |
---|---|
static java.lang.String |
CURRENT_PROJECT_VERSION
|
protected java.util.List |
files
|
protected boolean |
modified
|
protected java.io.File |
projectDir
|
protected java.util.List |
upgradeMessages
|
protected int |
upgradeStatus
|
Constructor Summary | |
---|---|
protected |
Project()
|
|
Project(java.io.File projectFile)
Constructor for Project. |
Method Summary | |
---|---|
java.util.List |
buildFileList()
Creates a list of project files. |
abstract void |
checkForUpgrades()
Determines whether the project needs to be upgraded. |
static Project |
createProject(java.io.File projectFile)
Factory method to create the right project type given project file. |
protected boolean |
deleteFile(java.io.File f)
|
ProjectFile |
findFile(java.lang.Object obj)
Looks up and returns a file wrapper for a project object. |
abstract java.util.List |
getChildren()
Returns a list of first-level children of the project. |
abstract ConfigStatus |
getLoadStatus()
|
java.io.File |
getMainFile()
Returns a canonical form of a main file associated with this project. |
java.io.File |
getProjectDirectory()
Returns project directory. |
java.util.List |
getUpgradeMessages()
Returns a list of upgrade messages. |
int |
getUpgradeStatus()
Returns project upgrade status. |
Validator |
getValidator()
Creates an instance of Validator for validating this project. |
boolean |
hasRenamedFiles()
Returns true is project has renamed files. |
protected void |
initialize(java.io.File projectFile)
|
boolean |
isLocationUndefined()
Returns true if project location is not defined. |
boolean |
isModified()
Returns true if the project is modified. |
boolean |
isUpgradeNeeded()
Deprecated. since 2.0 use 'getUpgradeStatus'. |
protected void |
postInitialize(java.io.File projectFile)
Finished project initialization. |
protected void |
prepareSave(java.util.List filesToSave,
java.util.List wrappedObjects)
|
protected void |
processDelete(java.util.List existingObjects,
java.util.List savedFiles)
|
protected void |
processSave(java.util.List modifiedFiles)
Saves a list of modified files to temporary files. |
abstract ProjectFile |
projectFileForObject(java.lang.Object obj)
|
java.io.File |
resolveFile(java.lang.String symbolicName)
Returns a canonical file built from symbolic name. |
java.lang.String |
resolveSymbolicName(java.io.File file)
Returns a "symbolic" name of a file. |
void |
save()
Saves project. |
void |
setModified(boolean modified)
Updates "modified" state of the project. |
void |
setProjectDirectory(java.io.File dir)
|
java.util.Iterator |
treeNodes()
Returns an Iterator over project tree of objects. |
abstract void |
upgrade()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String CURRENT_PROJECT_VERSION
protected java.io.File projectDir
protected java.util.List files
protected int upgradeStatus
protected java.util.List upgradeMessages
protected boolean modified
Constructor Detail |
---|
protected Project()
public Project(java.io.File projectFile)
projectFile
must denote a file (existent or
non-existent) in an existing directory. If projectFile has no parent directory,
current directory is assumed.
Method Detail |
---|
public static Project createProject(java.io.File projectFile)
protected void initialize(java.io.File projectFile)
protected void postInitialize(java.io.File projectFile)
public boolean isLocationUndefined()
public boolean isUpgradeNeeded()
public int getUpgradeStatus()
public java.util.List getUpgradeMessages()
public boolean hasRenamedFiles()
public java.util.List buildFileList()
public Validator getValidator()
public ProjectFile findFile(java.lang.Object obj)
public java.io.File resolveFile(java.lang.String symbolicName)
public java.lang.String resolveSymbolicName(java.io.File file)
public java.io.File getProjectDirectory()
public void setProjectDirectory(java.io.File dir)
public java.io.File getMainFile()
public abstract ConfigStatus getLoadStatus()
public abstract ProjectFile projectFileForObject(java.lang.Object obj)
public abstract java.util.List getChildren()
public abstract void checkForUpgrades()
public java.util.Iterator treeNodes()
public abstract void upgrade() throws ProjectException
ProjectException
public void save() throws ProjectException
ProjectException
protected void prepareSave(java.util.List filesToSave, java.util.List wrappedObjects) throws ProjectException
ProjectException
protected void processSave(java.util.List modifiedFiles) throws ProjectException
ProjectException
protected void processDelete(java.util.List existingObjects, java.util.List savedFiles)
protected boolean deleteFile(java.io.File f)
public boolean isModified()
true
if the project is modified.
public void setModified(boolean modified)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |