Package net.shibboleth.metadata.dom
Class DOMElementSerializer
java.lang.Object
net.shibboleth.metadata.dom.DOMElementSerializer
- All Implemented Interfaces:
ItemCollectionSerializer<Element>,ItemSerializer<Element>
@ThreadSafe
public class DOMElementSerializer
extends Object
implements ItemSerializer<Element>, ItemCollectionSerializer<Element>
Very simple
ItemSerializer that serializes the document element of the given
Element-based Item.
When used as an ItemCollectionSerializer, just serializes the first Item in the collection.
This will result in well-formed XML, but any other items in the collection will simply be ignored.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidserialize(Item<Element> item, OutputStream output) Serializes theItemto the given output stream.voidserializeCollection(Collection<Item<Element>> items, OutputStream output) Serializes the collection ofItems to the given output stream.
-
Field Details
-
LOG
@Nonnull private static final org.slf4j.Logger LOGClass logger.
-
-
Constructor Details
-
DOMElementSerializer
public DOMElementSerializer()
-
-
Method Details
-
serialize
Description copied from interface:ItemSerializerSerializes theItemto the given output stream.- Specified by:
serializein interfaceItemSerializer<Element>- Parameters:
item-Itemto be serializedoutput- output stream to which the serializedItemwill be written- Throws:
IOException- if an I/O exception occurs during serialization
-
serializeCollection
public void serializeCollection(@Nonnull @NonnullElements Collection<Item<Element>> items, @Nonnull OutputStream output) throws IOException Description copied from interface:ItemCollectionSerializerSerializes the collection ofItems to the given output stream.- Specified by:
serializeCollectionin interfaceItemCollectionSerializer<Element>- Parameters:
items-CollectionofItems to be serializedoutput- output stream to which the serialized form of theItemcollection will be written- Throws:
IOException- if an I/O exception occurs during serialization
-