com.docmosis.template.population
Class DataProviderKeyParser
java.lang.Object
com.docmosis.template.population.DataProviderKeyParser
public class DataProviderKeyParser
- extends Object
A utility class to parse keys for data provider elements.
Method Summary |
static com.docmosis.template.population.DataProviderCall |
parse(String key)
Parse a key to fit into a hierarchical structure of a memory data provider. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DataProviderKeyParser
public DataProviderKeyParser()
parse
public static com.docmosis.template.population.DataProviderCall parse(String key)
throws DataProviderKeyException
- Parse a key to fit into a hierarchical structure of a memory data provider.
- Parameters:
key
- the key to parse.
Value types of keys include:
- hotel
- hotel.5
- hotel.floor
- hotel.3.floor
- hotel.floor.2
- hotel.1.floor.3
- hotel.0.floor.4.room.6
Keys may not start with a number. e.g. 0.hotel.2 is not valid.
Keys may not have two consecutive numbers. e.g. hotel.1.2.floor.2 is not valid.
- Returns:
- an object that maps that actual call to the data provider to insert
or retrieve the data.
- Throws:
DataProviderKeyException
- if an invalid key (as per the above examples)
is passed in. It is recommended that if this method is being called in bulk,
that these exceptions be logged as an error or warn, but not be fatal.
Copyright © 2014–2022 Docmosis Pty Ltd. All rights reserved.