org.stanwood.media.source.xbmc
Class XBMCExpression

java.lang.Object
  extended by org.stanwood.media.source.xbmc.XBMCExpression

public class XBMCExpression
extends java.lang.Object

This class is used to store details about a XBMC regular expression entry from the XML


Constructor Summary
XBMCExpression()
           
 
Method Summary
 boolean getClear()
          Used to find out if the dest field should be cleared when a expression fails
 boolean getNoClean(int field)
          Used to find out if a field should not be cleaned
 java.util.regex.Pattern getPattern()
          Used to get the pattern as a have REGEXP pattern
 boolean getRepeat()
          Used to work out if the expression should match until it does not match
 boolean getTrim(int field)
          Used to find out if a field should be trimmed.
 void setClear(boolean clear)
          If set to true, then if the expression fails the dest field is clear
 void setNoClean(java.lang.String value)
          By default HTML tags and special characters are stripped from the matches.
 void setPattern(java.util.regex.Pattern pattern)
          Used to set the REGEXP pattern of the expression
 void setRepeat(boolean repeat)
          Used to set if the expression should match until it does not match
 void setTrim(java.lang.String value)
          trim white spaces from the end of matches
 java.lang.String toString()
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

XBMCExpression

public XBMCExpression()
Method Detail

getPattern

public java.util.regex.Pattern getPattern()
Used to get the pattern as a have REGEXP pattern

Returns:
the pattern as a have REGEXP pattern

setPattern

public void setPattern(java.util.regex.Pattern pattern)
Used to set the REGEXP pattern of the expression

Parameters:
pattern - the REGEXP pattern of the expression

getNoClean

public boolean getNoClean(int field)
Used to find out if a field should not be cleaned

Parameters:
field - The field to check
Returns:
find out if a field should not be cleaned

getTrim

public boolean getTrim(int field)
Used to find out if a field should be trimmed.

Parameters:
field - The field to check
Returns:
True if whitespace should be trimmed from a field.

getClear

public boolean getClear()
Used to find out if the dest field should be cleared when a expression fails

Returns:
true if the dest field should be cleared when a expression fails

setClear

public void setClear(boolean clear)
If set to true, then if the expression fails the dest field is clear

Parameters:
clear - If set to true, then if the expression fails the dest field is clear

setNoClean

public void setNoClean(java.lang.String value)
By default HTML tags and special characters are stripped from the matches. By setting noclean to a comma separated list of field numbers, you can stop this behaviour.

Parameters:
value - A comma separated list of field numbers that should not be cleaned

setTrim

public void setTrim(java.lang.String value)
trim white spaces from the end of matches

Parameters:
value - A comma separated list of field numbers that should trimmed

getRepeat

public boolean getRepeat()
Used to work out if the expression should match until it does not match

Returns:
True to keep trying to match

setRepeat

public void setRepeat(boolean repeat)
Used to set if the expression should match until it does not match

Parameters:
repeat - True to keep matching

toString

public java.lang.String toString()

Overrides:
toString in class java.lang.Object