Bibi
19 Oct 2005 21:04

ujap.bibi
Class ParseAndEdit

java.lang.Object
  extended byujap.bibi.ParseAndEdit
Direct Known Subclasses:
PaeBibtexEntry, PaePubmedAuthors, PaePubmedEntry

public abstract class ParseAndEdit
extends Object

Parses a text, and if some ParseException happens, a text area is displayed to allow the user to correct the problem.
Overwrite the parse method to define what parser is to be used to handle the text.
Instantiate the class and pass the source of the text (a String or a File) to the constructor.

Author:
Ute Platzer

Field Summary
private  Object textSource
          a String or File that is to be parsed
 
Constructor Summary
protected ParseAndEdit(Object textSource)
           
 
Method Summary
(package private)  Reader convert(Object textSource)
          Convert the text source (File or String) to a Reader.
(package private) abstract  Object parse(Reader r)
          overwrite to call specific parser
 Object start()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

textSource

private Object textSource
a String or File that is to be parsed

Constructor Detail

ParseAndEdit

protected ParseAndEdit(Object textSource)
Parameters:
textSource - a File or a String.
Method Detail

start

public Object start()

convert

Reader convert(Object textSource)
Convert the text source (File or String) to a Reader. The Parser is expected to accept tokens from a Reader.


parse

abstract Object parse(Reader r)
               throws ParseException
overwrite to call specific parser

Throws:
ParseException

Bibi
19 Oct 2005 21:04

Copyright ? 2002-2005 Ute Platzer. All Rights Reserved.