|
||||||||||
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 String |
CURRENT_PROJECT_VERSION
|
protected List<ProjectFile> |
files
|
protected boolean |
modified
|
protected File |
projectDir
|
protected List<String> |
upgradeMessages
|
protected int |
upgradeStatus
|
Constructor Summary | |
---|---|
protected |
Project()
|
|
Project(File projectFile)
Constructor for Project. |
Method Summary | |
---|---|
List<ProjectFile> |
buildFileList()
Creates a list of project files. |
abstract void |
checkForUpgrades()
Determines whether the project needs to be upgraded. |
static Project |
createProject(File projectFile)
Factory method to create the right project type given project file. |
protected boolean |
deleteFile(File f)
|
ProjectFile |
findFile(Object obj)
Looks up and returns a file wrapper for a project object. |
abstract List |
getChildren()
Returns a list of first-level children of the project. |
abstract ConfigStatus |
getLoadStatus()
|
File |
getMainFile()
Returns a canonical form of a main file associated with this project. |
File |
getProjectDirectory()
Returns project directory. |
List<String> |
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(File projectFile)
|
boolean |
isLocationUndefined()
Returns true if project location is not defined. |
boolean |
isModified()
Returns true if the project is modified. |
protected void |
postInitialize(File projectFile)
Finished project initialization. |
protected void |
prepareSave(List<ProjectFile> filesToSave,
List<Object> wrappedObjects)
|
protected void |
processDelete(List<Object> existingObjects,
List<File> savedFiles)
|
protected void |
processSave(List<ProjectFile> modifiedFiles)
Saves a list of modified files to temporary files. |
abstract ProjectFile |
projectFileForObject(Object obj)
|
File |
resolveFile(String symbolicName)
Returns a canonical file built from symbolic name. |
String |
resolveSymbolicName(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(File dir)
|
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 String CURRENT_PROJECT_VERSION
protected File projectDir
protected List<ProjectFile> files
protected int upgradeStatus
protected List<String> upgradeMessages
protected boolean modified
Constructor Detail |
---|
protected Project()
public Project(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(File projectFile)
protected void initialize(File projectFile)
protected void postInitialize(File projectFile)
public boolean isLocationUndefined()
public int getUpgradeStatus()
public List<String> getUpgradeMessages()
public boolean hasRenamedFiles()
public List<ProjectFile> buildFileList()
public Validator getValidator()
public ProjectFile findFile(Object obj)
public File resolveFile(String symbolicName)
public String resolveSymbolicName(File file)
public File getProjectDirectory()
public void setProjectDirectory(File dir)
public File getMainFile()
public abstract ConfigStatus getLoadStatus()
public abstract ProjectFile projectFileForObject(Object obj)
public abstract List getChildren()
public abstract void checkForUpgrades()
public Iterator treeNodes()
public abstract void upgrade() throws ProjectException
ProjectException
public void save() throws ProjectException
ProjectException
protected void prepareSave(List<ProjectFile> filesToSave, List<Object> wrappedObjects) throws ProjectException
ProjectException
protected void processSave(List<ProjectFile> modifiedFiles) throws ProjectException
ProjectException
protected void processDelete(List<Object> existingObjects, List<File> savedFiles)
protected boolean deleteFile(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 |