public class ImmutableTypesMapper extends MapperWrapper
Note, that an already persisted stream might still contain references for immutable types. They can be dereferenced at deserialization time, unless the type is explicitly declared as unreferenceable. However, this is only possible at the expense of memory book-keeping all instances.
Mapper.ImplicitCollectionMapping, Mapper.Null
Constructor and Description |
---|
ImmutableTypesMapper(Mapper wrapped) |
Modifier and Type | Method and Description |
---|---|
void |
addImmutableType(java.lang.Class type)
Deprecated.
As of 1.4.9 use
addImmutableType(Class, boolean) |
void |
addImmutableType(java.lang.Class type,
boolean isReferenceable)
Declare a type as immutable.
|
boolean |
isImmutableValueType(java.lang.Class type)
Whether this type is a simple immutable value (int, boolean, String, URL, etc).
|
boolean |
isReferenceable(java.lang.Class type)
Whether this type is referenceable in a stream.
|
aliasForAttribute, aliasForAttribute, aliasForSystemAttribute, attributeForAlias, attributeForAlias, defaultImplementationOf, getConverterFromAttribute, getConverterFromAttribute, getConverterFromAttribute, getConverterFromItemType, getConverterFromItemType, getConverterFromItemType, getFieldNameForItemTypeAndName, getImplicitCollectionDefForFieldName, getItemTypeForItemFieldName, getLocalConverter, isIgnoredElement, lookupMapperOfType, realClass, realMember, serializedClass, serializedMember, shouldSerializeMember
public ImmutableTypesMapper(Mapper wrapped)
public void addImmutableType(java.lang.Class type)
addImmutableType(Class, boolean)
public void addImmutableType(java.lang.Class type, boolean isReferenceable)
type
- the immutable typeisReferenceable
- flag for possible referencespublic boolean isImmutableValueType(java.lang.Class type)
Mapper
isImmutableValueType
in interface Mapper
isImmutableValueType
in class MapperWrapper
public boolean isReferenceable(java.lang.Class type)
Mapper
isReferenceable
in interface Mapper
isReferenceable
in class MapperWrapper
Copyright © 2004–2024 XStream. All rights reserved.