| Modifier and Type | Class and Description |
|---|---|
| private static enum | |
| private static class | OOBibStyleGetCitationMarker.
Add / override methods for the purpose of creating a normalized citation marker. |
| private static class | OOBibStyleGetCitationMarker.
On success, getRawCitationMarkerField returns content, but we also need to know which field matched, because for some fields (actually: for author names) we need to reproduce the surrounding braces to inform AuthorList.parse not to split up the content. |
| Modifier and Type | Field and Description |
|---|---|
| private static final RemoveEnclosingBracesFormatter |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| private static int | calculateNAuthorsToEmit(OOBibStyle style, CitationMarkerEntry entry)
How many authors would be emitted for entry, considering style and entry.getIsFirstAppearanceOfSource() If entry is unresolved, return 0. |
| public static OOText | createCitationMarker(OOBibStyle style, List<CitationMarkerEntry>
A group of citations to process. citationMarkerEntries, boolean If true, put parenthesis around the whole group,
otherwise around each (year,uniqueLetter,pageInfo) part. inParenthesis, NonUniqueCitationMarker What should happen if we
stumble upon citations with identical normalized
citation markers which cite different sources and
are not distinguished by uniqueLetters.
nonUniqueCitationMarkerHandling)Note only consecutive citations are checked. Produce citation marker for a citation group. |
| private static String | Returns: "Au[AS]Bu[AS]Cu[OXFORD_COMMA][andString]Du[yearSep]" or "Au[etAlString][yearSep]" where AS = AUTHOR_SEPARATOR Au, Bu, Cu, Du are last names of authors.Note - The "Au[AS]Bu[AS]Cu" (or the "Au") part may be empty (maxAuthors==0 or nAuthors==0). - OXFORD_COMMA is only emitted if nAuthors is at least 3. - andString is only emitted if nAuthors is at least 2. Parsed list of authors. authorList, int The maximum number of authors to write out.
If there are more authors, then ET_AL_STRING is emitted
to mark their omission.
Set to -1 to write out all authors.
maxAuthors=0 is pointless, now throws IllegalArgumentException
(Earlier it behaved as maxAuthors=1)
maxAuthors less than -1 : throw IllegalArgumentException maxAuthors, String For "A, B[ and ]C" andString)
|
| private static String | Returns: The author name, or an empty String if inapplicable.The author list. authorList, int The number of the author to return. number)Look up the nth author and return the "proper" last name for citation markers. |
| private static AuthorList | |
| private static OOText | Returns: The formatted citation.IN_PARENTHESIS and NORMALIZED puts parentheses around the whole,
IN_TEXT around each (year,uniqueLetter,pageInfo) part.
NORMALIZED omits uniqueLetter and pageInfo,
ignores isFirstAppearanceOfSource (always
style.getMaxAuthors, not getMaxAuthorsFirst) purpose,The list of CitationMarkerEntry values to process.
Here we do not check for duplicate entries: those
are handled by entries, boolean[] getCitationMarker by
omitting them from the list.
Unresolved citations recognized by
entry.getBibEntry() and/or
entry.getDatabase() returning empty, and
emitted as "Unresolved${citationKey}".
Neither uniqueLetter nor pageInfo are emitted
for unresolved citations.Should have the same length as startsNewGroup, Optional<Integer> entries, and
contain true for entries starting a new group,
false for those that only add a uniqueLetter to
the grouped presentation.If not empty, always show this number of authors.
Added to allow NORMALIZED to use maxAuthors value that differs from
style.getMaxAuthors() maxAuthorsOverride)Produce (Author, year) or "Author (year)" style citation strings. |
| private static String | Returns: The resolved field content, or an empty string if the field(s) were empty.A list of fields, to look up, using first nonempty hit.
If backup fields are needed, separate field
names by /.
E.g. to use "author" with "editor" as backup,
specify
FieldFactory.serializeOrFields(StandardField.AUTHOR,
StandardField.EDITOR) fields)This method looks up a field for an entry in a database. |
| pack-priv static OOText | Returns: A normalized citation marker for deciding which citations need uniqueLetters. For details of what "normalized" means: SeegetAuthorYearParenthesisMarker2
Note now includes some markup. A citation to process. normEntry, Optional<Integer> maxAuthorsOverride)
|
| private static List | getNormalizedCitationMarkers(OOBibStyle style, List<CitationMarkerEntry> citationMarkerEntries, Optional<Integer> maxAuthorsOverride)
|
| private static Optional | Returns: the field and the content of the first nonempty (after trimming) field (or alias) fromfields found in entry.
Return Optional.empty() if found nothing.
|
| private static String |
| REMOVE_BRACES_FORMATTER | back to summary |
|---|---|
| private static final RemoveEnclosingBracesFormatter REMOVE_BRACES_FORMATTER | |
| OOBibStyleGetCitationMarker | back to summary |
|---|---|
| private OOBibStyleGetCitationMarker() | |
| calculateNAuthorsToEmit | back to summary |
|---|---|
| private static int calculateNAuthorsToEmit(OOBibStyle style, CitationMarkerEntry entry) How many authors would be emitted for entry, considering style and entry.getIsFirstAppearanceOfSource() If entry is unresolved, return 0. | |
| createCitationMarker | back to summary |
|---|---|
| public static OOText createCitationMarker(OOBibStyle style, List<CitationMarkerEntry> citationMarkerEntries, boolean inParenthesis, NonUniqueCitationMarker nonUniqueCitationMarkerHandling) Produce citation marker for a citation group. Attempts to join consecutive citations: if normalized citations markers match and no pageInfo is present, the second entry can be presented by appending its uniqueLetter to the previous. If either entry has pageInfo, join is inhibited. If the previous entry has more names than we need we check with extended normalizedMarkers if they match. For consecutive identical entries, the second one is omitted. Identical requires same pageInfo here, we do not try to merge them. Note notifying the user about them would be nice.
| |
| formatAuthorList | back to summary |
|---|---|
private static String formatAuthorList(OOBibStyle style, @NonNull AuthorList authorList, int maxAuthors, String andString)
| |
| getAuthorLastName | back to summary |
|---|---|
| private static String getAuthorLastName(AuthorList authorList, int number) Look up the nth author and return the "proper" last name for citation markers. Note "proper" in the sense that it includes the "von" part of the name (followed by a space) if there is one.
| |
| getAuthorList | back to summary |
|---|---|
| private static AuthorList getAuthorList(OOBibStyle style, CitationLookupResult db) | |
| getAuthorYearParenthesisMarker2 | back to summary |
|---|---|
| private static OOText getAuthorYearParenthesisMarker2(OOBibStyle style, OOBibStyleGetCitationMarker. Produce (Author, year) or "Author (year)" style citation strings.
| |
| getCitationMarkerField | back to summary |
|---|---|
| private static String getCitationMarkerField(OOBibStyle style, @NonNull CitationLookupResult db, OrFields fields) This method looks up a field for an entry in a database. Any number of backup fields can be used if the primary field is empty.
| |
| getNormalizedCitationMarker | back to summary |
|---|---|
pack-priv static OOText getNormalizedCitationMarker(OOBibStyle style, CitationMarkerNormEntry normEntry, Optional<Integer> maxAuthorsOverride)
| |
| getNormalizedCitationMarkers | back to summary |
|---|---|
| private static List | |
| getRawCitationMarkerField | back to summary |
|---|---|
private static Optional
| |
| markupAuthorName | back to summary |
|---|---|
| private static String markupAuthorName(OOBibStyle style, String name) | |
| Modifier and Type | Field and Description |
|---|---|
| public static final OOBibStyleGetCitationMarker. | |
| public static final OOBibStyleGetCitationMarker. | |
| public static final OOBibStyleGetCitationMarker. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static OOBibStyleGetCitationMarker. | |
| public static OOBibStyleGetCitationMarker. |
| IN_PARENTHESIS | back to summary |
|---|---|
| public static final OOBibStyleGetCitationMarker. | |
| IN_TEXT | back to summary |
|---|---|
| public static final OOBibStyleGetCitationMarker. | |
| NORMALIZED | back to summary |
|---|---|
| public static final OOBibStyleGetCitationMarker. | |
| AuthorYearMarkerPurpose | back to summary |
|---|---|
| private AuthorYearMarkerPurpose() | |
| valueOf | back to summary |
|---|---|
| public static OOBibStyleGetCitationMarker. | |
| values | back to summary |
|---|---|
| public static OOBibStyleGetCitationMarker. | |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv CitationMarkerNormEntry |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public String | getCitationKey()
Implements org. Citation key. |
| public boolean | |
| public Optional | getLookupResult()
Implements org. Result of looking up citation key in databases. |
| public Optional | getPageInfo()
Implements org. pageInfo for this citation, provided by the user. |
| public Optional | getUniqueLetter()
Implements org. uniqueLetter or Optional.empty() if not needed. |
| inner | back to summary |
|---|---|
| pack-priv CitationMarkerNormEntry inner | |
| CitationMarkerNormEntryWrap | back to summary |
|---|---|
| pack-priv CitationMarkerNormEntryWrap(CitationMarkerNormEntry inner) | |
| getCitationKey | back to summary |
|---|---|
| public String getCitationKey() Implements org. Doc from org. Citation key. This is what we usually get from the document. Used if getLookupResult() returns empty, which indicates failure to lookup in the databases.
| |
| getIsFirstAppearanceOfSource | back to summary |
|---|---|
| public boolean getIsFirstAppearanceOfSource() Implements org.
| |
| getLookupResult | back to summary |
|---|---|
| public Optional Implements org. Doc from org. Result of looking up citation key in databases. Optional.empty() indicates unresolved citation.
| |
| getPageInfo | back to summary |
|---|---|
| public Optional Implements org. Doc from org. pageInfo for this citation, provided by the user. May be empty, for none.
| |
| getUniqueLetter | back to summary |
|---|---|
| public Optional Implements org. Doc from org. uniqueLetter or Optional.empty() if not needed.
| |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| content | back to summary |
|---|---|
| pack-priv String content | |
| field | back to summary |
|---|---|
| pack-priv Field field | |
| FieldAndContent | back to summary |
|---|---|
| pack-priv FieldAndContent(Field field, String content) | |