* @version $Id: PerspectiveModelSerializer.java,v 1.8 2005-07-06 18:10:48 winnetou25 Exp $
*/
public class PerspectiveModelSerializer implements ISerializer {
public Element serialize(Document document, Object object) {
PerspectiveModel perspectiveModel = (PerspectiveModel) object;
Element perspectiveModelElement = document.createElement(PersistenceConstants.PERSPECTIVE_MODEL_ELEMENT_NAME);
perspectiveModelElement.setAttribute(PersistenceConstants.PERSPECTIVE_MODEL_ATTRIBUTE_CURRENT_PERSPECTIVE_ID, perspectiveModel.getCurrentPerspective());
perspectiveModelElement.setAttribute(PersistenceConstants.PERSPECTIVE_MODEL_ATTRIBUTE_DEFAULT_PERSPECTIVE_ID, perspectiveModel.getDefaultPerspective());
ISerializer perspectiveSerializer = SerializerRegistry.getSerializer(Perspective.class);
Perspective[] perspectives = perspectiveModel.getPerspectives();
for (int i = 0; i < perspectives.length; i++) {
Perspective perspective = perspectives[i];
Element perspectiveElement = perspectiveSerializer.serialize(document, perspective);
perspectiveModelElement.appendChild(perspectiveElement);
}