Interface FileLocatorAware
-
- All Known Implementing Classes:
PropertiesConfiguration
,XMLConfiguration
,XMLPropertiesConfiguration
,XMLPropertyListConfiguration
public interface FileLocatorAware
Definition of an interface to be implemented by
FileBased
objects which need access to the currentFileLocator
.When loading or saving a
FileBased
object usingFileHandler
the handler eventually invokes theread()
orwrite()
methods passing in a reader or writer. For some implementations this may not be sufficient because they need information about the current location. For instance, a concreteFileBased
implementation may have to resolve other data sources based on relative file names which have to be interpreted in the context of the current file location.To deal with such scenarios, affected implementations can choose to implement this interface. They are then passed the current location to the file being accessed before their
read()
orwrite()
method is called.- Since:
- 2.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
initFileLocator(FileLocator locator)
Passes the currentFileLocator
to this object.
-
-
-
Method Detail
-
initFileLocator
void initFileLocator(FileLocator locator)
Passes the currentFileLocator
to this object. Note that thisFileLocator
object is only temporarily valid for the following invocation ofread()
orwrite(
. Depending on the state of theFileHandler
and which of its methods was called, the object may not be fully initialized. For instance, if theFileHandler
'sload(InputStream)
method was called, no file information is available, and all methods of theFileLocator
will return null.- Parameters:
locator
- the currentFileLocator
-
-