net.sf.jeters.components
Class RegExReplacer_User

java.lang.Object
  extended by net.sf.jeters.util.AssistedComponent
      extended by net.sf.jeters.components.RegExReplacer
          extended by net.sf.jeters.components.RegExReplacer_User
All Implemented Interfaces:
Component, ReplacerComponent<net.sf.jeters.componentInterface.editables.EditableText,net.sf.jeters.componentInterface.editables.MediaWikiText>, Configurable, Translatable

public class RegExReplacer_User
extends RegExReplacer

an replacer class for JETERS that applies a regex expression the user directly enters.

Author:
Tobias Knerr

Nested Class Summary
 
Nested classes/interfaces inherited from class net.sf.jeters.components.RegExReplacer
RegExReplacer.CustomReplacement, RegExReplacer.DescriptionEntry, RegExReplacer.DescriptionList, RegExReplacer.RegExReplacement, RegExReplacer.Replacement, RegExReplacer.ReplacementElement, RegExReplacer.ReplacementGroup, RegExReplacer.Splitter
 
Field Summary
protected  java.lang.Boolean conf_askForRegexEveryTime
          whether the user will be asked again for a regex even if a replacement already exists.
protected  java.lang.Boolean conf_confirmChangesByDefault
          whether change-confirmation-requests will be sent to the user interface by default.
protected  java.lang.String conf_defaultSummary
          the default summary for user-defined edits.
protected  java.lang.Boolean conf_splitToLines
          whether the text will be split at newlines
 
Fields inherited from class net.sf.jeters.components.RegExReplacer
conf_debug, conf_minRatingDescription, conf_minRatingSummary, conf_minTotalRatingDescription, conf_minTotalRatingSummary, conf_summaryEntryLimit, conf_summaryEntryLimitBrackets, confirmationDescriptionList, replacements, splitter, summaryDescriptionList
 
Constructor Summary
RegExReplacer_User()
           
 
Method Summary
 net.sf.jeters.componentInterface.editables.MediaWikiText[] edit(net.sf.jeters.componentInterface.editables.EditableText text, UIComponent uiForRequests)
          applies the regular expressions to a text.
 Configuration getConfiguration()
          this method is called to retrieve the current configuration for this component.
 void setConfiguration(Configuration configuration)
          sets the configuration for this object.
 
Methods inherited from class net.sf.jeters.components.RegExReplacer
applyReplacementGroup, applyReplacementList, applySingleReplacement
 
Methods inherited from class net.sf.jeters.util.AssistedComponent
setLanguageResourceBundle, str, str
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

conf_defaultSummary

protected java.lang.String conf_defaultSummary
the default summary for user-defined edits.


conf_confirmChangesByDefault

protected java.lang.Boolean conf_confirmChangesByDefault
whether change-confirmation-requests will be sent to the user interface by default.


conf_askForRegexEveryTime

protected java.lang.Boolean conf_askForRegexEveryTime
whether the user will be asked again for a regex even if a replacement already exists. If false, it won't be possible to change the regex without restarting JETERS.


conf_splitToLines

protected java.lang.Boolean conf_splitToLines
whether the text will be split at newlines

Constructor Detail

RegExReplacer_User

public RegExReplacer_User()
Method Detail

edit

public net.sf.jeters.componentInterface.editables.MediaWikiText[] edit(net.sf.jeters.componentInterface.editables.EditableText text,
                                                                       UIComponent uiForRequests)
Description copied from class: RegExReplacer
applies the regular expressions to a text.

Specified by:
edit in interface ReplacerComponent<net.sf.jeters.componentInterface.editables.EditableText,net.sf.jeters.componentInterface.editables.MediaWikiText>
Overrides:
edit in class RegExReplacer
Parameters:
text - the input text that is supposed to be edited
uiForRequests - UI-component for communication with the user.
Returns:
array of size 1 with the text resulting from the edit, together with information for MediaWiki. Most importantly, it contains a description of the edit by listing the descriptions (the order is determined by the ratings).

setConfiguration

public void setConfiguration(Configuration configuration)
Description copied from interface: Configurable
sets the configuration for this object. The referenced configuration will not change after being passed to configurationSet. However, it is possible that setConfiguration is called again. This will not happen during execution of other component methods. Any config passed to setConfiguration is guaranteed to include at least those configuration entries that were included in a previous getConfiguration result, thus you needn't check for missing entries. The object must not rely on this method being called. Instead, it then has to work with a default configuration.

Specified by:
setConfiguration in interface Configurable
Overrides:
setConfiguration in class AssistedComponent
Parameters:
configuration - configuration to be used by the component; not null

getConfiguration

public Configuration 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 storing changes made during component usage to the configuration file. If it is called before setConfiguration, a default configuration for this component is expected to be returned (which is used, among other things, for creating the initial config file).

Specified by:
getConfiguration in interface Configurable
Overrides:
getConfiguration in class AssistedComponent
Returns:
configuration currently used by the component; not null