|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface FileIOPlugin
Interface for plugins which save/load DESModels or which save/load
meta-data sections in DESModel files.
For meta-data sections, refer to external documentation.
| Method Summary | |
|---|---|
java.lang.String |
getIOTypeDescriptor()
Return the string describing the type of model handled by the plugin. |
java.util.Set<java.lang.String> |
getMetaTags()
Returns the set of meta-data "tags" handled by the plugin. |
java.lang.String |
getSaveDataVersion()
Returns the version of the format in which the model data is saved. |
java.lang.String |
getSaveMetaVersion(java.lang.String tag)
Returns the version of the format in which the meta-data section with the given "tag" is saved. |
DESModel |
loadData(java.lang.String version,
java.io.InputStream stream,
java.lang.String fileName)
Load a DES model from the provided stream. |
void |
loadMeta(java.lang.String version,
java.io.InputStream stream,
DESModel model,
java.lang.String tag)
Loads meta-data for a given DES model from a meta-data section. |
void |
saveData(java.io.PrintStream stream,
DESModel model,
java.lang.String fileName)
Save the description of the DES model into the provided stream. |
void |
saveMeta(java.io.PrintStream stream,
DESModel model,
java.lang.String tag)
Save the meta-data section with the given "tag" for a given DES model. |
| Method Detail |
|---|
java.lang.String getIOTypeDescriptor()
For example, the type of Finite-State Machines is "FSA".
This method is relevant only to data-handling plugins. Meta-data plugins do not need to implement this method.
java.lang.String getSaveDataVersion()
This method is relevant only to plugins which save model data.
java.util.Set<java.lang.String> getMetaTags()
For example, the tag for layout meta-data in FSA files is "layout".
java.lang.String getSaveMetaVersion(java.lang.String tag)
This method is relevant only to plugins which save model meta-data.
tag - the "tag" for which version information is requested
void saveData(java.io.PrintStream stream,
DESModel model,
java.lang.String fileName)
throws FileSaveException
The provided file name can be used if the plugin needs to work with additional files in the directory or needs the name of the save file. The file name is only for information purposes. All data must be written to the provided stream.
stream - stream where to write the data (will be encoded into UTF-8)model - DES model to savefileName - absolute path to the file where the model will be saved
FileSaveException - when there is a problem saving the data
DESModel loadData(java.lang.String version,
java.io.InputStream stream,
java.lang.String fileName)
throws FileLoadException
The provided file name can be used if the plugin needs to work with additional files in the directory or needs the name of the loaded file. The file name is only for information purposes. All data must be read from the provided stream.
version - the version of the format of the model datastream - UTF-8 encoded stream with the model datafileName - absolute path to the file from where the model is loaded
FileLoadException - when there is a problem loading the model
void loadMeta(java.lang.String version,
java.io.InputStream stream,
DESModel model,
java.lang.String tag)
throws FileLoadException
version - the version of the format of the meta-data sectionstream - UTF-8 encoded stream from where meta-data should be readmodel - the DES model for which the meta-data is to be loadedtag - the "tag" of the meta-data section to be loaded
FileLoadException - when there is a problem loading the meta-data
void saveMeta(java.io.PrintStream stream,
DESModel model,
java.lang.String tag)
throws FileSaveException
stream - stream where to write the meta-data (will be encoded into
UTF-8)model - the DES model for which the meta-data is to be savedtag - the "tag" of the meta-data section to be saved
FileSaveException - when there is a problem saving the mata-data
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||