Package com.evolveum.midpoint.prism
Interface PrismSerializer<T>
- All Known Implementing Classes:
PrismSerializerImpl
public interface PrismSerializer<T>
Takes care of serializing prism objects and other beans, i.e. converts java form to
lexical representation (XML/JSON/YAML strings, DOM tree) or intermediate one (XNode).
General post-conditions:
1. All type QNames will be resolvable (i.e. they will be part of static schema) - TODO think again about this; think also about allowing 'system-wide' parts of dynamic schema ...
2. If root(..) is configured, it will be set regardless of the object type and content.
3. ... TODO ...
-
Method Summary
Modifier and TypeMethodDescription@NotNull PrismSerializer<T>context(@Nullable 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(PathSet itemsToSkip) These items will be skipped during serialization.@NotNull PrismSerializer<T>options(@Nullable SerializationOptions options) Sets the serialization options (part of the context).@NotNull PrismSerializer<T>Sets the name of the root element.Serializes given prism item.serialize(@NotNull PrismValue value) Serializes given prism value (property, reference, or container).serialize(@NotNull PrismValue value, QName rootName) Serializes given prism value (property, reference, or container).serialize(jakarta.xml.bind.JAXBElement<?> value) serializeAnyData(Object value) serializeAnyData(Object value, QName rootName) serializeObjects(@NotNull List<PrismObject<?>> objects) serializeRealValue(Object value) serializeRealValue(Object value, QName rootName)
-
Method Details
-
root
Sets the name of the root element. Can be done either here or during call to serialize(..) methods.- Parameters:
elementName- Name of the root element- Returns:
- Serializer with the root element name set.
-
definition
Sets the item definition to be used during serialization. (Not much used.)- Parameters:
itemDefinition- Definition to be used.- Returns:
- Serializer with the definition set.
-
context
Sets the context for the serialization operation, containing e.g. serialization options.- Parameters:
context- Context to be set.- Returns:
- Serializer with the context set.
-
options
Sets the serialization options (part of the context).- Parameters:
options- Options to be set.- Returns:
- Serializer with the options set.
-
itemsToSkip
These items will be skipped during serialization. If present, their original presence is indicated by the "incomplete" flag.- Parameters:
itemsToSkip- Paths of items to be skipped.- Returns:
- Serializer with the items to be skipped set.
-
serialize
Serializes given prism item.- Parameters:
item- Item to be serialized.- Returns:
- String/RootXNode representation of the item.
- Throws:
SchemaException
-
serialize
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 (- Parameters:
value- Value to be serialized.- Returns:
- String/RootXNode representation of the value.
- Throws:
SchemaException
-
serialize
Serializes given prism value (property, reference, or container).- Parameters:
value- Value to be serialized.rootName- Name of the root element. (Overrides other means of deriving the name.)- Returns:
- String/RootXNode representation of the value.
- Throws:
SchemaException
-
serialize
- Throws:
SchemaException
-
serializeObjects
- Throws:
SchemaException
-
serialize
- Throws:
SchemaException
-
serializeRealValue
- Throws:
SchemaException
-
serializeRealValue
- Throws:
SchemaException
-
serializeAnyData
- Throws:
SchemaException
-
serializeAnyData
- Throws:
SchemaException
-