Class BeanViewConverter<T>
- java.lang.Object
-
- com.oracle.coherence.io.json.genson.Wrapper<Converter<T>>
-
- com.oracle.coherence.io.json.genson.convert.BeanViewConverter<T>
-
- Type Parameters:
T- type of objects this BeanViewConverter can handle.
- All Implemented Interfaces:
Converter<T>,Deserializer<T>,Serializer<T>,AnnotatedElement
public class BeanViewConverter<T> extends Wrapper<Converter<T>> implements Converter<T>
Converter responsible of applying the BeanView mechanism.- Author:
- Eugen Cepoi
- See Also:
BeanViewDescriptorProvider,BeanView
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classBeanViewConverter.BeanViewConverterFactory
-
Constructor Summary
Constructors Constructor Description BeanViewConverter(Type type, BeanViewDescriptorProvider provider, Converter<T> next)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Tdeserialize(ObjectReader reader, Context ctx)protected Class<? extends BeanView<T>>findViewFor(Type type, List<Class<? extends BeanView<?>>> views)voidserialize(T obj, ObjectWriter writer, Context ctx)-
Methods inherited from class com.oracle.coherence.io.json.genson.Wrapper
decorate, getAnnotation, getAnnotations, getDeclaredAnnotations, isAnnotationPresent, isOfType, isWrapped, toAnnotatedElement, unwrap
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.lang.reflect.AnnotatedElement
getAnnotationsByType, getDeclaredAnnotation, getDeclaredAnnotationsByType
-
-
-
-
Constructor Detail
-
BeanViewConverter
public BeanViewConverter(Type type, BeanViewDescriptorProvider provider, Converter<T> next)
-
-
Method Detail
-
findViewFor
protected Class<? extends BeanView<T>> findViewFor(Type type, List<Class<? extends BeanView<?>>> views)
-
serialize
public void serialize(T obj, ObjectWriter writer, Context ctx) throws Exception
- Specified by:
serializein interfaceConverter<T>- Specified by:
serializein interfaceSerializer<T>- Parameters:
obj- we want to serialize. The object is of type T or a subclass (if this serializer has been registered for subclasses).writer- to use to write data to the output stream.ctx- the current context.- Throws:
JsonBindingExceptionJsonStreamExceptionException
-
deserialize
public T deserialize(ObjectReader reader, Context ctx) throws Exception
- Specified by:
deserializein interfaceConverter<T>- Specified by:
deserializein interfaceDeserializer<T>- Parameters:
reader- used to read data from.ctx- the current context.- Returns:
- an instance of T or a subclass of T.
- Throws:
JsonBindingExceptionJsonStreamExceptionException
-
-