Package org.fastnate.data.xml
Class GenericXmlDataProvider
java.lang.Object
org.fastnate.data.files.GenericDataProvider
org.fastnate.data.xml.GenericXmlDataProvider
- All Implemented Interfaces:
DataProvider
Imports all entities from all XML files in
$dataFolder/entities.
If the XML file has an entity name or is inside a directory with an entity name, and that entity class is annotated
with XmlRootElement, the JaxbImporter is used, otherwise the XmlDataImporter is used.- Author:
- Tobias Liefke
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected Collection<?> importFile(DataFile importFile) Tries to import the given file.protected booleanisImportFile(DataFile file) Indicates that the given file is imported.Methods inherited from class org.fastnate.data.files.GenericDataProvider
buildEntities, findEntityClass, getContext, getEntityRegistration, writeEntitiesMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.fastnate.data.DataProvider
getOrder
-
Constructor Details
-
GenericXmlDataProvider
public GenericXmlDataProvider()
-
-
Method Details
-
importFile
Description copied from class:GenericDataProviderTries to import the given file.- Specified by:
importFilein classGenericDataProvider- Parameters:
importFile- the file that contains the entities- Returns:
- the imported entities or
nullif the file was not imported - Throws:
DataImportException- if the file content was invalidIOException- if the file was not accessible
-
isImportFile
Description copied from class:GenericDataProviderIndicates that the given file is imported. Most implementations will check the suffix of the file.- Specified by:
isImportFilein classGenericDataProvider- Parameters:
file- the file to check- Returns:
trueif that file needs to be imported by this data provider
-