jeters.components
Class WikiIO

java.lang.Object
  extended by jeters.components.WikiIO
All Implemented Interfaces:
Component, Configurable, InputComponent<PlainText>, InputComponent_Series<PlainText>, OutputComponent<MediaWikiText>

public class WikiIO
extends java.lang.Object
implements InputComponent_Series<PlainText>, OutputComponent<MediaWikiText>, Configurable

default implementation of a combined input and output component reading from and writing to any MediaWiki system.
For output, an user account on the MediaWiki is necessary.


Constructor Summary
WikiIO()
          constructor creating the internal bot object.
 
Method Summary
 NamedDataSet getConfiguration()
          this method is called to retrieve the current configuration for this component.
 PlainText getInput(UIComponent uiForRequests)
          receive a text that can be edited by the program; the next call to getInput is expected to return another text if seriesComplete() returns false
 boolean hasNext()
          indicates if there are still texts left for editing
 void output(MediaWikiText text, UIComponent uiForRequests)
          receive a text that can be edited by the program
 void setConfiguration(NamedDataSet configurationSet)
          sets the configuration for this object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WikiIO

public WikiIO()
constructor creating the internal bot object.

Method Detail

getInput

public PlainText getInput(UIComponent uiForRequests)
Description copied from interface: InputComponent_Series
receive a text that can be edited by the program; the next call to getInput is expected to return another text if seriesComplete() returns false

Specified by:
getInput in interface InputComponent<PlainText>
Specified by:
getInput in interface InputComponent_Series<PlainText>
Parameters:
uiForRequests - UI-component for communication with the user (if necessary)
Returns:
the text for editing, is allowed to be null in cases where loading fails for some reason

output

public void output(MediaWikiText text,
                   UIComponent uiForRequests)
Description copied from interface: OutputComponent
receive a text that can be edited by the program

Specified by:
output in interface OutputComponent<MediaWikiText>
Parameters:
text - the text that has been edited and should now be printed/written/etc. as the result
uiForRequests - UI-component for communication with the user (if necessary)

setConfiguration

public void setConfiguration(NamedDataSet configurationSet)
Description copied from interface: Configurable
sets the configuration for this object. If setConfiguration is not called, the component must work properly nevertheless, using default settings.

Specified by:
setConfiguration in interface Configurable
Parameters:
configurationSet - the configuration data to be used by the component if null, the object has to use default settings

getConfiguration

public NamedDataSet getConfiguration()
Description copied from interface: Configurable
this method is called to retrieve the current configuration for this component. It will e.g. be used for generating the configuration file.

Specified by:
getConfiguration in interface Configurable
Returns:
configuration data, null is allowed (doesn't make much sense however)

hasNext

public boolean hasNext()
Description copied from interface: InputComponent_Series
indicates if there are still texts left for editing

Specified by:
hasNext in interface InputComponent_Series<PlainText>
Returns:
false if all texts which are part of the series have already been returned by getInput, otherwise true