Class AbstractDataHandler<I,O>
java.lang.Object
com.polarion.platform.repository.spi.config.AbstractDataHandler<I,O>
- All Implemented Interfaces:
IDataHandler<I,
O>
- Direct Known Subclasses:
DOMDataHandler
,PropertiesDataHandler
An abstract data handler which works with
IRepositoryService
- Author:
- POLARION SOFTWARE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionreadLocation
(ILocation location, IDataHandlerContext context) Reads the location in the form suitable to be passed toIDataHandler.writeLocation(ILocation, Object, IDataHandlerContext)
readLocations
(List<ILocation> locations, IDataHandlerContext context) Read configuration from given locations Merges the hierarchy of configurations into onevoid
writeLocation
(ILocation location, I data, IDataHandlerContext context) Writes data to given location.
-
Constructor Details
-
AbstractDataHandler
public AbstractDataHandler()
-
-
Method Details
-
readLocations
@Nullable public O readLocations(@NotNull List<ILocation> locations, @NotNull IDataHandlerContext context) Description copied from interface:IDataHandler
Read configuration from given locations Merges the hierarchy of configurations into one- Specified by:
readLocations
in interfaceIDataHandler<I,
O> - Parameters:
locations
- The config hierarchy. The first location is the most concrete, following elements are more and more generic. The caller ensures, that only relevant configurations are passed in.Empty
locations
means, there is no valid file. In such a case eithernull
or default config can be returned.context
- context- Returns:
- merged configuration object
-
readLocation
Description copied from interface:IDataHandler
Reads the location in the form suitable to be passed toIDataHandler.writeLocation(ILocation, Object, IDataHandlerContext)
- Specified by:
readLocation
in interfaceIDataHandler<I,
O> - Parameters:
location
- The location, nevernull
.context
- context- Returns:
- the data read from the specified location
-
writeLocation
public void writeLocation(@NotNull ILocation location, @NotNull I data, @NotNull IDataHandlerContext context) Description copied from interface:IDataHandler
Writes data to given location.- Specified by:
writeLocation
in interfaceIDataHandler<I,
O> - Parameters:
location
- The location, nevernull
.data
- Data as created by the user or byIDataHandler.readLocation(ILocation, IDataHandlerContext)
.context
- context
-