Verified Owner
Top Fields Constructors Methods
org.jabref.logic.openoffice

public final Record ZoteroReferenceMark

extends Record
implements ReferenceMark
Class Inheritance
All Implemented Interfaces
org.jabref.logic.openoffice.ReferenceMark
Annotations
@NullMarked
Record Components
name:String 
citationKeys:List<String> 
citationNumbers:List<Integer> 
uniqueId:String 
citationType:CSLCitationType 
Imports
java.util.ArrayList, .HashMap, .List, .Map, .Optional, java.util.regex.Matcher, .Pattern, org.jabref.logic.citationstyle.JabRefItemDataProvider, org.jabref.logic.openoffice.oocsltext.CSLCitationType, org.jabref.logic.util.strings.StringUtil, org.jabref.model.database.BibDatabaseContext, org.jabref.model.entry.BibEntry, .BibEntryTypesManager, .Date, com.google.gson.Gson, .JsonArray, .JsonObject, .JsonParseException, .JsonParser, org.jspecify.annotations.NullMarked, org.slf4j.Logger, .LoggerFactory

Field Summary

Modifier and TypeField and Description
private static final int
private final List<String>
citationKeys

Record Component accessed by citationKeys().

private final List<Integer>
citationNumbers

Record Component accessed by citationNumbers().

private final CSLCitationType
citationType

Record Component accessed by citationType().

private static final Gson
private static final Pattern
private static final String
private static final Logger
private final String
name

Record Component accessed by name().

public static final String
private static final int
private static final String
private static final Pattern
private final String
uniqueId

Record Component accessed by uniqueId().

private static final String

Constructor Summary

AccessConstructor and Description
public
ZoteroReferenceMark(String name, List<String> citationKeys, List<Integer> citationNumbers, String uniqueId, CSLCitationType citationType)

Method Summary

Modifier and TypeMethod and Description
pack-priv static String
addJabRefUri(String referenceMarkName, int citationItemIndex, String jabRefUri)

public static ZoteroReferenceMark
buildReferenceMark(List<BibEntry> entries, List<String> citationKeys, List<Integer> citationNumbers, int firstItemId, CSLCitationType citationType, BibDatabaseContext bibDatabaseContext, BibEntryTypesManager entryTypesManager, Map<String, String> zoteroUriByCitationKey)

Example: "ZOTERO_ITEM CSL_CITATION {json} RNDxxxxxxx"

public List<String>
public List<Integer>
public CSLCitationType
pack-priv static String
createJabRefUri(String citationKey)

pack-priv static String
private static List<String>
createUris(String citationKey, String zoteroUri)

public final boolean
equals(Object o)

Implements abstract java.lang.Record.equals.

Indicates whether some other object is "equal to" this one.

public static Map<String, String>
extractZoteroUriByCitationKey(String referenceMarkName)

Create a map of "citationKey -> ZoteroUri".

private static ZoteroCitationData
getCitationData(String referenceMarkName)

pack-priv static List<ZoteroCitationData.CitationItemData>
getCitationItems(String referenceMarkName)

pack-priv static Optional<String>
pack-priv static String
public static String
getCSLJson(String referenceMarkName)

public static int
getMaxItemId(String referenceMarkName)

private static String
getSuffix(String referenceMarkName)

public final int
hashCode()

Implements abstract java.lang.Record.hashCode.

Returns a hash code value for the record.

pack-priv static boolean
public static boolean
pack-priv static boolean
public String
name()

Record Component getter of name.

Implements org.jabref.logic.openoffice.ReferenceMark.name.

private static String
public static Optional<ZoteroReferenceMark>
public final String
toString()

Implements abstract java.lang.Record.toString.

Returns a string representation of the record.

public String
uniqueId()

Record Component getter of uniqueId.

Implements org.jabref.logic.openoffice.ReferenceMark.uniqueId.

public static String
updateCitationType(String referenceMarkName, CSLCitationType citationType)

Field Detail

CITATION_ID_LENGTHback to summary
private static final int CITATION_ID_LENGTH
citationKeysback to summary
private final List<String> citationKeys

Record Component accessed by citationKeys().

citationNumbersback to summary
private final List<Integer> citationNumbers

Record Component accessed by citationNumbers().

citationTypeback to summary
private final CSLCitationType citationType

Record Component accessed by citationType().

GSONback to summary
private static final Gson GSON
ITEM_ID_PATTERNback to summary
private static final Pattern ITEM_ID_PATTERN
JABREF_URI_PREFIXback to summary
private static final String JABREF_URI_PREFIX
LOGGERback to summary
private static final Logger LOGGER

Hides org.jabref.logic.openoffice.ReferenceMark.LOGGER.

nameback to summary
private final String name

Record Component accessed by name().

PREFIXback to summary
public static final String PREFIX
RANDOM_LENGTHback to summary
private static final int RANDOM_LENGTH
RANDOM_PREFIXback to summary
private static final String RANDOM_PREFIX
RANDOM_SUFFIX_PATTERNback to summary
private static final Pattern RANDOM_SUFFIX_PATTERN
uniqueIdback to summary
private final String uniqueId

Record Component accessed by uniqueId().

ZOTERO_URI_PREFIXback to summary
private static final String ZOTERO_URI_PREFIX

Constructor Detail

ZoteroReferenceMarkback to summary
public ZoteroReferenceMark(String name, List<String> citationKeys, List<Integer> citationNumbers, String uniqueId, CSLCitationType citationType)

Method Detail

addJabRefUriback to summary
pack-priv static String addJabRefUri(String referenceMarkName, int citationItemIndex, String jabRefUri)
buildReferenceMarkback to summary
public static ZoteroReferenceMark buildReferenceMark(List<BibEntry> entries, List<String> citationKeys, List<Integer> citationNumbers, int firstItemId, CSLCitationType citationType, BibDatabaseContext bibDatabaseContext, BibEntryTypesManager entryTypesManager, Map<String, String> zoteroUriByCitationKey)

Example: "ZOTERO_ITEM CSL_CITATION {json} RNDxxxxxxx"

citationKeysback to summary
public List<String> citationKeys()

Record Component getter of citationKeys.

Implements org.jabref.logic.openoffice.ReferenceMark.citationKeys.

citationNumbersback to summary
public List<Integer> citationNumbers()

Record Component getter of citationNumbers.

Implements org.jabref.logic.openoffice.ReferenceMark.citationNumbers.

citationTypeback to summary
public CSLCitationType citationType()

Record Component getter of citationType.

Implements org.jabref.logic.openoffice.ReferenceMark.citationType.

createJabRefUriback to summary
pack-priv static String createJabRefUri(String citationKey)
createRandomSuffixback to summary
pack-priv static String createRandomSuffix()
createUrisback to summary
private static List<String> createUris(String citationKey, String zoteroUri)
equalsback to summary
public final boolean equals(Object o)

Implements abstract java.lang.Record.equals.

Doc from java.lang.Record.equals.

Indicates whether some other object is "equal to" this one. In addition to the general contract of Object.equals, record classes must further obey the invariant that when a record instance is "copied" by passing the result of the record component accessor methods to the canonical constructor, as follows:

    R copy = new R(r.c1(), r.c2(), ..., r.cn());
then it must be the case that r.equals(copy).
extractZoteroUriByCitationKeyback to summary
public static Map<String, String> extractZoteroUriByCitationKey(String referenceMarkName)

Create a map of "citationKey -> ZoteroUri". Next time JabRef cites the same citation, it will add ZoteroUri into citationItem.

getCitationDataback to summary
private static ZoteroCitationData getCitationData(String referenceMarkName)
getCitationItemsback to summary
pack-priv static List<ZoteroCitationData.CitationItemData> getCitationItems(String referenceMarkName)
getCitationKeyback to summary
pack-priv static Optional<String> getCitationKey(ZoteroCitationData.CitationItemData citationItem)
getCitationKeyFromJabRefUriback to summary
pack-priv static String getCitationKeyFromJabRefUri(String uri)
getCSLJsonback to summary
public static String getCSLJson(String referenceMarkName)
getMaxItemIdback to summary
public static int getMaxItemId(String referenceMarkName)
getSuffixback to summary
private static String getSuffix(String referenceMarkName)
hashCodeback to summary
public final int hashCode()

Implements abstract java.lang.Record.hashCode.

Doc from java.lang.Record.hashCode.

Returns a hash code value for the record. Obeys the general contract of Object.hashCode. For records, hashing behavior is constrained by the refined contract of Record.equals, so that any two records created from the same components must have the same hash code.

isJabRefUriback to summary
pack-priv static boolean isJabRefUri(String uri)
isZoteroReferenceMarkNameback to summary
public static boolean isZoteroReferenceMarkName(String name)

Hides org.jabref.logic.openoffice.ReferenceMark.isZoteroReferenceMarkName.

isZoteroUriback to summary
pack-priv static boolean isZoteroUri(String uri)
nameback to summary
public String name()

Record Component getter of name.

Implements org.jabref.logic.openoffice.ReferenceMark.name.

normalizeZoteroItemIdback to summary
private static String normalizeZoteroItemId(String itemId)
parseback to summary
public static Optional<ZoteroReferenceMark> parse(String referenceMarkName)

Hides org.jabref.logic.openoffice.ReferenceMark.parse.

toStringback to summary
public final String toString()

Implements abstract java.lang.Record.toString.

Doc from java.lang.Record.toString.

Returns a string representation of the record. In accordance with the general contract of Object#toString(), the toString method returns a string that "textually represents" this record. The result should be a concise but informative representation that is easy for a person to read.

In addition to this general contract, record classes must further participate in the invariant that any two records which are equal must produce equal strings. This invariant is necessarily relaxed in the rare case where corresponding equal component values might fail to produce equal strings for themselves.

uniqueIdback to summary
public String uniqueId()

Record Component getter of uniqueId.

Implements org.jabref.logic.openoffice.ReferenceMark.uniqueId.

updateCitationTypeback to summary
public static String updateCitationType(String referenceMarkName, CSLCitationType citationType)