public abstract class GenericDataProvider extends Object implements DataProvider
$dataFolder/entities that match a
specific pattern.
The subclasses define the pattern (and type) of the imported files.| Constructor and Description |
|---|
GenericDataProvider() |
| Modifier and Type | Method and Description |
|---|---|
void |
buildEntities()
Builds the entities that are accessed later using
DataProvider.writeEntities(EntitySqlGenerator). |
protected EntityClass<?> |
findEntityClass(DataFile importFile)
Tries to guess the class of the imported entities from the file or directory name.
|
protected GeneratorContext |
getContext()
The context of the current generator, with the description of the entity classes and settings.
|
protected EntityRegistration |
getEntityRegistration()
Contains all already discovered entities with their unique property.
|
protected abstract Collection<?> |
importFile(DataFile importFile)
Tries to import the given file.
|
protected abstract boolean |
isImportFile(DataFile file)
Indicates that the given file is imported.
|
void |
writeEntities(EntitySqlGenerator sqlGenerator)
Adds all
entities to the SQL file using the given generator. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetOrderpublic void buildEntities()
throws IOException
DataProviderDataProvider.writeEntities(EntitySqlGenerator).buildEntities in interface DataProviderIOException - if something happens during any possible import of the generated entitiesprotected EntityClass<?> findEntityClass(DataFile importFile)
importFile - the file that is importedprotected abstract Collection<?> importFile(DataFile importFile) throws DataImportException, IOException
importFile - the file that contains the entitiesnull if the file was not importedIOException - if the file was not accessibleDataImportException - if the file content was invalidprotected abstract boolean isImportFile(DataFile file)
file - the file to checktrue if that file needs to be imported by this data providerpublic void writeEntities(EntitySqlGenerator sqlGenerator) throws IOException
DataProviderentities to the SQL file using the given generator.writeEntities in interface DataProvidersqlGenerator - the SQL file generatorIOException - if the generator throws one@Generated(value="lombok") protected GeneratorContext getContext()
@Generated(value="lombok") protected EntityRegistration getEntityRegistration()
Copyright © 2020 fastnate.org. All rights reserved.