public interface FileBased
Definition of an interface to be implemented by objects which know how to read and write themselves from or to a character stream.
This interface is implemented by special implementations of the Configuration
interface which are associated
with a file. It demands only basic methods for doing I/O based on character stream objects. Based on these methods it
is possible to implement other methods which operate on files, file names, URLs, etc.
Note that the methods defined by this interface are not intended to be called directly by client
code! Rather, they are used internally when doing I/O operations with a FileHandler
. A
FileHandler
supports additional functionality (e.g. it evaluates some additional interfaces the
FileBased
object may implement); this functionality is not available on a direct method invocation, so this
may lead to unpredictable results.
Modifier and Type | Method and Description |
---|---|
void |
read(Reader in)
Reads the content of this object from the given reader.
|
void |
write(Writer out)
Writes the content of this object to the given writer.
|
void read(Reader in) throws ConfigurationException, IOException
FileHandler
for reading data.in
- the readerIOException
- if an I/O error occurs.ConfigurationException
- if a non-I/O related problem occurs, e.g. the data read does not have the expected
formatvoid write(Writer out) throws ConfigurationException, IOException
FileHandler
for writing data.out
- the writerIOException
- if an I/O error occurs.ConfigurationException
- if a non-I/O related problem occurs, e.g. the data read does not have the expected
formatCopyright © 2001–2022 The Apache Software Foundation. All rights reserved.