org.apache.cayenne.project
Class DataMapFile

java.lang.Object
  extended by org.apache.cayenne.project.ProjectFile
      extended by org.apache.cayenne.project.DataMapFile

public class DataMapFile
extends ProjectFile

DataMapFile is a ProjectFile abstraction of the DataMap file in a Cayenne project.


Field Summary
static String LOCATION_SUFFIX
           
protected  DataMap map
           
 
Fields inherited from class org.apache.cayenne.project.ProjectFile
location, projectObj, tempFile
 
Constructor Summary
DataMapFile()
           
DataMapFile(Project project, DataMap map)
          Constructor for DataMapFile.
 
Method Summary
 boolean canHandle(Object obj)
          Returns true if this file wrapper can handle a specified object.
 String getLocationSuffix()
          Returns ".map.xml" that should be used as a file suffix for DataMaps.
 Object getObject()
          Returns DataMap associated with this project.
 String getObjectName()
          Returns a name of associated object, that is also used as a file name.
 void save(PrintWriter out)
          Saves an underlying object to the file.
 void willSave()
          Updates map location to match the name before save.
 
Methods inherited from class org.apache.cayenne.project.ProjectFile
canHandleObject, checkWritePermissions, getLocation, getOldLocation, getProject, isRenamed, resolveFile, resolveOldFile, saveCommit, saveTemp, saveUndo, synchronizeLocation, tempFileForFile, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

LOCATION_SUFFIX

public static final String LOCATION_SUFFIX
See Also:
Constant Field Values

map

protected DataMap map
Constructor Detail

DataMapFile

public DataMapFile()

DataMapFile

public DataMapFile(Project project,
                   DataMap map)
Constructor for DataMapFile.

Method Detail

getObject

public Object getObject()
Returns DataMap associated with this project.

Specified by:
getObject in class ProjectFile

getObjectName

public String getObjectName()
Description copied from class: ProjectFile
Returns a name of associated object, that is also used as a file name.

Specified by:
getObjectName in class ProjectFile
See Also:
ProjectFile.getObjectName()

save

public void save(PrintWriter out)
          throws Exception
Description copied from class: ProjectFile
Saves an underlying object to the file. The procedure is dependent on the type of object and is implemented by concrete subclasses.

Specified by:
save in class ProjectFile
Throws:
Exception

canHandle

public boolean canHandle(Object obj)
Description copied from class: ProjectFile
Returns true if this file wrapper can handle a specified object.

Specified by:
canHandle in class ProjectFile
See Also:
ProjectFile.canHandle(Object)

willSave

public void willSave()
Updates map location to match the name before save.

Overrides:
willSave in class ProjectFile

getLocationSuffix

public String getLocationSuffix()
Returns ".map.xml" that should be used as a file suffix for DataMaps.

Overrides:
getLocationSuffix in class ProjectFile


Copyright © 2001-2011 Apache Cayenne. All Rights Reserved.