Package org.ametys.core.util
Class I18nizableSerializer
- java.lang.Object
-
- com.fasterxml.jackson.databind.JsonSerializer<T>
-
- com.fasterxml.jackson.databind.ser.std.StdSerializer<I18nizable>
-
- org.ametys.core.util.I18nizableSerializer
-
- All Implemented Interfaces:
JsonFormatVisitable,SchemaAware,Serializable,Component,Contextualizable,LogEnabled,Serviceable
public class I18nizableSerializer extends StdSerializer<I18nizable> implements Component, Serviceable, LogEnabled, Contextualizable
Serializer forI18nizableobjects. Returns the translated message for JSON value.- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.fasterxml.jackson.databind.JsonSerializer
JsonSerializer.None
-
-
Field Summary
Fields Modifier and Type Field Description private Context_contextprivate I18nUtils_i18nUtilsprivate Logger_loggerstatic StringROLEThe Avalon Role-
Fields inherited from class com.fasterxml.jackson.databind.ser.std.StdSerializer
_handledType
-
-
Constructor Summary
Constructors Constructor Description I18nizableSerializer()Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private String_getLangCode()voidcontextualize(Context context)voidenableLogging(Logger logger)voidserialize(I18nizable i18nizable, JsonGenerator jgen, SerializerProvider provider)voidservice(ServiceManager manager)-
Methods inherited from class com.fasterxml.jackson.databind.ser.std.StdSerializer
_neitherNull, _nonEmpty, acceptJsonFormatVisitor, createSchemaNode, createSchemaNode, findAnnotatedContentSerializer, findContextualConvertingSerializer, findConvertingContentSerializer, findFormatFeature, findFormatOverrides, findIncludeOverrides, findPropertyFilter, getSchema, getSchema, handledType, isDefaultSerializer, visitArrayFormat, visitArrayFormat, visitFloatFormat, visitIntFormat, visitIntFormat, visitStringFormat, visitStringFormat, wrapAndThrow, wrapAndThrow
-
Methods inherited from class com.fasterxml.jackson.databind.JsonSerializer
getDelegatee, isEmpty, isEmpty, isUnwrappingSerializer, properties, replaceDelegatee, serializeWithType, unwrappingSerializer, usesObjectId, withFilterId
-
-
-
-
Constructor Detail
-
I18nizableSerializer
public I18nizableSerializer()
Constructor
-
-
Method Detail
-
service
public void service(ServiceManager manager) throws ServiceException
- Specified by:
servicein interfaceServiceable- Throws:
ServiceException
-
contextualize
public void contextualize(Context context) throws ContextException
- Specified by:
contextualizein interfaceContextualizable- Throws:
ContextException
-
enableLogging
public void enableLogging(Logger logger)
- Specified by:
enableLoggingin interfaceLogEnabled
-
serialize
public void serialize(I18nizable i18nizable, JsonGenerator jgen, SerializerProvider provider) throws IOException, JsonGenerationException
- Specified by:
serializein classStdSerializer<I18nizable>- Throws:
IOExceptionJsonGenerationException
-
_getLangCode
private String _getLangCode()
-
-