
com.day.cq.workflow.serialization.SerializationService Maven / Gradle / Ivy
/*
* Copyright 1997-2008 Day Management AG
* Barfuesserplatz 6, 4001 Basel, Switzerland
* All Rights Reserved.
*
* This software is the confidential and proprietary information of
* Day Management AG, ("Confidential Information"). You shall not
* disclose such Confidential Information and shall use it only in
* accordance with the terms of the license agreement you entered into
* with Day.
*/
package com.day.cq.workflow.serialization;
import com.day.cq.workflow.model.WorkflowModel;
import com.day.cq.workflow.model.WorkflowModelSerializer;
/**
* The SerializationService
manages access to
* {@link WorkflowModelSerializer}
services.
*/
public interface SerializationService {
/**
* Returns the mime type associated with a given type.
*
* @param type
* The type of the serialization format.
*
* @return The mime type associated with the given type or NULL if no
* serializer with the given type exists.
*/
String getMimeType(String type);
/**
* Serializes the given {@link WorkflowModel}
into a textual
* representation.
*
* @param model
* The {@link WorkflowModel}
to be serialized.
* @param type The type of the serialization format.
*
* @return A serialized (textual) representation of the
* {@link WorkflowModel}
or NULL if no serializer
* with the given type was found.
*/
String serialize(WorkflowModel model, String type) throws Exception;
/**
* Deserializes a {@link WorkflowModel}
instance from the
* given (textual) model definition.
*
* @param modelDefinition The model definition as string.
* @param type The type of the serialization format.
*
* @return The deserialized {@link WorkflowModel}
or NULL if
* no serializer with the given type was found.
*/
WorkflowModel deserialize(String modelDefinition, String type)
throws Exception;
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy