|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.jeters.util.AssistedComponent
net.sf.jeters.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 | |
---|---|
static class |
RegExReplacer.CustomReplacement
a class that represents a single replacement which is not based on regex, but on a custom method |
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.RegExReplacement
a class that represents a single regex-pair together with other necessary information for performing replacements |
static class |
RegExReplacer.Replacement
a single replacement |
static interface |
RegExReplacer.ReplacementElement
one element in a list of replacements. |
static class |
RegExReplacer.ReplacementGroup
a group of replacements. |
protected class |
RegExReplacer.Splitter
splitter-class, extending this can modify the splitting behavior. |
Field Summary | |
---|---|
protected java.lang.Boolean |
conf_debug
if true, debug information will be generated. |
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.Splitter |
splitter
the splitter class that will be used; not null. |
protected RegExReplacer.DescriptionList |
summaryDescriptionList
description list for the summary. |
Constructor Summary | |
---|---|
RegExReplacer()
parameterless constructor, creates an empty ArrayList of ReplacementElement for the "replacements"-attribute and a default Splitter. |
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. |
net.sf.jeters.componentInterface.editables.MediaWikiText[] |
edit(net.sf.jeters.componentInterface.editables.EditableText text,
UIComponent uiForRequests)
applies the regular expressions to a text. |
Methods inherited from class net.sf.jeters.util.AssistedComponent |
---|
getConfiguration, setConfiguration, setLanguageResourceBundle, str, str |
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.Boolean conf_debug
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
protected RegExReplacer.Splitter splitter
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)
replacementGroup
- the group 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 net.sf.jeters.componentInterface.editables.MediaWikiText[] edit(net.sf.jeters.componentInterface.editables.EditableText text, UIComponent uiForRequests)
edit
in interface ReplacerComponent<net.sf.jeters.componentInterface.editables.EditableText,net.sf.jeters.componentInterface.editables.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 |