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 forI18nizable
objects. 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 static String
REQUEST_ATTR_LOCALE
Request attribut for localestatic String
ROLE
The 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 void
contextualize(Context context)
void
enableLogging(Logger logger)
void
serialize(I18nizable i18nizable, JsonGenerator jgen, SerializerProvider provider)
void
service(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
-
-
-
-
Field Detail
-
REQUEST_ATTR_LOCALE
public static final String REQUEST_ATTR_LOCALE
Request attribut for locale- See Also:
- Constant Field Values
-
-
Constructor Detail
-
I18nizableSerializer
public I18nizableSerializer()
Constructor
-
-
Method Detail
-
service
public void service(ServiceManager manager) throws ServiceException
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
contextualize
public void contextualize(Context context) throws ContextException
- Specified by:
contextualize
in interfaceContextualizable
- Throws:
ContextException
-
enableLogging
public void enableLogging(Logger logger)
- Specified by:
enableLogging
in interfaceLogEnabled
-
serialize
public void serialize(I18nizable i18nizable, JsonGenerator jgen, SerializerProvider provider) throws IOException, JsonGenerationException
- Specified by:
serialize
in classStdSerializer<I18nizable>
- Throws:
IOException
JsonGenerationException
-
-