Creating own plugins
Genedator 1.2
Plugin interface
Gendator is application based on generators which are provided in form of dynamically loaded java plugins. If you want to create your own generator your generator class should implement this interface:
Picture 1. Plugin interface
Methods description
Basic method used by Genedator application. It gets number of records which should be generated and should produce array of string with length equals to number of records. This String array should contains generated data. Parameter step means number of iteration which Genedator Engine invokes this method to generating set of data. Parameter totalNumberOfrecords means of course total number of records to generate.
Should give information who is the author of this plugin.
Should give generator name. This name will be displayed in combo box in generators panel.
Should give plugin version.
Should give short description about generator. This info will be displayed in dialog window after clicking on "about" link button.
Gives category of generator. E.g. Textual, Numerical.
Allows to set and get configuration for plugin.
Gives file path (in final jar) where help page (html 3.2) is placed.
This method is used by Genedator application just before starting generating data process. It allows to obtain configuration parameters set by user in user interface.
Allow Genedator application to obtain config panel which will be displayed in Generator Config Panel area.
Those two methods allow to manage resources. Resources may be used by plugin. It can be text files, images etc. IJarResource is map of resources which are connected with given plugin jar. The keys are names of resources and values are bytes representation.
Another way of implementing interface is extending SimplePluginDataGenerator class. Below is description of methods required to implement.
SimplePluginDataGenerator class
Assume you are creating generator named MyGenerator and you extend SimplePluginDataGenerator. In this case methods you have to implement are described below:
Picture 2. MyGenerator class exdending SimplePluginDataGenerator class
You have to implement all of those methods. New methods, that aren't described above are: getUniqueAmount() and getRandomValue().

Gives maximum number of records that can be uniquely generated.
Gives random value from set of generation. Notice that you haven't to implement generate() method. Instead this getRandom() is invoked by generate() method. This method gives single value - instead array of values as in generate() method.
Plugin developing
Assume you want to develop your own plugin called "MyGenerator". As you already know you have to implement interface PluginDataGenerator. But there is a question: how to tie your own generator project with Genedator application. The simplest way to do it is to add to your plugin generator project library with Genedator application packaged to jar archive.

So let's show how to develop your own genrator plugin Netbeans IDE

First of all you have to create Java project. Let's call it simply "MyGenerator". Next thing to do and one of the most important is adding Genedador application jar to plugin project classpath.
Picture 2. Adding Genedator jar to plugin project in Netbeans IDE.
Next step is creating source package. It has to be named "net.sf.genedator.plugin". Different names are forbidden. When you create source package you should create plugin class. The name of this class has to be exactly the same as the name of project (or more strictly - exactly the same as the name of jar which project will be packaged). So in our case name of class should be "MyGenerator".
Picture 3. Package and plugin class in plugin generator project.
Next step is implementing PluginDataGenerator interface by your own plugin class - MyGenerator.
Picture 4. PluginDataGenerator implementation in Netbeans IDE.
Of course instead of implementing PluginDataGenerator interface you can extend SimplePluginDataGenerator class:
Picture 5. Extending SimplePluginDataGenerator class
After implementing methods you can build your project and packege it to jar archive. When it is done you have ready to run plugin generator!
Plugin deploying
To use your plugin you have to deploy it in "plugins" directory, which is located on the same lavel in hierarchy files tree as Genedator application.
Picture 6. Moving MyGenerator plugin jar to plugins directory.
When you deploy your plugin you can launch Genedator application an you see that your plugin is available to choose in Generator Selection Panel.
Picture 7. MyGenerator plugin available in Genedator application.
Now you can use your own plugin.
Important.
If you want to share your generator with other peolple, please inform us. The best way is to use forum topic Plugins.