de.hpi.fgis.dude.util.bibtex.expander
Class MacroReferenceExpander

java.lang.Object
  extended by de.hpi.fgis.dude.util.bibtex.expander.AbstractExpander
      extended by de.hpi.fgis.dude.util.bibtex.expander.MacroReferenceExpander
All Implemented Interfaces:
Expander

public final class MacroReferenceExpander
extends AbstractExpander
implements Expander

This expander expands macro references into strings - have a look at the options that can be given in the constructor.

Author:
henkel

Constructor Summary
MacroReferenceExpander(boolean expandStandardMacros, boolean expandMonthAbbreviations, boolean removeMacros)
          This is just a convenience / backward compatibility constructor.
MacroReferenceExpander(boolean expandStandardMacros, boolean expandMonthAbbreviations, boolean removeMacros, boolean throwAllExpansionExceptions)
           
 
Method Summary
 void expand(BibtexFile bibtexFile)
          This method walks over all entries in a BibtexFile and expands macro references.
 
Methods inherited from class de.hpi.fgis.dude.util.bibtex.expander.AbstractExpander
finishExpansion, getExceptions, throwExpansionException, throwExpansionException
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface de.hpi.fgis.dude.util.bibtex.expander.Expander
getExceptions
 

Constructor Detail

MacroReferenceExpander

public MacroReferenceExpander(boolean expandStandardMacros,
                              boolean expandMonthAbbreviations,
                              boolean removeMacros)
This is just a convenience / backward compatibility constructor. It is equivalent to calling MacroReferenceExpander(expandStandardMacros, expandMonthAbbreviations, removeMacros, true);


MacroReferenceExpander

public MacroReferenceExpander(boolean expandStandardMacros,
                              boolean expandMonthAbbreviations,
                              boolean removeMacros,
                              boolean throwAllExpansionExceptions)
Parameters:
expandStandardMacros - Expand all standard macros as defined in the bibtex file plain.bst
expandMonthAbbreviations - Expand all month abbreviations. This parameter has precedence over the first one (note that the month abbreviations are a subset of the standard macros).
removeMacros - Remove all macros from the bibtex model.
throwAllExpansionExceptions - Setting this to true means that all exceptions will be thrown immediately. Otherwise, the expander will skip over things it can't expand and you can use getExceptions to retrieve the exceptions later
Method Detail

expand

public void expand(BibtexFile bibtexFile)
            throws ExpansionException
This method walks over all entries in a BibtexFile and expands macro references. Thus, after the execution of this function, all fields contain BibtexString entries. Exceptions: 1) the crossref fields 2) 3-letter month abbreviations and standard macros, if specified in the constructor (MacroReferenceExpander). If you use the flag throwAllExpansionExceptions set to false, you can retrieve all the exceptions using getExceptions()

Specified by:
expand in interface Expander
Parameters:
bibtexFile -
Throws:
ExpansionException


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