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

public Class YearChecker

extends Object
implements ValueChecker
Class Inheritance
All Implemented Interfaces
org.jabref.logic.integrity.ValueChecker
Imports
java.util.Optional, java.util.function.Predicate, java.util.regex.Pattern, org.jabref.logic.l10n.Localization, org.jabref.logic.util.strings.StringUtil, org.jspecify.annotations.Nullable

Field Summary

Modifier and TypeField and Description
private static final Predicate<String>
private static final Predicate<String>
private static final String

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public Optional<String>
checkValue(@Nullable String value)

Checks, if the number String contains a four digit year and ends with it.

public static boolean
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

CONTAINS_FOUR_DIGITback to summary
private static final Predicate<String> CONTAINS_FOUR_DIGIT
ENDS_WITH_FOUR_DIGITback to summary
private static final Predicate<String> ENDS_WITH_FOUR_DIGIT
PUNCTUATION_MARKSback to summary
private static final String PUNCTUATION_MARKS

Constructor Detail

YearCheckerback to summary
public YearChecker()

Method Detail

checkValueback to summary
public Optional<String> checkValue(@Nullable String value)

Checks, if the number String contains a four digit year and ends with it. Official bibtex spec: Generally it should consist of four numerals, such as 1984, although the standard styles can handle any year whose last four nonpunctuation characters are numerals, such as ‘(about 1984)’. Source: http://ftp.fernuni-hagen.de/ftp-dir/pub/mirrors/www.ctan.org/biblio/bibtex/base/btxdoc.pdf

Annotations
@Override
isValueCorrectlyFormattedback to summary
public static boolean isValueCorrectlyFormatted(String value)