| Modifier and Type | Class and Description |
|---|---|
| private static enum | |
| private static class | JStyleGetCitationMarker.
Add / override methods for the purpose of creating a normalized citation marker. |
| private static class | JStyleGetCitationMarker.
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(JStyle 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(JStyle 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)Produce citation marker for a citation group. |
| public static OOText | createCitationMarker(JStyle style, List<CitationMarkerEntry> citationMarkerEntries, CitationType
Decides brackets and which of the (author, year) parts are emitted. citationType, NonUniqueCitationMarker nonUniqueCitationMarkerHandling)As above, but selects the presentation from the citation type of the group. |
| private static String | Returns: "AuASBuASCuOXFORD_COMMADuyearSep" or "AuetAlString", where AS = AUTHOR_SEPARATOR, Au, Bu, Cu, Du are last names of authors.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 andString)andC"Note: |
| 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. entries, boolean[] 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 tothe 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 fields)FieldFactory.serializeOrFields(StandardField.AUTHOR, StandardField.EDITOR)This method looks up a field for an entry in a database. |
| pack-priv static OOText | getNormalizedCitationMarker(JStyle style, CitationMarkerNormEntry
A citation to process. normEntry, Optional<Integer> maxAuthorsOverride)Returns: A normalized citation marker for deciding which citations need uniqueLetters. |
| private static List | getNormalizedCitationMarkers(JStyle style, List<CitationMarkerEntry> citationMarkerEntries, Optional<Integer> maxAuthorsOverride)
|
| private static Optional | getRawCitationMarkerField(@NonNull BibEntry entry, @NonNull BibDatabase database, @NonNull OrFields fields)
Returns: the field and the content of the first nonempty (after trimming)
field (or alias) from |
| private static String | |
| private static JStyleGetCitationMarker. |
| REMOVE_BRACES_FORMATTER | back to summary |
|---|---|
| private static final RemoveEnclosingBracesFormatter REMOVE_BRACES_FORMATTER | |
| JStyleGetCitationMarker | back to summary |
|---|---|
| private JStyleGetCitationMarker() | |
| calculateNAuthorsToEmit | back to summary |
|---|---|
| private static int calculateNAuthorsToEmit(JStyle 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(JStyle 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. Note only consecutive citations are checked.
| |
| createCitationMarker | back to summary |
|---|---|
| public static OOText createCitationMarker(JStyle style, List<CitationMarkerEntry> citationMarkerEntries, CitationType citationType, NonUniqueCitationMarker nonUniqueCitationMarkerHandling) As above, but selects the presentation from the citation type of the group.
| |
| formatAuthorList | back to summary |
|---|---|
| private static String formatAuthorList(JStyle style, @NonNull AuthorList authorList, int maxAuthors, String andString) Note:
| |
| 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(JStyle style, CitationLookupResult citationLookupResult) | |
| getAuthorYearParenthesisMarker2 | back to summary |
|---|---|
| private static OOText getAuthorYearParenthesisMarker2(JStyle style, JStyleGetCitationMarker. Produce (Author, year) or "Author (year)" style citation strings. Here we do not check for duplicate entries: those
are handled by 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.
| |
| getCitationMarkerField | back to summary |
|---|---|
| private static String getCitationMarkerField(JStyle style, @NonNull CitationLookupResult citationLookupResult, 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(JStyle 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(JStyle style, String name) | |
| purposeOf | back to summary |
|---|---|
| private static JStyleGetCitationMarker. | |
| Modifier and Type | Field and Description |
|---|---|
| public static final JStyleGetCitationMarker. | AUTHOR_ONLY
"Doe" -- author part only. |
| public static final JStyleGetCitationMarker. | |
| public static final JStyleGetCitationMarker. | |
| public static final JStyleGetCitationMarker. | NO_PARENTHESIS
"Doe, 2003" -- no brackets at all. |
| public static final JStyleGetCitationMarker. | |
| public static final JStyleGetCitationMarker. | YEAR_ONLY
"2003a" -- year part only. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static JStyleGetCitationMarker. | |
| public static JStyleGetCitationMarker. |
| AUTHOR_ONLY | back to summary |
|---|---|
| public static final JStyleGetCitationMarker. "Doe" -- author part only. | |
| IN_PARENTHESIS | back to summary |
|---|---|
| public static final JStyleGetCitationMarker. | |
| IN_TEXT | back to summary |
|---|---|
| public static final JStyleGetCitationMarker. | |
| NO_PARENTHESIS | back to summary |
|---|---|
| public static final JStyleGetCitationMarker. "Doe, 2003" -- no brackets at all. | |
| NORMALIZED | back to summary |
|---|---|
| public static final JStyleGetCitationMarker. | |
| YEAR_ONLY | back to summary |
|---|---|
| public static final JStyleGetCitationMarker. "2003a" -- year part only. | |
| AuthorYearMarkerPurpose | back to summary |
|---|---|
| private AuthorYearMarkerPurpose() | |
| valueOf | back to summary |
|---|---|
| public static JStyleGetCitationMarker. | |
| values | back to summary |
|---|---|
| public static JStyleGetCitationMarker. | |
| 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) | |