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
Constructors -
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 onevoidwriteLocation(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:IDataHandlerRead configuration from given locations Merges the hierarchy of configurations into one- Specified by:
readLocationsin 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
locationsmeans, there is no valid file. In such a case eithernullor default config can be returned.context- context- Returns:
- merged configuration object
-
readLocation
Description copied from interface:IDataHandlerReads the location in the form suitable to be passed toIDataHandler.writeLocation(ILocation, Object, IDataHandlerContext)- Specified by:
readLocationin 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:IDataHandlerWrites data to given location.- Specified by:
writeLocationin interfaceIDataHandler<I,O> - Parameters:
location- The location, nevernull.data- Data as created by the user or byIDataHandler.readLocation(ILocation, IDataHandlerContext).context- context
-