|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.hpi.fgis.dude.util.bibtex.data.BibtexNode
public abstract class BibtexNode
An abstract superclass for all BibTex
model nodes.
Constructor Summary | |
---|---|
protected |
BibtexNode(BibtexFile bibtexFile)
Some people have asked why this constructor has a parameter of type BibtexFile (which in turn extends
BibtexNode ). |
Method Summary | |
---|---|
BibtexFile |
getOwnerFile()
Returns the owner file of this node. |
abstract void |
printBibtex(PrintWriter writer)
Prints the node to the passed PrintWriter . |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
protected BibtexNode(BibtexFile bibtexFile)
BibtexFile
(which in turn extends
BibtexNode
). The reason is that each BibtexNode has a reference to the BibtexFile
which
it belongs to. Of course, for the file itself that pointer is null.
By the way, it's unlikely that you need to call this constructor or any constructor for BibtexNodes
other than BibtexFile
directly - instead, use the BibtexFile
as a factory.
For example, to create a BibTex
file equivalent of this
================ @article{test1, author="Johannes Henkel", title="README" } ================ you'd do BibtexFile bibtexFile = new BibtexFile(); BibtexEntry onlyEntry = bibtexFile.makeEntry("article","test1"); onlyEntry.setField("author",bibtexFile.makeString("Johannes Henkel")); onlyEntry.setField("title",bibtexFile.makeString("README"));
bibtexFile
- Method Detail |
---|
public BibtexFile getOwnerFile()
null
if it is not set.public abstract void printBibtex(PrintWriter writer)
PrintWriter
. This method needs to be implemented by each sub-class.
writer
- The writer that shall be used for writing the String representation of this node.public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |