org.varienaja.util.wikipedia
Class WikiContentHelper

java.lang.Object
  extended by org.varienaja.util.wikipedia.WikiContentHelper

public class WikiContentHelper
extends java.lang.Object

Helper class.

Author:
Varienaja

Constructor Summary
WikiContentHelper()
           
 
Method Summary
static java.lang.String removeComment(java.lang.String content)
          Removes html-comments from a String.
static java.lang.String removeImages(java.lang.String content)
          Removes image-refs from a String.
static java.lang.String removeLinks(java.lang.String input)
          Removes WikiLink-constructs from plaintext.
static java.lang.String removeRefs(java.lang.String content)
          Removes html from a String.
static java.lang.String sanitizeQuotes(java.lang.String content)
          Removes superfluous quotes in a String.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WikiContentHelper

public WikiContentHelper()
Method Detail

removeLinks

public static java.lang.String removeLinks(java.lang.String input)
Removes WikiLink-constructs from plaintext.

[[xx|yy]] --> yy
[[xx]] --> xx

Parameters:
input - The String
Returns:
The String with WikiLinks removed.

sanitizeQuotes

public static java.lang.String sanitizeQuotes(java.lang.String content)
Removes superfluous quotes in a String.

I talked about '''something''' cool --> I talked about 'something' cool

Parameters:
content - The String.
Returns:
The String without superfluous quotes.

removeRefs

public static java.lang.String removeRefs(java.lang.String content)
Removes html from a String.

lalala.<ref>[sjalala]</ref> lololo --> lalala. lololo

lalala.<a href>[sjalala]</a> lololo --> lalala. lololo

Parameters:
content - The String.
Returns:
The String without ref-constructs.

removeComment

public static java.lang.String removeComment(java.lang.String content)
Removes html-comments from a String.

Parameters:
content - The String.
Returns:
The String without comments.

removeImages

public static java.lang.String removeImages(java.lang.String content)
Removes image-refs from a String.

[[Image:JohannesBrahms.jpg|thumb|right|250px|Johannes Brahms]]

Parameters:
content - The String.
Returns:
The String without image-links.


Copyright © 2010 A.J.V.. All Rights Reserved.