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

pack-priv Class Codec52

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

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

- pageInfo does not appear here. It is not encoded in the mark name.

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
Codec52.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.

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.

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

Returns:

true if name matches the pattern used for JabRef reference mark names.
isJabRefReferenceMarkName
(String name)

public static Optional<Codec52.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

Codec52back to summary
private Codec52()

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.

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.

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.

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<Codec52.ParsedMarkName> parseMarkName(String refMarkName)

Parse a JabRef (reference) mark name.

Returns:Optional<Codec52.ParsedMarkName>

Optional.empty() on failure.

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

public Class Codec52.ParsedMarkName

extends Object
Class Inheritance

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(String index, CitationType citationType, 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(String index, CitationType citationType, List<String> citationKeys)