Verified Owner
Top Description Inners Fields Constructors Methods
org.jabref.logic.openoffice.backend

pack-priv Class JStyleReferenceMark

extends Object
Class Inheritance
Imports
java.util.Arrays, .List, .Optional, .Set, java.util.regex.Matcher, .Pattern, java.util.stream.Collectors, org.jabref.model.openoffice.style.CitationType, org.jspecify.annotations.NonNull

How and what is encoded in reference mark names under JabRef 5.2.

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
JStyleReferenceMark.ParsedMarkName

This is what we get back from parsing a refMarkName.

Field Summary

Modifier and TypeField and Description
private static final String
private static final Pattern

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
private static CitationType
citationTypeFromInt(int code)

Integer representation was written into the document in JabRef52, keep it for compatibility.

private static int
public static List<String>
filterIsJabRefReferenceMarkName(List<String>
The list to be filtered.
names
)

Filter a list of reference mark names by isJabRefReferenceMarkName

public static String
getUniqueMarkName(Set<String>
Reference mark names already in use.
usedNames
,
List<String>
Identifies the cited sources.
citationKeys
,
CitationType
Encodes the effect of withText and inParenthesis options.
citationType
)

Produce a reference mark name for JabRef for the given citationType and list citation keys that does not yet appear among the reference marks of the document.

public static boolean
isJabRefReferenceMarkName(String name)

Returns: true if name matches the pattern used for JabRef reference mark names.

public static Optional<JStyleReferenceMark.ParsedMarkName>

Returns:

Optional.empty() on failure.
parseMarkName
(String refMarkName)

Parse a JabRef (reference) mark name.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

BIB_CITATIONback to summary
private static final String BIB_CITATION
CITE_PATTERNback to summary
private static final Pattern CITE_PATTERN

Constructor Detail

JStyleReferenceMarkback to summary
private JStyleReferenceMark()

Method Detail

citationTypeFromIntback to summary
private static CitationType citationTypeFromInt(int code)

Integer representation was written into the document in JabRef52, keep it for compatibility.

citationTypeToIntback to summary
private static int citationTypeToInt(CitationType type)
filterIsJabRefReferenceMarkNameback to summary
public static List<String> filterIsJabRefReferenceMarkName(List<String> names)

Filter a list of reference mark names by isJabRefReferenceMarkName

Parameters
names:List<String>

The list to be filtered.

getUniqueMarkNameback to summary
public static String getUniqueMarkName(Set<String> usedNames, List<String> citationKeys, CitationType citationType)

Produce a reference mark name for JabRef for the given citationType and list citation keys that does not yet appear among the reference marks of the document.

The first occurrence of citationKeys gets no serial number, the second gets 0, the third 1 ... Or the first unused in this series, after removals.

Parameters
usedNames:Set<String>

Reference mark names already in use.

citationKeys:List<String>

Identifies the cited sources.

citationType:CitationType

Encodes the effect of withText and inParenthesis options.

isJabRefReferenceMarkNameback to summary
public static boolean isJabRefReferenceMarkName(String name)
Returns:boolean

true if name matches the pattern used for JabRef reference mark names.

parseMarkNameback to summary
public static Optional<JStyleReferenceMark.ParsedMarkName> parseMarkName(String refMarkName)

Parse a JabRef (reference) mark name.

Returns:Optional<JStyleReferenceMark.ParsedMarkName>

Optional.empty() on failure.

org.jabref.logic.openoffice.backend back to summary

public Class JStyleReferenceMark.ParsedMarkName

extends Object
Class Inheritance
  • java.lang.Object
  • org.jabref.logic.openoffice.backend.JStyleReferenceMark.ParsedMarkName

This is what we get back from parsing a refMarkName.

Field Summary

Modifier and TypeField and Description
public final List<String>
citationKeys

Citation keys embedded in the reference mark.

public final CitationType
citationType

in-text-citation type

public final String
index

"", "0", "1" ...

Constructor Summary

AccessConstructor and Description
pack-priv
ParsedMarkName(@NonNull String index, CitationType citationType, @NonNull List<String> citationKeys)

Method Summary

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

citationKeysback to summary
public final List<String> citationKeys

Citation keys embedded in the reference mark.

citationTypeback to summary
public final CitationType citationType

in-text-citation type

indexback to summary
public final String index

"", "0", "1" ...

Constructor Detail

ParsedMarkNameback to summary
pack-priv ParsedMarkName(@NonNull String index, CitationType citationType, @NonNull List<String> citationKeys)