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.accesscontrol.attributes
Class RegexStringCheck

java.lang.Object
  extended by org.torweg.pulse.accesscontrol.attributes.AbstractTypedCheck<java.lang.String>
      extended by org.torweg.pulse.accesscontrol.attributes.RegexStringCheck
All Implemented Interfaces:
java.io.Serializable, JDOMable

@Entity
public class RegexStringCheck
extends AbstractTypedCheck<java.lang.String>

tests a AbstractValue<String> against a regular expression.

Version:
$Revision: 1832 $
Author:
Thomas Weber, Daniel Dietz
See Also:
Serialized Form

Constructor Summary
protected RegexStringCheck()
          Deprecated. 
  RegexStringCheck(java.lang.String r)
          creates a new check with the given regular expression.
 
Method Summary
 AbstractTypedCheck<java.lang.String> checkFromCommand(Command c)
          returns the initialised check or null.
 org.jdom.Element deserializeToJDOM()
          returns a JDOM representation of the check.
 java.lang.String getRegex()
          returns the regular expression.
 boolean isValid(AbstractValue<?> value)
          returns whether the given value matches the regular expression of the check.
 AbstractTypedCheck<java.lang.String> setCheckFromCommand(Command c)
          sets the values for the check from a given Command and returns the check with the newly set check.
 void setRegex(java.lang.String r)
          sets the the regular expression.
 
Methods inherited from class org.torweg.pulse.accesscontrol.attributes.AbstractTypedCheck
getId
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RegexStringCheck

@Deprecated
protected RegexStringCheck()
Deprecated. 

used by HibernateTM.


RegexStringCheck

public RegexStringCheck(java.lang.String r)
creates a new check with the given regular expression.

Parameters:
r - the regular expression
Method Detail

getRegex

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

Returns:
the regular expression

setRegex

public final void setRegex(java.lang.String r)
sets the the regular expression.

Parameters:
r - the regular expression

checkFromCommand

public AbstractTypedCheck<java.lang.String> checkFromCommand(Command c)
returns the initialised check or null.

Specified by:
checkFromCommand in class AbstractTypedCheck<java.lang.String>
Parameters:
c - the command
Returns:
the initialised check or null
See Also:
AbstractTypedCheck.checkFromCommand(org.torweg.pulse.service.request.Command)

setCheckFromCommand

public AbstractTypedCheck<java.lang.String> setCheckFromCommand(Command c)
sets the values for the check from a given Command and returns the check with the newly set check.

Specified by:
setCheckFromCommand in class AbstractTypedCheck<java.lang.String>
Parameters:
c - the command
Returns:
the initialised check with the newly set check
See Also:
AbstractTypedCheck.setCheckFromCommand(org.torweg.pulse.service.request.Command)

isValid

public boolean isValid(AbstractValue<?> value)
returns whether the given value matches the regular expression of the check.

Specified by:
isValid in class AbstractTypedCheck<java.lang.String>
Parameters:
value - the value to check
Returns:
true, if and only if the entire value matches the regular expression
See Also:
AbstractTypedCheck.isValid(org.torweg.pulse.accesscontrol.attributes.AbstractValue)

deserializeToJDOM

public org.jdom.Element deserializeToJDOM()
returns a JDOM representation of the check.

Returns:
a JDOM representation of the check
See Also:
JDOMable.deserializeToJDOM()