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(SerializerTarget<T> target, QName itemName, ItemDefinition itemDefinition, SerializationContext context, PrismContextImpl prismContext, Collection<? extends QName> itemsToSkip)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PrismSerializerImpl<T>context(SerializationContext context)Sets the context for the serialization operation, containing e.g.PrismSerializer<T>definition(ItemDefinition itemDefinition)Sets the item definition to be used during serialization.PrismSerializer<T>itemsToSkip(Collection<? extends QName> itemsToSkip)These items will be skipped during serialization.PrismSerializerImpl<T>options(SerializationOptions options)Sets the serialization options (part of the context).PrismSerializerImpl<T>root(QName elementName)Sets the name of the root element.Tserialize(Item<?,?> item)Serializes given prism item.Tserialize(Item<?,?> item, QName itemName)Tserialize(PrismValue value)Serializes given prism value (property, reference, or container).Tserialize(PrismValue value, QName itemName)Serializes given prism value (property, reference, or container).Tserialize(RootXNode xnode)Tserialize(javax.xml.bind.JAXBElement<?> value)TserializeAnyData(Object value)TserializeAnyData(Object value, QName itemName)TserializeObjects(List<PrismObject<?>> objects, QName aggregateElementName)TserializeRealValue(Object realValue)TserializeRealValue(Object realValue, QName itemName)
-
-
-
Constructor Detail
-
PrismSerializerImpl
public PrismSerializerImpl(@NotNull SerializerTarget<T> target, QName itemName, ItemDefinition itemDefinition, SerializationContext context, @NotNull PrismContextImpl prismContext, Collection<? extends QName> itemsToSkip)
-
-
Method Detail
-
context
@NotNull public PrismSerializerImpl<T> context(SerializationContext context)
Description copied from interface:PrismSerializerSets the context for the serialization operation, containing e.g. serialization options.- Specified by:
contextin interfacePrismSerializer<T>- Parameters:
context- Context to be set.- Returns:
- Serializer with the context set.
-
root
@NotNull public PrismSerializerImpl<T> root(QName elementName)
Description copied from interface:PrismSerializerSets the name of the root element. Can be done either here or during call to serialize(..) methods.- Specified by:
rootin interfacePrismSerializer<T>- Parameters:
elementName- Name of the root element- Returns:
- Serializer with the root element name set.
-
definition
@NotNull public PrismSerializer<T> definition(ItemDefinition itemDefinition)
Description copied from interface:PrismSerializerSets the item definition to be used during serialization. (Not much used.)- Specified by:
definitionin interfacePrismSerializer<T>- Parameters:
itemDefinition- Definition to be used.- Returns:
- Serializer with the definition set.
-
options
@NotNull public PrismSerializerImpl<T> options(SerializationOptions options)
Description copied from interface:PrismSerializerSets the serialization options (part of the context).- Specified by:
optionsin interfacePrismSerializer<T>- Parameters:
options- Options to be set.- Returns:
- Serializer with the options set.
-
itemsToSkip
@NotNull public PrismSerializer<T> itemsToSkip(Collection<? extends QName> itemsToSkip)
Description copied from interface:PrismSerializerThese items will be skipped during serialization.- Specified by:
itemsToSkipin 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 Item<?,?> item) throws SchemaException
Description copied from interface:PrismSerializerSerializes given prism item.- Specified by:
serializein interfacePrismSerializer<T>- Parameters:
item- Item to be serialized.- Returns:
- String/RootXNode representation of the item.
- Throws:
SchemaException
-
serialize
@NotNull public T serialize(@NotNull Item<?,?> item, QName itemName) throws SchemaException
- Throws:
SchemaException
-
serialize
@NotNull public T serialize(@NotNull PrismValue value) throws SchemaException
Description copied from interface:PrismSerializerSerializes 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:
serializein interfacePrismSerializer<T>- Parameters:
value- Value to be serialized.- Returns:
- String/RootXNode representation of the value.
- Throws:
SchemaException
-
serialize
@NotNull public T serialize(@NotNull PrismValue value, QName itemName) throws SchemaException
Description copied from interface:PrismSerializerSerializes given prism value (property, reference, or container).- Specified by:
serializein 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 RootXNode xnode) throws SchemaException
- Specified by:
serializein interfacePrismSerializer<T>- Throws:
SchemaException
-
serializeObjects
@NotNull public T serializeObjects(@NotNull List<PrismObject<?>> objects, @Nullable QName aggregateElementName) throws SchemaException
- Specified by:
serializeObjectsin interfacePrismSerializer<T>- Throws:
SchemaException
-
serializeRealValue
public T serializeRealValue(Object realValue) throws SchemaException
- Specified by:
serializeRealValuein interfacePrismSerializer<T>- Throws:
SchemaException
-
serializeRealValue
public T serializeRealValue(Object realValue, QName itemName) throws SchemaException
- Specified by:
serializeRealValuein interfacePrismSerializer<T>- Throws:
SchemaException
-
serialize
public T serialize(javax.xml.bind.JAXBElement<?> value) throws SchemaException
- Specified by:
serializein interfacePrismSerializer<T>- Throws:
SchemaException
-
serializeAnyData
public T serializeAnyData(Object value) throws SchemaException
- Specified by:
serializeAnyDatain interfacePrismSerializer<T>- Throws:
SchemaException
-
serializeAnyData
public T serializeAnyData(Object value, QName itemName) throws SchemaException
- Specified by:
serializeAnyDatain interfacePrismSerializer<T>- Throws:
SchemaException
-
-