|
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.erowid.sperowider.htmlshredding.AMongler org.erowid.sperowider.htmlshredding.PatternMatchingMongler
Uses pattern matching to perform mongling.
Constructor Summary | |
PatternMatchingMongler()
|
Method Summary | |
String |
getPattern()
Gets the pattern used to find URLs |
String |
getReplacementRegex()
Gets the replacement pattern to replace found URLs with. |
int |
getURLGroup()
Gets the number of the pattern group in the pattern set by setPattern(String)
that has the actual URL in it. |
boolean |
isUseReplacementPattern()
This returns true if the replacement pattern should be used to replace found URLs. |
String |
mongle(BufferedReader reader)
Looks for URLs using the passed in pattern. |
void |
setPattern(String pattern)
Sets the pattern used to find URLs. |
void |
setReplacementRegex(String regex)
Sets the replacement pattern to replace found URLs with. |
void |
setURLGroup(int group)
Sets the number of the pattern group in the pattern set by setPattern(String)
that has the actual URL in it. |
void |
setUseReplacementPattern(boolean useReplacementPattern)
Set this to true if the replacement pattern should be used to replace found URLs. |
abstract String |
urlFound(String url)
Extending classes should return the URL to replace the passed in URL, or null to indicate that it should be kept. |
Methods inherited from class org.erowid.sperowider.htmlshredding.AMongler |
mongle, mongle, mongle, mongle, mongle, mongle, mongle, mongle, mongle |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public PatternMatchingMongler()
Method Detail |
public abstract String urlFound(String url)
AMongler
urlFound
in class AMongler
public String mongle(BufferedReader reader) throws IOException
mongle
in class AMongler
IOException
public String getPattern()
public void setPattern(String pattern)
public int getURLGroup()
setPattern(String)
that has the actual URL in it.
The whole returned element would be 0, the first group (as marked by parens in
the regex) would be 1, etc.
For more discussion on this, see Pattern
.
public void setURLGroup(int group)
setPattern(String)
that has the actual URL in it. $0 is the whole returned element, $1 is the first
group (as marked by parens), and so on.
For more discussion on this, see Pattern
.
public String getReplacementRegex()
public void setReplacementRegex(String regex)
public boolean isUseReplacementPattern()
urlFound(String)
.
public void setUseReplacementPattern(boolean useReplacementPattern)
urlFound(String)
.
|
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |