|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjeters.components.RegExReplacer
public abstract class RegExReplacer
an abstract replacer class for JETERS based on regular expressions;
for using it, you only have to create an extended class setting the "replacements"-attribute.
Have a look at the existing subclasses!
Note: This class uses the classes from java.util.regex.*;
therefore, if you wonder about how regex strings have to be formatted,
read through the Java API's explanation for java.util.regex.Pattern.
Nested Class Summary | |
---|---|
protected static class |
RegExReplacer.DescriptionEntry
an internally used class containing the necessary information for description lists. |
protected static class |
RegExReplacer.DescriptionList
an internally used class representing a description list. |
static class |
RegExReplacer.Replacement
a class that represents a single regex-pair together with other necessary information for performing replacements |
static interface |
RegExReplacer.ReplacementElement
one element in a list of replacements. |
static class |
RegExReplacer.ReplacementGroup
a group of replacements. |
Field Summary | |
---|---|
protected java.lang.Integer |
conf_minRatingDescription
minimum single rating for a relevant description. |
protected java.lang.Integer |
conf_minRatingSummary
equivalent of conf_minRatingDescription for the final summary. |
protected java.lang.Integer |
conf_minTotalRatingDescription
minimum total rating for a relevant description. |
protected java.lang.Integer |
conf_minTotalRatingSummary
equivalent of conf_minTotalRatingDescription for the final summary. |
protected java.lang.Integer |
conf_summaryEntryLimit
maximum number of descriptions in the summary. |
protected java.lang.Integer |
conf_summaryEntryLimitBrackets
maximum number of descriptions in each bracket in the summary. |
protected RegExReplacer.DescriptionList |
confirmationDescriptionList
description list for the next confirmation request. |
protected java.util.ArrayList<RegExReplacer.ReplacementElement> |
replacements
the list of regex replacements that will be applied to the text. |
protected RegExReplacer.DescriptionList |
summaryDescriptionList
description list for the summary. |
Constructor Summary | |
---|---|
RegExReplacer()
parameterless constructor, creates an empty ArrayList of ReplacementElement for the "replacements"-attribute. |
Method Summary | |
---|---|
protected java.lang.String |
applyReplacementGroup(RegExReplacer.ReplacementGroup replacementGroup,
java.lang.String text,
RegExReplacer.DescriptionList descriptionList)
applies a group of replacements on a given string and returns the result. |
protected java.lang.String |
applyReplacementList(java.util.ArrayList<RegExReplacer.ReplacementElement> replacementList,
java.lang.String text,
RegExReplacer.DescriptionList descriptionList)
applies a list of replacements on a given string and returns the result. |
protected java.lang.String |
applySingleReplacement(RegExReplacer.Replacement replacement,
java.lang.String text,
RegExReplacer.DescriptionList descriptionList)
applies a single replacement on a given string and returns the result. |
MediaWikiText |
edit(EditableText text,
UIComponent uiForRequests)
applies the regular expressions to a text. |
NamedDataSet |
getConfiguration()
this method is called to retrieve the current configuration for this component. |
void |
setConfiguration(NamedDataSet configurationSet)
sets the configuration for this object. |
protected static java.lang.String[] |
split(java.lang.String text)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.util.ArrayList<RegExReplacer.ReplacementElement> replacements
protected java.lang.Integer conf_minRatingDescription
protected java.lang.Integer conf_minTotalRatingDescription
protected java.lang.Integer conf_minRatingSummary
protected java.lang.Integer conf_minTotalRatingSummary
protected java.lang.Integer conf_summaryEntryLimit
protected java.lang.Integer conf_summaryEntryLimitBrackets
protected RegExReplacer.DescriptionList confirmationDescriptionList
protected RegExReplacer.DescriptionList summaryDescriptionList
Constructor Detail |
---|
public RegExReplacer()
Method Detail |
---|
protected java.lang.String applySingleReplacement(RegExReplacer.Replacement replacement, java.lang.String text, RegExReplacer.DescriptionList descriptionList)
replacement
- the replacement that will be applied.text
- the string the replacements will be applied on.descriptionList
- the list for the description of the replacement.
protected java.lang.String applyReplacementGroup(RegExReplacer.ReplacementGroup replacementGroup, java.lang.String text, RegExReplacer.DescriptionList descriptionList)
replacementList
- the list of replacements that will be applied.text
- the string the replacements will be applied on.descriptionList
- the list for the descriptions of the replacements.
protected java.lang.String applyReplacementList(java.util.ArrayList<RegExReplacer.ReplacementElement> replacementList, java.lang.String text, RegExReplacer.DescriptionList descriptionList)
replacementList
- the list of replacements that will be applied.text
- the string the replacements will be applied on.descriptionList
- the list for the descriptions of the replacements.
public void setConfiguration(NamedDataSet configurationSet)
Configurable
setConfiguration
in interface Configurable
configurationSet
- the configuration data to be used by the component
if null, the object has to use default settingspublic NamedDataSet getConfiguration()
Configurable
getConfiguration
in interface Configurable
protected static java.lang.String[] split(java.lang.String text)
public MediaWikiText edit(EditableText text, UIComponent uiForRequests)
edit
in interface ReplacerComponent<EditableText,MediaWikiText>
uiForRequests
- UI-component for communication with the user.text
- the input text that is supposed to be edited
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |