/*-
 * Copyright 2016 Diamond Light Source Ltd.
 *
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 */

package org.eclipse.dawnsci.analysis.api.persistence;

/**
 * A marshaller is an extension to the MarshallerService.
 * The marshaller service knows about common dawnsci types
 * but optionally may be extended.
 * 
 * Object class may be null, if it is not serializer class and deserializer class must also be provided.
 * 
 * getMixinAnnotationType() and getMixinAnnotationClass() default to null, they must both return non-null if they
 * are to be provided.
 * 
 * @author Matthew Gerring
 */
public interface IMarshaller {

	/**
	 * The class which we will serialize and deserialise using the serializer class and the deserializer class.
	 * 
	 * @return class to deal with
	 */
	<T> Class<T> getObjectClass();
	
	/**
	 * Class of the serializer which should have a no argument constructor
	 * @return the class
	 */
	<T> Class<T> getSerializerClass();
	
	/**
	 * Class of the deserializer which should have a no argument constructor
	 * 
	 * @return the class
	 */
	<T> Class<T> getDeserializerClass();
	
	/**
	 * The type, if any, of the mixin annotation
	 * This is the left hand side of SimpleModule.setMixInAnnotation(class, class);
	 * 
	 * @return class
	 */
	default <T> Class<T> getMixinAnnotationType() {
		return null;
	}
	
	/**
	 * The type, if any, of the mixin annotation
	 * This is the right hand side of SimpleModule.setMixInAnnotation(class, class);
     *
	 * @return class
	 */
	default <T> Class<T> getMixinAnnotationClass() {
		return null;
	}

}

@@ -975,35 +975,31 @@
  with%0A%09 */%0A%09
-%3CT%3E 
 Class%3C
-T
+?
 %3E getObjectC
@@ -1109,35 +1109,31 @@
 class%0A%09 */%0A%09
-%3CT%3E 
 Class%3C
-T
+?
 %3E getSeriali
@@ -1258,27 +1258,23 @@
 s%0A%09 */%0A%09
-%3CT%3E 
 Class%3C
-T
+?
 %3E getDes
@@ -1457,36 +1457,32 @@
  */%0A%09default
- %3CT%3E
  Class%3C
-T
+?
 %3E getMixinAn
@@ -1693,20 +1693,16 @@
 ault
- %3CT%3E
  Class%3C
-T
+?
 %3E ge

improve generics of IMarshaller so it's easier to implement