Top Fields Constructors Methods
org.jabref.logic.texparser

public Class DefaultLatexParser

extends Object
implements LatexParser
Class Inheritance
All Implemented Interfaces
org.jabref.logic.texparser.LatexParser
Imports
java.io.IOException, .InputStream, .InputStreamReader, .LineNumberReader, .Reader, .UncheckedIOException, java.nio.channels.ClosedChannelException, java.nio.charset.StandardCharsets, java.nio.file.Files, .Path, java.util.List, .Optional, java.util.regex.Matcher, .Pattern, org.jabref.model.texparser.LatexParserResult, .LatexParserResults, org.slf4j.Logger, .LoggerFactory

Field Summary

Modifier and TypeField and Description
private static final String
private static final String
private static final Pattern
private static final String[]
CITE_COMMANDS

It is allowed to add new cite commands for pattern matching.

private static final String
private static final Pattern
private static final String
private static final Pattern
private static final Logger
private static final String

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private void
matchBibFile(Path file, String line, LatexParserResult latexParserResult)

Find BIB files along a specific line and store them.

private void
matchCitation(Path file, int lineNumber, String line, LatexParserResult latexParserResult)

Find cites along a specific line and store them.

private void
matchNestedFile(Path texFile, String line, LatexParserResult latexParserResult)

Find inputs and includes along a specific line and store them for parsing later.

public LatexParserResult
parse(String
String that contains a citation
citeString
)

Implements org.jabref.logic.texparser.LatexParser.parse.

For testing purposes.

public Optional<LatexParserResult>
parse(Path
Path to a LaTeX file
latexFile
)

Implements org.jabref.logic.texparser.LatexParser.parse.

Parse a single LaTeX file.

public LatexParserResults
parse(List<Path>
List of Path objects linked to a LaTeX file
latexFiles
)

Implements org.jabref.logic.texparser.LatexParser.parse.

Parse a list of LaTeX files.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

BIB_EXTback to summary
private static final String BIB_EXT
BIBLIOGRAPHY_GROUPback to summary
private static final String BIBLIOGRAPHY_GROUP
BIBLIOGRAPHY_PATTERNback to summary
private static final Pattern BIBLIOGRAPHY_PATTERN
CITE_COMMANDSback to summary
private static final String[] CITE_COMMANDS

It is allowed to add new cite commands for pattern matching. Some valid examples: "citep", "[cC]ite", and "[cC]ite(author|title|year|t|p)?".

CITE_GROUPback to summary
private static final String CITE_GROUP
CITE_PATTERNback to summary
private static final Pattern CITE_PATTERN
INCLUDE_GROUPback to summary
private static final String INCLUDE_GROUP
INCLUDE_PATTERNback to summary
private static final Pattern INCLUDE_PATTERN
LOGGERback to summary
private static final Logger LOGGER
TEX_EXTback to summary
private static final String TEX_EXT

Constructor Detail

DefaultLatexParserback to summary
public DefaultLatexParser()

Method Detail

matchBibFileback to summary
private void matchBibFile(Path file, String line, LatexParserResult latexParserResult)

Find BIB files along a specific line and store them.

matchCitationback to summary
private void matchCitation(Path file, int lineNumber, String line, LatexParserResult latexParserResult)

Find cites along a specific line and store them.

matchNestedFileback to summary
private void matchNestedFile(Path texFile, String line, LatexParserResult latexParserResult)

Find inputs and includes along a specific line and store them for parsing later.

parseback to summary
public LatexParserResult parse(String citeString)

Implements org.jabref.logic.texparser.LatexParser.parse.

Doc from org.jabref.logic.texparser.LatexParser.parse.

For testing purposes.

Parameters
citeString:String

String that contains a citation

Returns:LatexParserResult

a LatexParserResult, where Path is "" and lineNumber is 1

Annotations
@Override
parseback to summary
public Optional<LatexParserResult> parse(Path latexFile)

Implements org.jabref.logic.texparser.LatexParser.parse.

Doc from org.jabref.logic.texparser.LatexParser.parse.

Parse a single LaTeX file.

Parameters
latexFile:Path

Path to a LaTeX file

Returns:Optional<LatexParserResult>

Optional LatexParserResult, which contains all data related to the bibliographic entries, or empty if the file does not exist

Annotations
@Override
parseback to summary
public LatexParserResults parse(List<Path> latexFiles)

Implements org.jabref.logic.texparser.LatexParser.parse.

Doc from org.jabref.logic.texparser.LatexParser.parse.

Parse a list of LaTeX files.

Parameters
latexFiles:List<Path>

List of Path objects linked to a LaTeX file

Returns:LatexParserResults

a LatexParserResults, which contains all data related to the bibliographic entries

Annotations
@Override