Interface Item

    • Method Detail

      • getParent

        Optional<String> getParent()
        Get id of parent
        Returns:
        id if exists
      • hasParent

        default boolean hasParent()
        Does this item have a parent?
        Returns:
        true if has a parent.
      • getContent

        Optional<Content<?>> getContent​(String id)
        The content object for the specified id
        Parameters:
        id - the content id
        Returns:
        the content if it exists
      • getContents

        Stream<Content<?>> getContents()
        All content objects contained within this item
        Returns:
        all content
      • filter

        default Stream<Content<?>> filter​(Filter<Content<?>> filter)
        Filter content to match the test.
        Specified by:
        filter in interface WithFilter<Content<?>>
        Parameters:
        filter - the test to filter with
        Returns:
        stream of matching annotations
      • getContents

        default <T extends Content<?>> Stream<T> getContents​(Class<T> clazz)
        All content objects of the specified class contained within this item
        Type Parameters:
        T - the content class
        Parameters:
        clazz - the content class to filter against
        Returns:
        content
      • createContent

        <C extends Content<D>,​D> Content.Builder<C,​D> createContent​(Class<C> clazz)
        Create a new content builder to generate content.
        Type Parameters:
        C - the content class
        D - the data class
        Parameters:
        clazz - the top level content type required
        Returns:
        content builder
        Throws:
        UnsupportedContentException - if the clazz can't be created
      • removeContent

        void removeContent​(String id)
        Remove the specified content object from this item
        Parameters:
        id - the content id
      • removeContent

        default void removeContent​(Content<?> content)
        Remove the specified content object from this item
        Parameters:
        content - the content
      • discard

        void discard()
        Stop processing this item any further.

        Note that it is up to the underlying implementation as to whether they delete existing output from this item or not.

      • isDiscarded

        boolean isDiscarded()
        If this item is to be discarded at the end of current processing
        Returns:
        true if discarded
      • createChild

        Item createChild()
        Create a child item of this item, which will be processed independently
        Returns:
        new item, with this item as its parent