com.javadocking.model.codec
Interface DockModelEncoder

All Known Implementing Classes:
DockModelPropertiesEncoder

public interface DockModelEncoder

This is an interface for a class that encodes a DockModel to a destination. It can also encode a DockingPathModel.

Information on using dock model encoders is in How to Use Dock Model Encoders and Decoders in The Sanaware Developer Guide.

Author:
Heidi Rakels.

Method Summary
 boolean canExport(DockModel dockModel, java.lang.String destinationName)
          Checks whether this encoder can export the given dock model to a new specified location.
 boolean canSave(DockModel dockModel)
          Checks whether this encoder can save the given dock model in the location, where it originally came from.
 void export(DockModel dockModel, java.lang.String destinationName)
          Exports the dock model to the specified location.
 void save(DockModel dockModel)
          Saves the dock model in the location, where it originally came from.
 

Method Detail

canExport

boolean canExport(DockModel dockModel,
                  java.lang.String destinationName)
Checks whether this encoder can export the given dock model to a new specified location.

Parameters:
dockModel - The dock model that has to be exported.
destinationName - The name of the location where the dock model should be saved.
Returns:
True if this encoder can save the given dock model at the specified location, false otherwise.

canSave

boolean canSave(DockModel dockModel)
Checks whether this encoder can save the given dock model in the location, where it originally came from.

Parameters:
dockModel - The dock model that has to be saved.
Returns:
True if this encoder can save the given dock model in the location, where it originally came from, false otherwise.

export

void export(DockModel dockModel,
            java.lang.String destinationName)
            throws java.io.IOException,
                   java.lang.IllegalArgumentException
Exports the dock model to the specified location.

Parameters:
dockModel - The dock model that has to be exported.
destinationName - The name of the location, where the dock model should be saved.
Throws:
java.lang.IllegalArgumentException - If the dock model can not be exported to the new location by this encoder.
java.io.IOException - If an error occurs while exporting the data.

save

void save(DockModel dockModel)
          throws java.io.IOException,
                 java.lang.IllegalArgumentException
Saves the dock model in the location, where it originally came from.

Parameters:
dockModel - The dock model model that has to be saved.
Throws:
java.lang.IllegalArgumentException - If the dock model can not be saved by this encoder.
java.io.IOException - If an error occurs while saving the data.