DataPathModule

The DataPathModule handles creation and resolving of data paths.

DataHolder

A DataHolder is an object that ‘holds data’. This data can be queried by providing a key. This key must be constructible from a String value. See the DataHolder class for more information.

Types of DataHolders

DataHolders are any implementations of the DataHolder interface. Known implementations are: Registry, Storage and PropertyHolder. Custom implementations can be made and are automatically recognized. The AbstractDataHolder class can help with implementation.

Lists and Maps are also recognized as DataHolders when resolving a DataPath. In the case of lists the key must be convertible to an Integer. The list will then be queried for their value at the given index. Maps are queried for the given key. If the map key type is known inside the associated ConversionModule, the key is converted first.

DataPaths

A DataPath is a chain of objects made up of DataHolders, where the last object of the path can be a value of any type.

Serialization

DataPaths can be serialized into a dot-notated string of keys. For example: ‘key1.key2.key3.key4.key5’. If the DataPathModule is then presented with the root DataHolder of this path the root will be asked to give us the DataHolder value at ‘key1’. If it exists, this value is then asked to give us the DataHolder value at ‘key2’. This process is repeated until we ask for the value at ‘key5’. Key1-key4 all must return a DataHolder, key5 can return any type of value because it is at the end of the path.

DataPathRoot

It is also possible for an application to define a global DataPathRoot. This is helpful when serializing and deserializing because it avoids having to specify the root of the path all the time. In dot-notation this DataPathRoot is notated as an empty key, making it so that the key chain starts with a dot. For example: ‘.key1.key2.key3.key4.key5’. This will tell the DataPathModule that the path starts at the global root. An example of a DataPathRoot is the RootRegistry in the RegistryModule.