se.l4.commons.serialization.spi.SerializerResolver Maven / Gradle / Ivy
The newest version!
package se.l4.commons.serialization.spi;
import java.lang.annotation.Annotation;
import java.util.Set;
import se.l4.commons.serialization.Serializer;
import se.l4.commons.serialization.SerializerOrResolver;
/**
* Resolver for a specific {@link Serializer}. This is used to support
* generics and other semi-dynamic features.
*
*
* Resolvers that use extra annotations to determine the serializer to use
* should override {@link #getHints()} to return an array of the annotations
* it uses.
*
* @author Andreas Holstenson
*
* @param
*/
public interface SerializerResolver
extends SerializerOrResolver
{
/**
* Attempt to find a suitable serializer.
*
* @param encounter
* @return
*/
Serializer find(TypeEncounter encounter);
/**
* Get the hints this resolver uses.
*
* @return
*/
Set> getHints();
}