| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.cayenne.conf.Configuration
org.apache.cayenne.conf.DefaultConfiguration
org.apache.cayenne.conf.FileConfiguration
public class FileConfiguration
FileConfiguration loads a Cayenne configuraton file from a given location in the file system.
| Field Summary | |
|---|---|
| protected  File | projectFileThe domain file used for this configuration | 
| Fields inherited from class org.apache.cayenne.conf.DefaultConfiguration | 
|---|
| locator | 
| Fields inherited from class org.apache.cayenne.conf.Configuration | 
|---|
| configurationShutdownHook, dataDomains, dataViewLocations, DEFAULT_CONFIGURATION_CLASS, DEFAULT_DOMAIN_FILE, domainConfigurationName, eventManager, ignoringLoadFailures, loaderDelegate, loadStatus, overrideFactory, overrideStrategy, projectVersion, saverDelegate, sharedConfiguration | 
| Constructor Summary | |
|---|---|
| FileConfiguration()Default constructor. | |
| FileConfiguration(File domainConfigurationFile)Creates a configuration that uses the provided file as the main project file, ignoring any other lookup strategies. | |
| FileConfiguration(String domainConfigurationName)Creates a configuration that uses the provided file name as the main project file, ignoring any other lookup strategies. | |
| Method Summary | |
|---|---|
|  void | addFilesystemPath(File path)Adds the given directory as a path for filesystem lookups. | 
|  void | addFilesystemPath(String path)Adds the given String as a custom path for filesystem lookups. | 
|  boolean | canInitialize()Deprecated. since 3.0 - superclass method is deprecated. | 
|  File | getProjectDirectory()Returns the directory of the current project file as returned by getProjectFile(). | 
|  File | getProjectFile()Returns the main domain file used for this configuration. | 
| protected  void | setProjectFile(File projectFile)Sets the main domain file used for this configuration. | 
| Methods inherited from class org.apache.cayenne.conf.DefaultConfiguration | 
|---|
| addClassPath, addResourcePath, getDomainConfiguration, getResourceFinder, getResourceLocator, initialize, setResourceLocator, toString | 
| Methods inherited from class java.lang.Object | 
|---|
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait | 
| Field Detail | 
|---|
protected File projectFile
| Constructor Detail | 
|---|
public FileConfiguration()
FileConfiguration(String) with
 Configuration.DEFAULT_DOMAIN_FILE as argument.
DefaultConfiguration.DefaultConfiguration()public FileConfiguration(String domainConfigurationName)
ConfigurationException - when projectFile is null.DefaultConfiguration.DefaultConfiguration(String)public FileConfiguration(File domainConfigurationFile)
ConfigurationException - when projectFile is null, a
             directory or not readable.| Method Detail | 
|---|
public void addFilesystemPath(String path)
 conf = new FileConfiguration("myconfig-cayenne.xml");
 conf.addFilesystemPath(new File("a/relative/path"));
 conf.addFilesystemPath(new File("/an/absolute/search/path"));
 Configuration.initializeSharedConfiguration(conf);
 
 
 Alternatively use addFilesystemPath(File) for adding a
 path that is checked for existence.
IllegalArgumentException - if path is null.public void addFilesystemPath(File path)
IllegalArgumentException - if path is null,
             not a directory or not readable.public boolean canInitialize()
true when getProjectFile() does not return
 null.
canInitialize in class Configurationpublic File getProjectFile()
protected void setProjectFile(File projectFile)
ConfigurationException - if projectFile is null, a directory
             or not readable.public File getProjectDirectory()
getProjectFile().
| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||