T - the target type to be produced by this Mapperpublic class PropertiesToObjectMapper<T> extends Object implements Mapper<T>
Mapper that loads the contents of a Source (e.g.: file,
URL) in the Properties format (a sequence of key-value pairs) and converts it
into a POJO (Plain-Old Java Object).
Every property will be assigned to a field in the target object in either of the following cases:
@Property annotation, defining a
custom key to be mappedNotes:
private (recommended)transient are ignorednull for object types, zero for numeric types,
and false for booleans.Property| Constructor and Description |
|---|
PropertiesToObjectMapper(Class<T> targetType)
Builds a new Properties Mapper with the specified target type.
|
| Modifier and Type | Method and Description |
|---|---|
T |
apply(InputStream inputStream)
Applies this
Mapper into the given input. |
ConfigurationHelper<T> |
configurationHelper(T type)
Creates a new
ConfigurationHelper instance recommended by this Mapper. |
public T apply(InputStream inputStream) throws IOException
MapperMapper into the given input.
Note: The input stream must be closed by the caller after the mapping operation.
apply in interface Mapper<T>inputStream - the input stream to be mappedIOException - if a low-level I/O problem (such and unexpected end-of-input, or
network error) occurspublic ConfigurationHelper<T> configurationHelper(T type)
MapperConfigurationHelper instance recommended by this Mapper.configurationHelper in interface Mapper<T>type - the configuration object to be used by the helperConfigurationHelper instanceCopyright © 2023. All rights reserved.