de.hpi.fgis.dude.util.bibtex.data
Class BibtexMacroDefinition

java.lang.Object
  extended by de.hpi.fgis.dude.util.bibtex.data.BibtexNode
      extended by de.hpi.fgis.dude.util.bibtex.data.BibtexAbstractEntry
          extended by de.hpi.fgis.dude.util.bibtex.data.BibtexMacroDefinition

public class BibtexMacroDefinition
extends BibtexAbstractEntry

BibTex let's you define macros which are essentially just shortcuts for strings. Macros can reference other macros, as long as there's no cycle. Examples:

Author:
henkel

Constructor Summary
protected BibtexMacroDefinition(BibtexFile file, String key, BibtexAbstractValue value)
          Instantiates a new BibtexMacroDefinition.
 
Method Summary
 String getKey()
          Returns the key of the macro definition.
 BibtexAbstractValue getValue()
          Returns the value of the macro definition.
 void printBibtex(PrintWriter writer)
          Prints the node to the passed PrintWriter.
 void setKey(String key)
          Sets the key.
 void setValue(BibtexAbstractValue value)
          Sets the value.
 
Methods inherited from class de.hpi.fgis.dude.util.bibtex.data.BibtexNode
getOwnerFile, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BibtexMacroDefinition

protected BibtexMacroDefinition(BibtexFile file,
                                String key,
                                BibtexAbstractValue value)
Instantiates a new BibtexMacroDefinition.

Parameters:
file - The file that contains this macro definition.
key - The key of the macro definition.
value - the value of the macro definition.
Method Detail

getKey

public String getKey()
Returns the key of the macro definition.

Returns:
The key of the macro definition or null if it is not set.

getValue

public BibtexAbstractValue getValue()
Returns the value of the macro definition.

Returns:
The value of the macro definition or null if it is not set.

setKey

public void setKey(String key)
Sets the key.

Parameters:
key - The key to set.

setValue

public void setValue(BibtexAbstractValue value)
Sets the value.

Parameters:
value - The value to set.

printBibtex

public void printBibtex(PrintWriter writer)
Description copied from class: BibtexNode
Prints the node to the passed PrintWriter. This method needs to be implemented by each sub-class.

Specified by:
printBibtex in class BibtexNode
Parameters:
writer - The writer that shall be used for writing the String representation of this node.


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