|
|||||||||
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 java.io.File |
projectFile
The domain file used for this configuration |
Fields inherited from class org.apache.cayenne.conf.Configuration |
---|
ACCEPT_ALL_DATAVIEWS, configurationShutdownHook, dataDomains, dataViewLocations, DEFAULT_CONFIGURATION_CLASS, DEFAULT_DOMAIN_FILE, DEFAULT_LOGGING_PROPS_FILE, domainConfigurationName, eventManager, ignoringLoadFailures, loaderDelegate, loadStatus, overrideFactory, projectVersion, saverDelegate, sharedConfiguration |
Constructor Summary | |
---|---|
FileConfiguration()
Default constructor. |
|
FileConfiguration(java.io.File domainConfigurationFile)
Creates a configuration that uses the provided file as the main project file, ignoring any other lookup strategies. |
|
FileConfiguration(java.lang.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(java.io.File path)
Adds the given directory as a path for filesystem lookups. |
void |
addFilesystemPath(java.lang.String path)
Adds the given String as a custom path for filesystem lookups. |
boolean |
canInitialize()
Only returns true when getProjectFile() does not
return null . |
java.io.File |
getProjectDirectory()
Returns the directory of the current project file as returned by getProjectFile() . |
java.io.File |
getProjectFile()
Returns the main domain file used for this configuration. |
protected void |
setProjectFile(java.io.File projectFile)
Sets the main domain file used for this configuration. |
Methods inherited from class org.apache.cayenne.conf.DefaultConfiguration |
---|
addClassPath, addResourcePath, didInitialize, getDomainConfiguration, getMapConfiguration, getResourceLocator, getViewConfiguration, initialize, setResourceLocator, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected java.io.File projectFile
Constructor Detail |
---|
public FileConfiguration()
FileConfiguration(String)
with Configuration.DEFAULT_DOMAIN_FILE
as argument.
DefaultConfiguration.DefaultConfiguration()
public FileConfiguration(java.lang.String domainConfigurationName)
ConfigurationException
- when projectFile is null
.DefaultConfiguration.DefaultConfiguration(String)
public FileConfiguration(java.io.File domainConfigurationFile)
ConfigurationException
- when projectFile is null
,
a directory or not readable.Method Detail |
---|
public void addFilesystemPath(java.lang.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.
java.lang.IllegalArgumentException
- if path
is null
.public void addFilesystemPath(java.io.File path)
java.lang.IllegalArgumentException
- if path
is null
,
not a directory or not readable.public boolean canInitialize()
true
when getProjectFile()
does not
return null
.
canInitialize
in class DefaultConfiguration
public java.io.File getProjectFile()
protected void setProjectFile(java.io.File projectFile)
ConfigurationException
- if projectFile
is null,
a directory or not readable.public java.io.File getProjectDirectory()
getProjectFile()
.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |