Package mocka.generator
Class FileSourceCreator
java.lang.Object
mocka.generator.FileSourceCreator
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<T> TcreateFromFileSource(Class<T> clazz, FileSource fileSource) Creates an instance of the given class by analyzing theFileSourceannotation.
-
Constructor Details
-
FileSourceCreator
public FileSourceCreator()
-
-
Method Details
-
createFromFileSource
Creates an instance of the given class by analyzing theFileSourceannotation.This method reads the data file specified in the
FileSourceannotation and maps its contents to a new instance of the specified entity class. It is primarily used to generate entities pre-populated with data from an external file source.- Type Parameters:
T- the type of entity to return- Parameters:
clazz- the class type of the entity to createfileSource- theFileSourceannotation containing file path and metadata- Returns:
- a new instance of
clazzpopulated with data from the file
-