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

public Class DefaultAuxParser

extends Object
implements AuxParser
Class Inheritance
All Implemented Interfaces
org.jabref.logic.auxparser.AuxParser
Imports
java.io.BufferedReader, .FileNotFoundException, .IOException, java.nio.file.Files, .Path, java.util.ArrayList, .List, .Optional, java.util.regex.Matcher, .Pattern, org.jabref.model.database.BibDatabase, org.jabref.model.entry.BibEntry, org.jabref.model.entry.field.StandardField, org.slf4j.Logger, .LoggerFactory

LaTeX Aux to BibTeX Parser

Extracts a subset of BibTeX entries from a BibDatabase that are included in an AUX file. Also supports nested AUX files (latex \include).

There exists no specification of the AUX file. Every package, class or document can write to the AUX file. The AUX file consists of LaTeX macros and is read at the \begin{document} and again at the \end{document}.

BibTeX citation: \citation{x,y,z} Biblatex citation: \abx@aux@cite{x,y,z} Nested AUX files: @input{x}

Field Summary

Modifier and TypeField and Description
private static final Pattern
private static final Pattern
private static final Logger
private final BibDatabase

Constructor Summary

AccessConstructor and Description
public
DefaultAuxParser(BibDatabase
BibTeX database
database
)

Generates a database based on the given AUX file and BibTeX database

Method Summary

Modifier and TypeMethod and Description
private void
insertEntries(List<BibEntry>
Entries to be cloned
entries
,
AuxParserResult
the parser result (representing the AUX file)
result
)

Insert a clone of each given entry.

private void
private void
matchNestedAux(Path baseAuxFile, AuxParserResult result, List<Path> fileList, String line)

public AuxParserResult
parse(Path auxFile)

Implements org.jabref.logic.auxparser.AuxParser.parse.

Executes the parsing logic and returns a result containing all information and the generated BibDatabase.

private void
resolveCrossReferences(List<BibEntry>
Entries to check for CrossRefs
entries
,
AuxParserResult
AUX file
result
)

Resolves and adds CrossRef entries to insert them in addition to the original entries

private void
resolveTags(AuxParserResult
AUX file
result
)

Try to find an equivalent BibTeX entry inside the reference database for all keys inside the AUX file.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

CITE_PATTERNback to summary
private static final Pattern CITE_PATTERN
INPUT_PATTERNback to summary
private static final Pattern INPUT_PATTERN
LOGGERback to summary
private static final Logger LOGGER
masterDatabaseback to summary
private final BibDatabase masterDatabase

Constructor Detail

DefaultAuxParserback to summary
public DefaultAuxParser(BibDatabase database)

Generates a database based on the given AUX file and BibTeX database

Parameters
database:BibDatabase

BibTeX database

Method Detail

insertEntriesback to summary
private void insertEntries(List<BibEntry> entries, AuxParserResult result)

Insert a clone of each given entry. The clones are each given a new unique ID.

Parameters
entries:List<BibEntry>

Entries to be cloned

result:AuxParserResult

the parser result (representing the AUX file)

matchCitationback to summary
private void matchCitation(AuxParserResult result, String line)
matchNestedAuxback to summary
private void matchNestedAux(Path baseAuxFile, AuxParserResult result, List<Path> fileList, String line)
parseback to summary
public AuxParserResult parse(Path auxFile)

Implements org.jabref.logic.auxparser.AuxParser.parse.

Doc from org.jabref.logic.auxparser.AuxParser.parse.

Executes the parsing logic and returns a result containing all information and the generated BibDatabase.

Annotations
@Override
resolveCrossReferencesback to summary
private void resolveCrossReferences(List<BibEntry> entries, AuxParserResult result)

Resolves and adds CrossRef entries to insert them in addition to the original entries

Parameters
entries:List<BibEntry>

Entries to check for CrossRefs

result:AuxParserResult

AUX file

resolveTagsback to summary
private void resolveTags(AuxParserResult result)

Try to find an equivalent BibTeX entry inside the reference database for all keys inside the AUX file.

Parameters
result:AuxParserResult

AUX file