Class BibliographyGenerator

java.lang.Object
writer2latex.base.BibliographyGenerator

public abstract class BibliographyGenerator extends Object
This class is used to generate bibliographic references and a bibliography. Bibliographies are generated from a list of items (text:bibliograpy-mark), a global configuration (text:bibliography-configuration) and a formatting template (text:bibliography-source)
  • Constructor Details

    • BibliographyGenerator

      protected BibliographyGenerator(OfficeReader ofr, boolean bSkipKey)
      Create a new bibliography generator based on a bibliography configuration and a list of bibliography marks
      Parameters:
      ofr - the office reader used to access the source document
      bSkipKey - set to true if the key should be excluded when applying templates
  • Method Details

    • getLabels

      protected Collection<String> getLabels()
      Get all labels used in the bibliography
      Returns:
      the set of labels
    • isNumberedEntries

      protected boolean isNumberedEntries()
      Check whether entries are numbered rather than labeled with the key
      Returns:
      true if the entries are numbered
    • generateCitation

      public String generateCitation(String sKey)
      Get citation text for a reference to the bibliography
      Parameters:
      sKey - the key of the bibliography item
      Returns:
      the citation text to be shown in the document
    • generateBibliography

      protected void generateBibliography(Element bibSource)
      Generate a bibliography
      Parameters:
      bibSource - a text:bibliography-source element
    • insertBibliographyItem

      protected abstract void insertBibliographyItem(String sStyleName, String sKey)
      Insert a new bibliography item
      Parameters:
      sStyleName - a paragraph style to apply to the item
      sKey - the key of the bibliography item
    • insertBibliographyItemElement

      protected abstract void insertBibliographyItemElement(String sStyleName, String sText)
      Insert an element of a bibliography item
      Parameters:
      sStyleName - a character style to apply to the element
      sText - the element text