Note: The following guide assumes that you either already
downloaded and installed citeproc-java
or that you built it from source.
In order to use citeproc-java in your application you first have to
create an ItemDataProvider that provides
citation item data to the CSL processor. For example, the following
dummy provider returns always the same data:
Note how the item data is created through a neat builder DSL.
In citeproc-java you can use builders for all model objects.
Of course, in a real implementation you would normally load the
citation item data from a file or a database—e.g. see the predefined
Now you can instantiate the CSL processor.
You have to provide the item data provider and a CSL style (select
one from the 8000+ styles provided by
processor tries to load the style from the classpath, but you may
also pass your own style as a serialized CSL string to the
In order to create a bibliography that contains a set of citation
items, call the registerCitationItems(String...) method to
introduce the item IDs to the processor.
The processor will request the corresponding citation item data
from your ItemDataProvider.
Alternatively, you can call makeCitation(String) to generate
citation strings that you can insert into your document.
The processor saves each ID so you can generate a bibliography
that contains all citations you used in your document.