nz.ac.waikato.mcennis.rat.parser
Class AbstractParser

java.lang.Object
  extended by nz.ac.waikato.mcennis.rat.parser.AbstractParser
All Implemented Interfaces:
Parser
Direct Known Subclasses:
BaseHTMLParser, ISMIRBibtexParser, LastFmBasicArtistParser, LinkTest, NullParser, ToFileParser, XMLParser

public abstract class AbstractParser
extends java.lang.Object
implements Parser


Constructor Summary
AbstractParser()
           
 
Method Summary
 boolean check(Parameter parameter)
           
 boolean check(Properties parameters)
           
abstract  Parser duplicate()
          Create an exact copy of this object
abstract  ParsedObject get()
          Get the object created by this parser
 java.lang.String getName()
           
 Properties getParameter()
           
 Parameter getParameter(java.lang.String parameter)
           
 void init(Properties parameters)
           
abstract  void parse(java.io.InputStream data, Crawler crawler, Properties site)
          Parse an input stream into its components, spidering using the given crawler
abstract  void parse(java.io.InputStream data, Properties site)
          Parse an input stream into its components
abstract  void set(ParsedObject o)
          Set the parsed object to be loaded
 void setName(java.lang.String name)
          Give this parser an id that should be globally unique
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractParser

public AbstractParser()
Method Detail

setName

public void setName(java.lang.String name)
Description copied from interface: Parser
Give this parser an id that should be globally unique

Specified by:
setName in interface Parser
Parameters:
name - id for this parser

getName

public java.lang.String getName()
Specified by:
getName in interface Parser

init

public void init(Properties parameters)
Specified by:
init in interface Parser

getParameter

public Properties getParameter()
Specified by:
getParameter in interface Parser

getParameter

public Parameter getParameter(java.lang.String parameter)
Specified by:
getParameter in interface Parser

check

public boolean check(Properties parameters)
Specified by:
check in interface Parser

check

public boolean check(Parameter parameter)
Specified by:
check in interface Parser

parse

public abstract void parse(java.io.InputStream data,
                           Properties site)
                    throws java.lang.Exception
Description copied from interface: Parser
Parse an input stream into its components

Specified by:
parse in interface Parser
Parameters:
data - data stream to be read
Throws:
java.lang.Exception

parse

public abstract void parse(java.io.InputStream data,
                           Crawler crawler,
                           Properties site)
                    throws java.lang.Exception
Description copied from interface: Parser
Parse an input stream into its components, spidering using the given crawler

Specified by:
parse in interface Parser
Throws:
java.lang.Exception

duplicate

public abstract Parser duplicate()
Description copied from interface: Parser
Create an exact copy of this object

Specified by:
duplicate in interface Parser
Returns:
new Parser object

get

public abstract ParsedObject get()
Description copied from interface: Parser
Get the object created by this parser

Specified by:
get in interface Parser
Returns:
parsed object

set

public abstract void set(ParsedObject o)
Description copied from interface: Parser
Set the parsed object to be loaded

Specified by:
set in interface Parser
Parameters:
o - object to be loaded

Get Relational Analysis Toolkit at SourceForge.net. Fast, secure and Free Open Source software downloads