Interface LCommandType<P>
- Type Parameters:
P- The type of parameters
- All Known Implementing Classes:
LCommandAbstract, LCommandCaptionDelete, LCommandCaptionsAdd, LCommandCaptionsModify, LCommandCategoriesAdd, LCommandCategoriesSetRequired, LCommandCategoriesUnsetRequired, LCommandCategoryCaptionsAssign, LCommandCategoryCaptionsUnassign, LCommandCategorySelect, LCommandCompact, LCommandExport, LCommandGlobalCaptionModify, LCommandGlobalCaptionOrderLower, LCommandGlobalCaptionOrderUpper, LCommandGlobalCaptionsAdd, LCommandGlobalCaptionsRemove, LCommandImageCaptionsAssign, LCommandImageCaptionsUnassign, LCommandImagesAdd, LCommandImagesDelete, LCommandImageSelect, LCommandImageSourceSet, LCommandLoad, LCommandMetadataPut, LCommandMetadataRemove, LCommandValidate
public interface LCommandType<P>
An internal command.
-
Method Summary
Modifier and TypeMethodDescriptiondescribe()execute(LFileModel model, LDatabaseTransactionType transaction, P parameters) Execute the command.default booleanloading()voidredo(LFileModel model, LDatabaseTransactionType transaction) Redo the command.default booleandefault byte[]Serialize this command as XML properties.voidundo(LFileModel model, LDatabaseTransactionType transaction) Undo the command.
-
Method Details
-
loading
default boolean loading()- Returns:
trueif this command indicates the file model is loading
-
requiresCompaction
default boolean requiresCompaction()- Returns:
trueif the database should be compacted after this command
-
execute
LCommandUndoable execute(LFileModel model, LDatabaseTransactionType transaction, P parameters) throws LException, com.io7m.darco.api.DDatabaseException Execute the command.- Parameters:
model- The modeltransaction- The database transactionparameters- The parameters- Returns:
- A value indicating if the command can be undone
- Throws:
LException- On errorscom.io7m.darco.api.DDatabaseException- On errors
-
undo
void undo(LFileModel model, LDatabaseTransactionType transaction) throws LException, com.io7m.darco.api.DDatabaseException Undo the command.- Parameters:
model- The modeltransaction- The database transaction- Throws:
LException- On errorscom.io7m.darco.api.DDatabaseException- On errors
-
redo
void redo(LFileModel model, LDatabaseTransactionType transaction) throws LException, com.io7m.darco.api.DDatabaseException Redo the command.- Parameters:
model- The modeltransaction- The database transaction- Throws:
LException- On errorscom.io7m.darco.api.DDatabaseException- On errors
-
toProperties
Properties toProperties()- Returns:
- The command as a set of properties
-
describe
String describe()- Returns:
- A humanly-readable description of the operation
-
serialize
default byte[] serialize()Serialize this command as XML properties.- Returns:
- The serialized bytes
-