Class PrismSerializerImpl<T>
- java.lang.Object
-
- com.evolveum.midpoint.prism.impl.marshaller.PrismSerializerImpl<T>
-
- All Implemented Interfaces:
PrismSerializer<T>
public class PrismSerializerImpl<T> extends Object implements PrismSerializer<T>
- Author:
- mederly
-
-
Constructor Summary
Constructors Constructor Description PrismSerializerImpl(@NotNull SerializerTarget<T> target, QName itemName, ItemDefinition itemDefinition, SerializationContext context, @NotNull PrismContextImpl prismContext, Collection<? extends QName> itemsToSkip)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description @NotNull PrismSerializerImpl<T>
context(SerializationContext context)
Sets the context for the serialization operation, containing e.g.@NotNull PrismSerializer<T>
definition(ItemDefinition itemDefinition)
Sets the item definition to be used during serialization.@NotNull PrismSerializer<T>
itemsToSkip(Collection<? extends QName> itemsToSkip)
These items will be skipped during serialization.@NotNull PrismSerializerImpl<T>
options(SerializationOptions options)
Sets the serialization options (part of the context).@NotNull PrismSerializerImpl<T>
root(QName elementName)
Sets the name of the root element.T
serialize(@NotNull Item<?,?> item)
Serializes given prism item.T
serialize(@NotNull Item<?,?> item, QName itemName)
T
serialize(@NotNull PrismValue value)
Serializes given prism value (property, reference, or container).T
serialize(@NotNull PrismValue value, QName itemName)
Serializes given prism value (property, reference, or container).T
serialize(@NotNull RootXNode xnode)
T
serialize(javax.xml.bind.JAXBElement<?> value)
T
serializeAnyData(Object value)
T
serializeAnyData(Object value, QName itemName)
T
serializeObjects(@NotNull List<PrismObject<?>> objects)
T
serializeRealValue(Object realValue)
T
serializeRealValue(Object realValue, QName itemName)
-
-
-
Constructor Detail
-
PrismSerializerImpl
public PrismSerializerImpl(@NotNull @NotNull SerializerTarget<T> target, QName itemName, ItemDefinition itemDefinition, SerializationContext context, @NotNull @NotNull PrismContextImpl prismContext, Collection<? extends QName> itemsToSkip)
-
-
Method Detail
-
context
@NotNull public @NotNull PrismSerializerImpl<T> context(SerializationContext context)
Description copied from interface:PrismSerializer
Sets the context for the serialization operation, containing e.g. serialization options.- Specified by:
context
in interfacePrismSerializer<T>
- Parameters:
context
- Context to be set.- Returns:
- Serializer with the context set.
-
root
@NotNull public @NotNull PrismSerializerImpl<T> root(QName elementName)
Description copied from interface:PrismSerializer
Sets the name of the root element. Can be done either here or during call to serialize(..) methods.- Specified by:
root
in interfacePrismSerializer<T>
- Parameters:
elementName
- Name of the root element- Returns:
- Serializer with the root element name set.
-
definition
@NotNull public @NotNull PrismSerializer<T> definition(ItemDefinition itemDefinition)
Description copied from interface:PrismSerializer
Sets the item definition to be used during serialization. (Not much used.)- Specified by:
definition
in interfacePrismSerializer<T>
- Parameters:
itemDefinition
- Definition to be used.- Returns:
- Serializer with the definition set.
-
options
@NotNull public @NotNull PrismSerializerImpl<T> options(SerializationOptions options)
Description copied from interface:PrismSerializer
Sets the serialization options (part of the context).- Specified by:
options
in interfacePrismSerializer<T>
- Parameters:
options
- Options to be set.- Returns:
- Serializer with the options set.
-
itemsToSkip
@NotNull public @NotNull PrismSerializer<T> itemsToSkip(Collection<? extends QName> itemsToSkip)
Description copied from interface:PrismSerializer
These items will be skipped during serialization. If present, their original presence is indicated by the "incomplete" flag.- Specified by:
itemsToSkip
in interfacePrismSerializer<T>
- Parameters:
itemsToSkip
- Names of items to be skipped.- Returns:
- Serializer with the items to be skipped set.
-
serialize
@NotNull public T serialize(@NotNull @NotNull Item<?,?> item) throws SchemaException
Description copied from interface:PrismSerializer
Serializes given prism item.- Specified by:
serialize
in interfacePrismSerializer<T>
- Parameters:
item
- Item to be serialized.- Returns:
- String/RootXNode representation of the item.
- Throws:
SchemaException
-
serialize
@NotNull public T serialize(@NotNull @NotNull Item<?,?> item, QName itemName) throws SchemaException
- Throws:
SchemaException
-
serialize
@NotNull public T serialize(@NotNull @NotNull PrismValue value) throws SchemaException
Description copied from interface:PrismSerializer
Serializes given prism value (property, reference, or container). Name of the root element is derived in the following way: 1. if explicit name is set (- Specified by:
serialize
in interfacePrismSerializer<T>
- Parameters:
value
- Value to be serialized.- Returns:
- String/RootXNode representation of the value.
- Throws:
SchemaException
-
serialize
@NotNull public T serialize(@NotNull @NotNull PrismValue value, QName itemName) throws SchemaException
Description copied from interface:PrismSerializer
Serializes given prism value (property, reference, or container).- Specified by:
serialize
in interfacePrismSerializer<T>
- Parameters:
value
- Value to be serialized.itemName
- Name of the root element. (Overrides other means of deriving the name.)- Returns:
- String/RootXNode representation of the value.
- Throws:
SchemaException
-
serialize
@NotNull public T serialize(@NotNull @NotNull RootXNode xnode) throws SchemaException
- Specified by:
serialize
in interfacePrismSerializer<T>
- Throws:
SchemaException
-
serializeObjects
@NotNull public T serializeObjects(@NotNull @NotNull List<PrismObject<?>> objects) throws SchemaException
- Specified by:
serializeObjects
in interfacePrismSerializer<T>
- Throws:
SchemaException
-
serializeRealValue
public T serializeRealValue(Object realValue) throws SchemaException
- Specified by:
serializeRealValue
in interfacePrismSerializer<T>
- Throws:
SchemaException
-
serializeRealValue
public T serializeRealValue(Object realValue, QName itemName) throws SchemaException
- Specified by:
serializeRealValue
in interfacePrismSerializer<T>
- Throws:
SchemaException
-
serialize
public T serialize(javax.xml.bind.JAXBElement<?> value) throws SchemaException
- Specified by:
serialize
in interfacePrismSerializer<T>
- Throws:
SchemaException
-
serializeAnyData
public T serializeAnyData(Object value) throws SchemaException
- Specified by:
serializeAnyData
in interfacePrismSerializer<T>
- Throws:
SchemaException
-
serializeAnyData
public T serializeAnyData(Object value, QName itemName) throws SchemaException
- Specified by:
serializeAnyData
in interfacePrismSerializer<T>
- Throws:
SchemaException
-
-