Class PropertyDataImporter

java.lang.Object
org.fastnate.data.properties.PropertyDataImporter
Direct Known Subclasses:
XmlDataImporter

public abstract class PropertyDataImporter extends Object
Base class for all importers that work with PropertyConverters.
Author:
Tobias Liefke
  • Constructor Details

    • PropertyDataImporter

      public PropertyDataImporter()
  • Method Details

    • addConverter

      public <T> void addConverter(Class<T> type, PropertyConverter<T> converter)
      Registers the converter to use for a specific type. Only nessecary, if the default converters are not enough.
      Parameters:
      type - the type of the property
      converter - used to convert that type from a String in the import file to a Java value
    • findConverter

      protected <T> PropertyConverter<T> findConverter(Class<T> propertyClass)
      Finds the converter for the given type.
      Parameters:
      propertyClass - the type of the primitive property to convert
      Returns:
      the converter or null if none is found