public class OOBibStyle
extends java.lang.Object
implements java.lang.Comparable
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
UNDEFINED_CITATION_MARKER |
Constructor and Description |
---|
OOBibStyle(java.io.File styleFile) |
OOBibStyle(java.io.Reader in) |
Modifier and Type | Method and Description |
---|---|
int |
compareTo(java.lang.Object o) |
void |
ensureUpToDate()
If this style was initialized from a file on disk, reload the style
if the file has been modified since it was read.
|
boolean |
equals(java.lang.Object o) |
java.lang.String |
getAuthorLastName(AuthorList al,
int number)
Look up the nth author and return the proper last name for citation markers.
|
java.lang.String |
getAuthorYearInTextMarker(BibtexEntry[] entries,
BibtexDatabase database,
java.lang.String authorField,
java.lang.String yearField,
int maxA,
java.lang.String authorSep,
java.lang.String andString,
java.lang.String etAlString,
java.lang.String yearSep,
java.lang.String startBrace,
java.lang.String endBrace,
java.lang.String citationSeparator,
java.lang.String[] uniquefiers,
int[] unlimAuthors)
This method produces "Author (year)" style citation strings in many different forms.
|
java.lang.String |
getAuthorYearParenthesisMarker(BibtexEntry[] entries,
BibtexDatabase database,
java.lang.String authorField,
java.lang.String yearField,
int maxA,
java.lang.String authorSep,
java.lang.String andString,
java.lang.String etAlString,
java.lang.String yearSep,
java.lang.String startBrace,
java.lang.String endBrace,
java.lang.String citationSeparator,
java.lang.String[] uniquifiers,
int[] unlimAuthors)
This method produces (Author, year) style citation strings in many different forms.
|
boolean |
getBooleanCitProperty(java.lang.String key)
Get boolean property.
|
java.lang.String |
getCitationCharacterFormat() |
java.lang.String |
getCitationMarker(BibtexEntry[] entries,
BibtexDatabase database,
boolean inParenthesis,
java.lang.String[] uniquefiers,
int[] unlimAuthors)
Format the marker for the in-text citation according to this bib style.
|
java.lang.String |
getCitationMarker(BibtexEntry entry,
BibtexDatabase database,
boolean inParenthesis,
java.lang.String uniquefier,
int unlimAuthors)
Format the marker for the in-text citation according to this bib style.
|
java.lang.String |
getCitationMarkerField(BibtexEntry entry,
BibtexDatabase database,
java.lang.String field)
This method looks up a field for en entry in a database.
|
java.io.File |
getFile() |
int |
getIntCitProperty(java.lang.String key) |
java.util.Set<java.lang.String> |
getJournals() |
java.lang.String |
getName() |
java.lang.String |
getNumCitationMarker(int[] number,
int minGroupingCount,
boolean inList)
Format a number-based citation marker for the given number.
|
java.lang.Object |
getProperty(java.lang.String name)
Get a style property.
|
Layout |
getReferenceFormat(java.lang.String type) |
java.lang.String |
getStringCitProperty(java.lang.String key) |
java.lang.String |
insertPageInfo(java.lang.String citation,
java.lang.String pageInfo)
Take a finished citation and insert a string at the end (but inside the end bracket)
separated by "PageInfoSeparator"
|
boolean |
isBibtexKeyCiteMarkers() |
boolean |
isBoldCitations()
Convenience method for checking whether citation markers should be bold.
|
boolean |
isFormatCitations()
Convenience method for checking whether citation markers formatted
according to the results of the isItalicCitations() and
isBoldCitations() methods.
|
boolean |
isItalicCitations()
Convenience method for checking whether citation markers should be italicised.
|
boolean |
isNumberEntries()
Convenience method for checking the property for whether we use number citations or
author-year citations.
|
boolean |
isSortByPosition()
Convenience method for checking the property for whether we sort the bibliography
according to their order of appearance in the text.
|
boolean |
isUpToDate()
If this style was initialized from a file on disk, check whether the file
is unmodified since initialization.
|
boolean |
isValid()
After initalizing this style from a file, this method can be used to check
whether the file appeared to be a proper style file.
|
void |
reload()
If this style was initialized from a file on disk, reload the style
information.
|
public static final java.lang.String UNDEFINED_CITATION_MARKER
public OOBibStyle(java.io.File styleFile) throws java.lang.Exception
java.lang.Exception
public OOBibStyle(java.io.Reader in) throws java.lang.Exception
java.lang.Exception
public java.lang.String getName()
public java.io.File getFile()
public java.util.Set<java.lang.String> getJournals()
public void ensureUpToDate() throws java.lang.Exception
java.lang.Exception
public void reload() throws java.lang.Exception
java.lang.Exception
public boolean isUpToDate()
public boolean isValid()
public Layout getReferenceFormat(java.lang.String type)
public java.lang.String getNumCitationMarker(int[] number, int minGroupingCount, boolean inList)
number
- The citation numbers.public java.lang.String getCitationMarker(BibtexEntry entry, BibtexDatabase database, boolean inParenthesis, java.lang.String uniquefier, int unlimAuthors)
entry
- The JabRef BibtexEntry providing the data.inParenthesis
- Signals whether a parenthesized citation or an in-text citation is wanted.uniquefier
- String to add behind the year in case it's needed to separate similar
entries.public java.lang.String getCitationMarker(BibtexEntry[] entries, BibtexDatabase database, boolean inParenthesis, java.lang.String[] uniquefiers, int[] unlimAuthors)
entries
- The array of JabRef BibtexEntry providing the data.inParenthesis
- Signals whether a parenthesized citation or an in-text citation is wanted.uniquefiers
- Strings to add behind the year for each entry in case it's needed to separate similar
entries.unlimAuthors
- Boolean for each entry. If true, we should not use "et al" formatting regardless
of the number of authors. Can be null to indicate that no entries should have unlimited names.public java.lang.String getAuthorYearParenthesisMarker(BibtexEntry[] entries, BibtexDatabase database, java.lang.String authorField, java.lang.String yearField, int maxA, java.lang.String authorSep, java.lang.String andString, java.lang.String etAlString, java.lang.String yearSep, java.lang.String startBrace, java.lang.String endBrace, java.lang.String citationSeparator, java.lang.String[] uniquifiers, int[] unlimAuthors)
entries
- The array of BibtexEntry to get fields from.authorField
- The bibtex field providing author names, e.g. "author" or "editor".yearField
- The bibtex field providing the year, e.g. "year".maxA
- The maximum number of authors to write out in full without using etal. Set to
-1 to always write out all authors.authorSep
- The String to add between author names except the last two, e.g. ", ".andString
- The String to add between the two last author names, e.g. " & ".etAlString
- The String to represent authors that are not mentioned, e.g. " et al."yearSep
- The String to separate authors from year, e.g. "; ".startBrace
- The opening parenthesis.endBrace
- The closing parenthesis.citationSeparator
- The String to separate citations from each other.uniquifiers
- Optional parameter to separate similar citations. Elements can be null if not needed.public java.lang.String getAuthorYearInTextMarker(BibtexEntry[] entries, BibtexDatabase database, java.lang.String authorField, java.lang.String yearField, int maxA, java.lang.String authorSep, java.lang.String andString, java.lang.String etAlString, java.lang.String yearSep, java.lang.String startBrace, java.lang.String endBrace, java.lang.String citationSeparator, java.lang.String[] uniquefiers, int[] unlimAuthors)
entries
- The array of BibtexEntry to get fields from.authorField
- The bibtex field providing author names, e.g. "author" or "editor".yearField
- The bibtex field providing the year, e.g. "year".maxA
- The maximum number of authors to write out in full without using etal. Set to
-1 to always write out all authors.authorSep
- The String to add between author names except the last two, e.g. ", ".andString
- The String to add between the two last author names, e.g. " & ".etAlString
- The String to represent authors that are not mentioned, e.g. " et al."yearSep
- The String to separate authors from year, e.g. "; ".startBrace
- The opening parenthesis.endBrace
- The closing parenthesis.uniquefiers
- Optional parameters to separate similar citations. Can be null if not needed.public java.lang.String getCitationMarkerField(BibtexEntry entry, BibtexDatabase database, java.lang.String field)
entry
- The entry.database
- The database the entry belongs to.field
- The field, or succession of fields, to look up. If backup fields are needed, separate
field names by /. E.g. to use "author" with "editor" as backup, specify "author/editor".public java.lang.String getAuthorLastName(AuthorList al, int number)
al
- The author list.number
- The number of the author to return.public java.lang.String insertPageInfo(java.lang.String citation, java.lang.String pageInfo)
citation
- pageInfo
- public boolean isNumberEntries()
public boolean isSortByPosition()
public boolean isItalicCitations()
public boolean isBoldCitations()
public boolean isFormatCitations()
public boolean isBibtexKeyCiteMarkers()
public boolean getBooleanCitProperty(java.lang.String key)
key
- The property keypublic int getIntCitProperty(java.lang.String key)
public java.lang.String getStringCitProperty(java.lang.String key)
public java.lang.String getCitationCharacterFormat()
public java.lang.Object getProperty(java.lang.String name)
name
- The property name.public int compareTo(java.lang.Object o)
compareTo
in interface java.lang.Comparable
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object