de.hpi.fgis.dude.util.bibtex.parser
Class BibtexParser

java.lang.Object
  extended by de.hpi.fgis.dude.util.bibtex.parser.BibtexParser

public final class BibtexParser
extends Object

The parser will parse the BibTex into a basic AST. Have a look at the different Expanders defined in the bibtexexpansions package if you need more than that.

Author:
henkel

Constructor Summary
BibtexParser(boolean throwAllParseExceptions)
          Creates a new BibTexParser.
 
Method Summary
 ParseException[] getExceptions()
          Returns the list of non-fatal exceptions that occurred during parsing.
 void parse(BibtexFile bibtexFile, Reader input)
          Parses the input into bibtexFile - don't forget to check getExceptions() afterwards (if you don't use throwAllParseExceptions which you can configure in the constructor)...
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BibtexParser

public BibtexParser(boolean throwAllParseExceptions)
Creates a new BibTexParser.

Parameters:
throwAllParseExceptions - Setting this to true means that all exceptions will be thrown immediately. Otherwise, the parser will skip over things it can't parse and you can use getExceptions() to retrieve the exceptions later.
Method Detail

getExceptions

public ParseException[] getExceptions()
Returns the list of non-fatal exceptions that occurred during parsing. Usually, these occur while parsing an entry. Usually, the remainder of the entry will be treated as part of a comment - thus the following entry will be parsed again.

Returns:
An array of ParseExceptions.

parse

public void parse(BibtexFile bibtexFile,
                  Reader input)
           throws ParseException,
                  IOException
Parses the input into bibtexFile - don't forget to check getExceptions() afterwards (if you don't use throwAllParseExceptions which you can configure in the constructor)...

Parameters:
bibtexFile - The Java representation of the file.
input - The reader that is used for reading from the file.
Throws:
ParseException - If an entry couldn't be parsed. This exception won't be thrown if throwAllParseExceptions was disabled within the constructor.
IOException - If another error occurs while reading.


Copyright © 2011 Hasso Plattner Institute - Chair of Information Systems. All Rights Reserved.