Verified Owner
Top Description Fields Constructors Methods
org.jabref.logic.biblog

public Class BibtexLogParser

extends Object
Class Inheritance
Imports
java.io.IOException, java.nio.file.Files, .Path, java.util.List, .Optional, java.util.regex.Matcher, .Pattern, org.jabref.model.biblog.BibWarning, .SeverityType, org.jabref.model.entry.field.FieldFactory, org.jspecify.annotations.NonNull

Parses the contents of a .blg (BibTeX log) file to extract warning messages.

Field Summary

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

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public List<BibWarning>
parseBiblog(@NonNull Path blgFilePath)

pack-priv Optional<BibWarning>

Returns:

An Optional containing a BibWarning if a match is found, or an empty Optional otherwise.
parseWarningLine
(String
The single line from the .blg file to parse.
line
)

Parses a single line from a .blg file to identify a warning.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

BIBLATEX_WARNING_PATTERNback to summary
private static final Pattern BIBLATEX_WARNING_PATTERN
BIBTEX_WARNING_PATTERNback to summary
private static final Pattern BIBTEX_WARNING_PATTERN
EMPTY_FIELD_PREFIXback to summary
private static final String EMPTY_FIELD_PREFIX
INVALID_FIELD_PREFIXback to summary
private static final String INVALID_FIELD_PREFIX
MULTI_INVALID_FIELD_PREFIXback to summary
private static final String MULTI_INVALID_FIELD_PREFIX

Constructor Detail

BibtexLogParserback to summary
public BibtexLogParser()

Method Detail

parseBiblogback to summary
public List<BibWarning> parseBiblog(@NonNull Path blgFilePath) throws IOException
parseWarningLineback to summary
pack-priv Optional<BibWarning> parseWarningLine(String line)

Parses a single line from a .blg file to identify a warning.

This method supports two warning formats:

  1. BibTeX Warnings: Simple warnings from the legacy BibTeX backend. Warning--[message] in [entryKey] For example: Warning--empty journal in Scholey_2013

  2. BibLaTeX Datamodel Warnings: Detailed warnings from the Biber backend, including datamodel validation issues. [Log line] > WARN - Datamodel: [entry type] entry '[entryKey]' ([fileName]): [message] For example: Biber.pm:123> WARN - Datamodel: article entry 'Scholey_2013' (file.bib): Invalid field 'journal'

Parameters
line:String

The single line from the .blg file to parse.

Returns:Optional<BibWarning>

An Optional containing a BibWarning if a match is found, or an empty Optional otherwise.