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 Detail

      • root

        @NotNull
        @NotNull PrismSerializer<T> root​(QName elementName)
        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

        @NotNull
        @NotNull PrismSerializer<T> definition​(ItemDefinition itemDefinition)
        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

        @NotNull
        @NotNull PrismSerializer<T> context​(@Nullable
                                            @Nullable SerializationContext 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

        @NotNull
        @NotNull PrismSerializer<T> options​(@Nullable
                                            @Nullable SerializationOptions options)
        Sets the serialization options (part of the context).
        Parameters:
        options - Options to be set.
        Returns:
        Serializer with the options set.
      • itemsToSkip

        @NotNull
        @NotNull PrismSerializer<T> itemsToSkip​(PathSet 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

        @NotNull
        T serialize​(@NotNull
                    @NotNull Item<?,​?> item)
             throws SchemaException
        Serializes given prism item.
        Parameters:
        item - Item to be serialized.
        Returns:
        String/RootXNode representation of the item.
        Throws:
        SchemaException
      • serialize

        @NotNull
        T serialize​(@NotNull
                    @NotNull PrismValue value)
             throws SchemaException
        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

        @NotNull
        T serialize​(@NotNull
                    @NotNull PrismValue value,
                    QName rootName)
             throws SchemaException
        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