References Deprecated
ContainerSerializer is deprecated or references (maybe indirectly) at least one deprecated element.
See corresponding docs for further information.
Collection
and Map types (unlike in JDK).
| Modifier and Type | Class and Description |
|---|---|
| protected static class |
| Modifier and Type | Field and Description |
|---|---|
| protected final int | _features
Hibernate-module features set, if any. |
| protected final JavaType | _originalType
Type for which underlying serializer was created. |
| protected final JsonSerializer | _serializer
Serializer that does actual value serialization when value is available (either already or with forced access). |
| protected final SessionFactory | |
| private static final long |
| Access | Constructor and Description |
|---|---|
| public | PersistentCollectionSerializer(JavaType containerType, JsonSerializer<?> serializer, int features, SessionFactory sessionFactory)
|
| protected | PersistentCollectionSerializer(PersistentCollectionSerializer base, JsonSerializer<?> serializer)
References Deprecated
PersistentCollectionSerializer is deprecated or references (maybe indirectly) at least one deprecated element.
|
| Modifier and Type | Method and Description |
|---|---|
| protected ContainerSerializer | _containerSerializer()
References Deprecated
ContainerSerializer is deprecated or references (maybe indirectly) at least one deprecated element.
|
| protected PersistentCollectionSerializer | _withSerializer(JsonSerializer<?> ser)
References Deprecated
PersistentCollectionSerializer is deprecated or references (maybe indirectly) at least one deprecated element.
|
| protected ContainerSerializer | _withValueTypeSerializer(TypeSerializer vts)
Implements abstract com.
References Deprecated
ContainerSerializer is deprecated or references (maybe indirectly) at least one deprecated element.
Method that needs to be implemented to allow construction of a new
serializer object with given |
| public void | acceptJsonFormatVisitor(JsonFormatVisitorWrapper visitor, JavaType
Type of element (entity like property) being visited typeHint)Overrides com. Implements com. Default implementation specifies no format. |
| private Object | |
| private Object | |
| private Object | |
| private Object | |
| public JsonSerializer | createContextual(SerializerProvider
Serializer provider to use for accessing config, other serializers provider, BeanProperty Method or field that represents the property
(and is used to access value to serialize).
Should be available; but there may be cases where caller cannot provide it and
null is passed instead (in which case impls usually pass 'this' serializer as is) property)Implements com. We need to resolve actual serializer once we know the context; specifically must know type of property being serialized. |
| protected Object | |
| public JsonSerializer | getContentSerializer()
Implements abstract com. Accessor for serializer used for serializing contents (List and array elements, Map values etc) of the container for which this serializer is used, if it is known statically. |
| public JavaType | getContentType()
Implements abstract com. Accessor for finding declared (static) element type for type this serializer is used for. |
| public boolean | hasSingleElement(Object value)
Implements abstract com. Method called to determine if the given value (of type handled by this serializer) contains exactly one element. |
| private void | |
| public boolean | isEmpty(SerializerProvider provider, Object value)
Overrides com. Method called to check whether given serializable value is considered "empty" value (for purposes of suppressing serialization of empty values). |
| public boolean | isUnwrappingSerializer()
Overrides com. Accessor for checking whether this serializer is an "unwrapping" serializer; this is necessary to know since it may also require caller to suppress writing of the leading property name. |
| private Session | |
| public void | resolve(SerializerProvider
Provider that has constructed serializer this method
is called on. provider)Implements com. Method called after |
| public void | serialize(Object
Value to serialize; can not be null. value, JsonGenerator Generator used to output resulting Json content g, SerializerProvider Provider that can be used to get serializers for
serializing Objects value contains, if any. provider)Implements abstract com. Method that can be called to ask implementation to serialize values of type this serializer handles. |
| public void | serializeWithType(Object
Value to serialize; can not be null. value, JsonGenerator Generator used to output resulting Json content g, SerializerProvider Provider that can be used to get serializers for
serializing Objects value contains, if any. provider, TypeSerializer Type serializer to use for including type information typeSer)Overrides com. Method that can be called to ask implementation to serialize values of type this serializer handles, using specified type serializer for embedding necessary type information. |
| public PersistentCollectionSerializer | unwrappingSerializer(NameTransformer
Name transformation to use to convert between names
of unwrapper properties unwrapper)Overrides com.
References Deprecated
PersistentCollectionSerializer is deprecated or references (maybe indirectly) at least one deprecated element.
Method that will return serializer instance that produces "unwrapped" serialization, if applicable for type being serialized (which is the case for some serializers that produce JSON Objects as output). |
| protected boolean | usesLazyLoading(BeanProperty property)
Method called to see whether given property indicates it uses lazy resolution of reference contained. |
| public boolean | usesObjectId()
Overrides com. Method that can be called to see whether this serializer instance will use Object Id to handle cyclic references. |
| _features | back to summary |
|---|---|
| protected final int _features Hibernate-module features set, if any. | |
| _originalType | back to summary |
|---|---|
| protected final JavaType _originalType Type for which underlying serializer was created. | |
| _serializer | back to summary |
|---|---|
| protected final JsonSerializer<Object> _serializer Serializer that does actual value serialization when value is available (either already or with forced access). | |
| _sessionFactory | back to summary |
|---|---|
| protected final SessionFactory _sessionFactory | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID Hides com. | |
| PersistentCollectionSerializer | back to summary |
|---|---|
public PersistentCollectionSerializer(JavaType containerType, JsonSerializer<?> serializer, int features, SessionFactory sessionFactory)
| |
| PersistentCollectionSerializer | back to summary |
|---|---|
| protected PersistentCollectionSerializer(PersistentCollectionSerializer base, JsonSerializer<?> serializer)
References Deprecated
See corresponding docs for further information.
| |
| _containerSerializer | back to summary |
|---|---|
| protected ContainerSerializer References Deprecated
See corresponding docs for further information. | |
| _withSerializer | back to summary |
|---|---|
| protected PersistentCollectionSerializer _withSerializer(JsonSerializer<?> ser)
References Deprecated
See corresponding docs for further information. | |
| _withValueTypeSerializer | back to summary |
|---|---|
| protected ContainerSerializer Implements abstract com. Doc from com. References Deprecated
See corresponding docs for further information. Method that needs to be implemented to allow construction of a new
serializer object with given
| |
| acceptJsonFormatVisitor | back to summary |
|---|---|
| public void acceptJsonFormatVisitor(JsonFormatVisitorWrapper visitor, JavaType typeHint) throws JsonMappingException Overrides com. Implements com. Doc from com. Default implementation specifies no format. This behavior is usually overriden by custom serializers.
| |
| convertToJavaCollection | back to summary |
|---|---|
| private Object convertToJavaCollection(Object value) | |
| convertToList | back to summary |
|---|---|
| private Object convertToList(List<?> value) | |
| convertToMap | back to summary |
|---|---|
| private Object convertToMap(Map<?, ?> value) | |
| convertToSet | back to summary |
|---|---|
| private Object convertToSet(Set<?> value) | |
| createContextual | back to summary |
|---|---|
| public JsonSerializer Implements com. We need to resolve actual serializer once we know the context; specifically must know type of property being serialized.
| |
| findLazyValue | back to summary |
|---|---|
| protected Object findLazyValue(PersistentCollection<E> coll) | |
| getContentSerializer | back to summary |
|---|---|
| public JsonSerializer Implements abstract com. Doc from com. Accessor for serializer used for serializing contents
(List and array elements, Map values etc) of the
container for which this serializer is used, if it is
known statically.
Note that for dynamic types this may return null; if so,
caller has to instead use
| |
| getContentType | back to summary |
|---|---|
| public JavaType getContentType() Implements abstract com. Doc from com. Accessor for finding declared (static) element type for type this serializer is used for.
| |
| hasSingleElement | back to summary |
|---|---|
| public boolean hasSingleElement(Object value) Implements abstract com. Doc from com. Method called to determine if the given value (of type handled by this serializer) contains exactly one element. Note although it might seem sensible to instead define something like "getElementCount()" method, this would not work well for containers that do not keep track of size (like linked lists may not).
Note, too, that as of now (2.9) this method is only called by serializer
itself; and specifically is not used for non-array/collection types
like
| |
| initializeCollection | back to summary |
|---|---|
| private void initializeCollection(PersistentCollection<E> coll, Session session) | |
| isEmpty | back to summary |
|---|---|
| public boolean isEmpty(SerializerProvider provider, Object value) Overrides com. Doc from com. Method called to check whether given serializable value is considered "empty" value (for purposes of suppressing serialization of empty values). Default implementation will consider only null values to be empty. Note replaces
| |
| isUnwrappingSerializer | back to summary |
|---|---|
| public boolean isUnwrappingSerializer() Overrides com. Doc from com. Accessor for checking whether this serializer is an "unwrapping" serializer; this is necessary to know since it may also require caller to suppress writing of the leading property name.
| |
| openTemporarySessionForLoading | back to summary |
|---|---|
| private Session openTemporarySessionForLoading(PersistentCollection<E> coll) | |
| resolve | back to summary |
|---|---|
| public void resolve(SerializerProvider provider) throws JsonMappingException Implements com. Doc from com. Method called after Note that this method does NOT return serializer, since resolution is not allowed to change actual serializer to use.
| |
| serialize | back to summary |
|---|---|
| public void serialize(Object value, JsonGenerator g, SerializerProvider provider) throws IOException Implements abstract com. Doc from com. Method that can be called to ask implementation to serialize values of type this serializer handles.
| |
| serializeWithType | back to summary |
|---|---|
| public void serializeWithType(Object value, JsonGenerator g, SerializerProvider provider, TypeSerializer typeSer) throws IOException Overrides com. Doc from com. Method that can be called to ask implementation to serialize values of type this serializer handles, using specified type serializer for embedding necessary type information.
Default implementation will throw For simple datatypes written as a single scalar value (JSON String, Number, Boolean), implementation would look like: // note: method to call depends on whether this type is serialized as JSON scalar, object or Array! typeSer.writeTypePrefixForScalar(value, gen); serialize(value, gen, provider); typeSer.writeTypeSuffixForScalar(value, gen);and implementations for type serialized as JSON Arrays or Objects would differ slightly, as START-ARRAY/END-ARRAY and
START-OBJECT/END-OBJECT pairs
need to be properly handled with respect to serializing of contents.
| |
| unwrappingSerializer | back to summary |
|---|---|
| public PersistentCollectionSerializer unwrappingSerializer(NameTransformer unwrapper) Overrides com. Doc from com. References Deprecated
See corresponding docs for further information. Method that will return serializer instance that produces "unwrapped" serialization, if applicable for type being serialized (which is the case for some serializers that produce JSON Objects as output). If no unwrapped serializer can be constructed, will simply return serializer as-is. Default implementation just returns serializer as-is, indicating that no unwrapped variant exists
| |
| usesLazyLoading | back to summary |
|---|---|
| protected boolean usesLazyLoading(BeanProperty property) Method called to see whether given property indicates it uses lazy resolution of reference contained. | |
| usesObjectId | back to summary |
|---|---|
| public boolean usesObjectId() Overrides com. Doc from com. Method that can be called to see whether this serializer instance will use Object Id to handle cyclic references.
| |
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| public static boolean |
| SessionReader | back to summary |
|---|---|
| protected SessionReader() | |
| isJTA | back to summary |
|---|---|
| public static boolean isJTA(Session session) | |