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 for
I18nizable
objects.
Returns the translated message for JSON value.- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class com.fasterxml.jackson.databind.JsonSerializer
JsonSerializer.None
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
Request attribut for localestatic final String
The Avalon RoleFields inherited from class com.fasterxml.jackson.databind.ser.std.StdSerializer
_handledType
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
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 Details
-
REQUEST_ATTR_LOCALE
Request attribut for locale- See Also:
-
ROLE
The Avalon Role
-
-
Constructor Details
-
I18nizableSerializer
public I18nizableSerializer()Constructor
-
-
Method Details
-
service
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
contextualize
- Specified by:
contextualize
in interfaceContextualizable
- Throws:
ContextException
-
enableLogging
- 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
-