de.scheisseichfindemalkeinen.rules
Class RuleRegExp

java.lang.Object
  extended by de.scheisseichfindemalkeinen.rules.RuleRegExp

public class RuleRegExp
extends java.lang.Object

Search and Replace by Regexp


Constructor Summary
RuleRegExp()
          Constructor
RuleRegExp(org.jdom.Element e)
          Constructor
 
Method Summary
 java.lang.String doReplaceModeOne(java.lang.String htmlcode, int start, java.lang.String url, Pic pic)
          Replace-Method for mode 1 Returns an empty String if the pattern was not found
 java.lang.String doReplaceModeZero(java.lang.String url, Pic pic)
          Replace-Method for mode 0
 int doSearchModeOne(java.lang.String htmlcode, int start)
          Search-Method for mode 1 Returns the start-position when found the pattern Returns -1 if not found the pattern or an error occured
 int getRegexFlags()
          Returns the regexFlags
 java.lang.String getReplace()
          Returns the Replace-String
 java.lang.String getSearch()
          Returns the Search-String
 boolean getStatusOK()
          Returns if the status of the object is ok
 org.jdom.Element getXmlElement()
          Returns the Element for creating the XML-File
 void setRegexFlags(int regexFlags)
          Sets the regexFlags If the a PatternSyntaxException occurs no flags are set!
 void setReplace(java.lang.String replace)
          Sets the Replace-String
 void setSearch(java.lang.String search)
          Sets the Search-String and try to compile the Pattern
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RuleRegExp

public RuleRegExp()
Constructor


RuleRegExp

public RuleRegExp(org.jdom.Element e)
Constructor

Parameters:
e - Element
Method Detail

getStatusOK

public boolean getStatusOK()
Returns if the status of the object is ok

Returns:
True if ok

doReplaceModeZero

public java.lang.String doReplaceModeZero(java.lang.String url,
                                          Pic pic)
Replace-Method for mode 0

Parameters:
url - Container-URL
pic - Pic
Returns:
URL

doSearchModeOne

public int doSearchModeOne(java.lang.String htmlcode,
                           int start)
Search-Method for mode 1 Returns the start-position when found the pattern Returns -1 if not found the pattern or an error occured

Parameters:
htmlcode - Sourcecode
start - Startposition
Returns:
Found position

doReplaceModeOne

public java.lang.String doReplaceModeOne(java.lang.String htmlcode,
                                         int start,
                                         java.lang.String url,
                                         Pic pic)
Replace-Method for mode 1 Returns an empty String if the pattern was not found

Parameters:
htmlcode - Sourcecode
start - Startposition
url - Container-URL
pic - Pic
Returns:
URL

getXmlElement

public org.jdom.Element getXmlElement()
Returns the Element for creating the XML-File

Returns:
Element

getSearch

public java.lang.String getSearch()
Returns the Search-String

Returns:
Search-String

setSearch

public void setSearch(java.lang.String search)
               throws java.util.regex.PatternSyntaxException
Sets the Search-String and try to compile the Pattern

Parameters:
search - Search-String
Throws:
java.util.regex.PatternSyntaxException

getReplace

public java.lang.String getReplace()
Returns the Replace-String

Returns:
Replace-String

setReplace

public void setReplace(java.lang.String replace)
Sets the Replace-String

Parameters:
replace - Replace-String

getRegexFlags

public int getRegexFlags()
Returns the regexFlags

Returns:
regexFlags

setRegexFlags

public void setRegexFlags(int regexFlags)
Sets the regexFlags If the a PatternSyntaxException occurs no flags are set!

Parameters:
regexFlags - regexFlags