Class DOMElementItem

java.lang.Object
net.shibboleth.metadata.AbstractItem<Element>
net.shibboleth.metadata.dom.DOMElementItem
All Implemented Interfaces:
Item<Element>

@NotThreadSafe public class DOMElementItem extends AbstractItem<Element>
A Item whose data is a DOM, version 3, Element. The Element wrapped by this Item is always the document element of the document that owns the Element.
  • Constructor Details

    • DOMElementItem

      public DOMElementItem(@Nonnull Document document)
      Constructor.

      The document element of the given document becomes the Element value for this item.

      Parameters:
      document - document whose document element becomes the value for this Item; may not be null and must have a document element
    • DOMElementItem

      public DOMElementItem(@Nonnull Element element)
      Constructor.

      A new Document is created and the given Element is deep-imported in to the new document via Document.importNode(org.w3c.dom.Node, boolean). The resulting Element is set as the new document's root.

      Parameters:
      element - element that is copied to become the value of this Item
  • Method Details

    • processDocument

      @Nonnull private static Element processDocument(@Nonnull Document document)
      Process a Document for wrapping by an Item.

      The Item simply wraps the Document's document element.

      Parameters:
      document - Document to wrap
      Returns:
      processed element
    • processElement

      @Nonnull private static Element processElement(@Nonnull Element element)
      Process an Element for wrapping by an Item.

      A new Document is created and the given Element is deep-imported in to the new document via Document.importNode(org.w3c.dom.Node, boolean). The resulting Element is set as the new document's root.

      Parameters:
      element - Element to process
      Returns:
      processed element
    • copy

      @Nonnull public Item<Element> copy()
      Description copied from interface: Item
      Performs a copy of this Item. All member fields, except ItemMetadata, should be deep cloned. ItemMetadata objects must be shared between the clone and the original.
      Returns:
      the clone of this Item