Package com.e1c.langtool.storage
Interface IFileEditor<T>
- Type Parameters:
T- the type of the file data model
- All Known Subinterfaces:
RegExFile
- All Known Implementing Classes:
AbstractPropertiesFileEditor,AbstractRegExtFileEditor,PropertiesContextFileEditor,PropertiesDictionaryFileEditor,RegExDictionaryFileEditor,YamlRegExFile
public interface IFileEditor<T>
The common interface of file editor handler that responsible for load, save, delete and track changes
of the file model content.
Implementations should use in
file mediator obtain model data.
This interface should not be independently use to edit file.-
Method Summary
Modifier and TypeMethodDescriptionvoiddelete()Delete storage file, associated with this object.getData()Gets file model data.org.eclipse.core.resources.IFilegetFile()Gets the file that was loaded.booleanisDirty()Checks if the file is dirty.booleanisEmpty()Returnstrueif no translations stored in this file.voidload()Load from the resource file.voidMark the file as dirty.byte[]save(com.google.common.hash.HashFunction hashFunction, org.eclipse.core.runtime.IProgressMonitor monitor) Store translations to the file.voidsave(org.eclipse.core.runtime.IProgressMonitor monitor) Store translations to the file.
-
Method Details
-
save
byte[] save(com.google.common.hash.HashFunction hashFunction, org.eclipse.core.runtime.IProgressMonitor monitor) throws IOException Store translations to the file.- Parameters:
monitor- the monitor- Throws:
IOException- Signals that an I/O exception has occurred.
-
save
Store translations to the file.- Parameters:
monitor- the monitor- Throws:
IOException- Signals that an I/O exception has occurred.
-
isEmpty
boolean isEmpty()Returnstrueif no translations stored in this file.- Returns:
trueif no translations stored in this file,falseotherwise.
-
isDirty
boolean isDirty()Checks if the file is dirty.- Returns:
- the boolean
-
markDirty
void markDirty()Mark the file as dirty. -
load
void load()Load from the resource file. -
delete
void delete()Delete storage file, associated with this object. -
getFile
org.eclipse.core.resources.IFile getFile()Gets the file that was loaded.- Returns:
- the file
-
getData
T getData()Gets file model data.- Returns:
- the file model data, cannot return
null.
-