Class PropertiesTreeAdapter
java.lang.Object
io.micronaut.serde.properties.util.PropertiesTreeAdapter
Builds an intermediate JSON tree from flat Java
.properties keys.
The tree-building algorithm is copied and adapted from Micronaut Core's
JsonBeanPropertyBinder#buildSourceObjectNode(...). Bracketed array
indexes are the default behavior, and dotted one-based array indexes are
supported when configured through SerdePropertiesConfiguration.
- Since:
- 3.1.0
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionPropertiesTreeAdapter(JsonStreamMapper jsonStreamMapper, DeserializationConfiguration deserializationConfiguration, SerdePropertiesConfiguration propertiesConfiguration) Creates a properties tree adapter. -
Method Summary
Modifier and TypeMethodDescriptionio.micronaut.json.tree.JsonNodeparse(InputStream stream) Parses a Java.propertiesstream into a JSON tree.
-
Constructor Details
-
PropertiesTreeAdapter
public PropertiesTreeAdapter(JsonStreamMapper jsonStreamMapper, DeserializationConfiguration deserializationConfiguration, SerdePropertiesConfiguration propertiesConfiguration) Creates a properties tree adapter.- Parameters:
jsonStreamMapper- The JSON mapper used to convert non-string property valuesdeserializationConfiguration- The deserialization configurationpropertiesConfiguration- The properties format configuration
-
-
Method Details
-
parse
Parses a Java.propertiesstream into a JSON tree.- Parameters:
stream- The properties input stream- Returns:
- The parsed JSON tree
- Throws:
IOException- If the properties stream cannot be read
-