pulse - the web application framework Get pulse at SourceForge.net. Fast, secure and Free Open Source software downloads Ohloh project report for pulse-java

org.torweg.pulse.component.statistics.model
Class RegexVersion

java.lang.Object
  extended by org.torweg.pulse.util.entity.AbstractBasicEntity
      extended by org.torweg.pulse.util.entity.AbstractNamedEntity
          extended by org.torweg.pulse.component.statistics.model.AbstractVersion<java.lang.String>
              extended by org.torweg.pulse.component.statistics.model.RegexVersion
All Implemented Interfaces:
java.io.Serializable, INamed

@Entity
public class RegexVersion
extends AbstractVersion<java.lang.String>

Represents a Version.

Version:
$Revision: 1548 $
Author:
Daniel Dietz
See Also:
Serialized Form

Constructor Summary
protected RegexVersion()
          Deprecated. 
  RegexVersion(java.lang.String n, java.lang.String reg)
          Creates a new Version with the given display-name. and the given regular expression.
 
Method Summary
 java.lang.String getRegex()
          Returns the regular expression.
 boolean isMatch(java.lang.String userAgentString)
          Tests if the given string matches the underlying regular expression.
 void setRegex(java.lang.String reg)
          Sets the regular expression.
 java.lang.String toString()
          Returns a string representation of the Version.
 
Methods inherited from class org.torweg.pulse.component.statistics.model.AbstractVersion
setName
 
Methods inherited from class org.torweg.pulse.util.entity.AbstractNamedEntity
getName
 
Methods inherited from class org.torweg.pulse.util.entity.AbstractBasicEntity
compareTo, equals, getFullQualifiedClassNameJAXB, getId, hashCode
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RegexVersion

@Deprecated
protected RegexVersion()
Deprecated. 

Default constructor.


RegexVersion

public RegexVersion(java.lang.String n,
                    java.lang.String reg)
Creates a new Version with the given display-name. and the given regular expression.

Parameters:
n - the name
reg - the regular expression
Throws:
java.lang.IllegalArgumentException -
  • if the given name is null or empty string
  • if the given regular expression is null or empty string
Method Detail

getRegex

public final java.lang.String getRegex()
Returns the regular expression.

Returns:
the regex

setRegex

public final void setRegex(java.lang.String reg)
Sets the regular expression.

Parameters:
reg - the regular expression
Throws:
java.lang.IllegalArgumentException - if the given regular expression is null or empty string

isMatch

public final boolean isMatch(java.lang.String userAgentString)
Tests if the given string matches the underlying regular expression.

Specified by:
isMatch in class AbstractVersion<java.lang.String>
Parameters:
userAgentString - the string to test
Returns:
true if and only if the given string matches, false otherwise

toString

public final java.lang.String toString()
Returns a string representation of the Version.

Overrides:
toString in class AbstractVersion<java.lang.String>
Returns:
a string representation of the Version