Class CompoundItemDataProvider

  • All Implemented Interfaces:
    ItemDataProvider

    public class CompoundItemDataProvider
    extends java.lang.Object
    implements ItemDataProvider

    Retrieves citation items from a list of other ItemDataProviders.

    Calls each ItemDataProvider in the order they have been added to the list and returns the first citation item retrieved. Returns null if no provider returned a result.

    Does not check for duplicate items or item IDs.

    Since:
    1.1.0
    Author:
    Michel Kraemer
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.Collection<java.lang.String> getIds()  
      CSLItemData retrieveItem​(java.lang.String id)
      Retrieve a citation item with a given ID
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • CompoundItemDataProvider

        public CompoundItemDataProvider​(java.util.List<ItemDataProvider> providers)
        Creates a new compound provider
        Parameters:
        providers - the list of other providers to query for citation items
    • Method Detail

      • retrieveItem

        public CSLItemData retrieveItem​(java.lang.String id)
        Description copied from interface: ItemDataProvider
        Retrieve a citation item with a given ID
        Specified by:
        retrieveItem in interface ItemDataProvider
        Parameters:
        id - the item's unique ID
        Returns:
        the item
      • getIds

        public java.util.Collection<java.lang.String> getIds()
        Specified by:
        getIds in interface ItemDataProvider
        Returns:
        all item IDs this provider can serve