Class CSLBuilder


  • public class CSLBuilder
    extends java.lang.Object

    Builder for CSL objects.

    Please read the javadoc of the CSL class for more information about its usage.

    Author:
    Michel Kraemer
    • Constructor Detail

      • CSLBuilder

        public CSLBuilder()
    • Method Detail

      • itemDataProvider

        public CSLBuilder itemDataProvider​(ItemDataProvider itemDataProvider)
        Set the item data provider
        Parameters:
        itemDataProvider - an object that provides citation item data
        Returns:
        this builder
      • localeProvider

        public CSLBuilder localeProvider​(LocaleProvider localeProvider)
        Set an optional locale provider
        Parameters:
        localeProvider - an object that provides CSL locales
        Returns:
        this builder
      • abbreviationProvider

        public CSLBuilder abbreviationProvider​(AbbreviationProvider abbreviationProvider)
        Set an optional abbreviation provider
        Parameters:
        abbreviationProvider - an object that provides abbreviations
        Returns:
        this builder
      • style

        public CSLBuilder style​(java.lang.String style)
        Set the citation style to use. This may either be a serialized XML representation of the style or a style's name such as ieee. In the latter case, the processor loads the style from the classpath (e.g. /ieee.csl).
        Parameters:
        style - the style
        Returns:
        this builder
      • lang

        public CSLBuilder lang​(java.lang.String lang)
        Set an RFC 4646 identifier for the citation locale (e.g. en-US)
        Parameters:
        lang - the language identifier
        Returns:
        this builder
      • build

        public CSL build()
                  throws java.io.IOException
        Creates the CSL object with the configured parameters
        Returns:
        the CSL object
        Throws:
        java.io.IOException - if the CSL style could not be loaded