Package org.fastnate.data.properties
Class PropertyDataImporter
java.lang.Object
org.fastnate.data.properties.PropertyDataImporter
- Direct Known Subclasses:
XmlDataImporter
Base class for all importers that work with
PropertyConverters.- Author:
- Tobias Liefke
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<T> voidaddConverter(Class<T> type, PropertyConverter<T> converter) Registers the converter to use for a specific type.protected <T> PropertyConverter<T> findConverter(Class<T> propertyClass) Finds the converter for the given type.
-
Constructor Details
-
PropertyDataImporter
public PropertyDataImporter()
-
-
Method Details
-
addConverter
Registers the converter to use for a specific type. Only nessecary, if the default converters are not enough.- Parameters:
type- the type of the propertyconverter- used to convert that type from a String in the import file to a Java value
-
findConverter
Finds the converter for the given type.- Parameters:
propertyClass- the type of the primitive property to convert- Returns:
- the converter or
nullif none is found
-