Project Wonder 5.0

com.gammastream.validity
Class GSVRule

java.lang.Object
  extended by com.gammastream.validity.GSVRule
All Implemented Interfaces:
com.webobjects.appserver.xml.WOXMLCoding

public final class GSVRule
extends java.lang.Object
implements com.webobjects.appserver.xml.WOXMLCoding

This structure stores the various information which defines each rule. Information like the name, where the rule is located, error messages, when to execute, etc.

Author:
GammaStream Technologies, Inc.

Constructor Summary
GSVRule(java.lang.String rName, java.lang.String cName2, java.lang.String mName2, java.lang.String eMessage, java.lang.String doc)
          Creates a new GSVRule with the provided parameters.
GSVRule(com.webobjects.appserver.xml.WOXMLDecoder decoder)
          WOXMLCoding Impl
 
Method Summary
 java.lang.Class classForCoder()
          WOXMLCoding Impl
 java.lang.String cName()
          Returns the fully qualified class name of the class in which the method used in this rule is located.
 boolean continueIfNULL()
           
 java.lang.String documentation()
          Returns the documentation for this rule.
 void encodeWithWOXMLCoder(com.webobjects.appserver.xml.WOXMLCoder coder)
          WOXMLCoding Impl
 java.lang.String errorMessage()
          Returns the error message that should be displayed to the user when this rule fails to be validated.
 boolean failIfNULL()
           
 java.lang.String mName()
          Returns the method name used for this rule.
 boolean negate()
          Should the outcome of this rule be negated (reversed).
 boolean onDelete()
           
 boolean onInsert()
           
 boolean onSave()
           
 boolean onUpdate()
           
 com.webobjects.foundation.NSMutableDictionary parameters()
          Returns a dictionary of key-value pairs used for providing parameters to the validation rule's method.
 java.lang.String ruleName()
          Returns the name of this rule.
 void setCName(java.lang.String newClass)
          Set the class name for this rule.
 void setContinueIfNULL(boolean z)
           
 void setDocumentation(java.lang.String doc)
          Set the documentation to the provided String.
 void setErrorMessage(java.lang.String newMessage)
          Set the error message.
 void setFailIfNULL(boolean z)
           
 void setMName(java.lang.String newMethod)
          Set the method name for this rule.
 void setNegate(boolean z)
          Assigns a key-value pair dictionary to this rule.
 void setOnDelete(boolean z)
           
 void setOnInsert(boolean z)
           
 void setOnSave(boolean z)
           
 void setOnUpdate(boolean z)
           
 void setParameters(com.webobjects.foundation.NSMutableDictionary newParameters)
          Assigns a key-value pair dictionary to this rule.
 void setRuleName(java.lang.String newRule)
          Sets the name of this rule.
 void setStopIfFails(boolean z)
           
 boolean stopIfFails()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GSVRule

public GSVRule(java.lang.String rName,
               java.lang.String cName2,
               java.lang.String mName2,
               java.lang.String eMessage,
               java.lang.String doc)
        throws java.lang.IllegalArgumentException
Creates a new GSVRule with the provided parameters.

Parameters:
rName - The name you wish to give the rule.
cName2 - The fully qualified class name in which the rule's method is located.
mName2 - The name of the method to be executed.
eMessage - An error message to provide the user in the event the rule fails.
doc - Optional documentation as to the rules function.
Throws:
java.lang.IllegalArgumentException - Thrown should the class name or method name appear to be invalid.

GSVRule

public GSVRule(com.webobjects.appserver.xml.WOXMLDecoder decoder)
WOXMLCoding Impl

Parameters:
decoder - WOXMLDecoder
See Also:
encodeWithWOXMLCoder(com.webobjects.appserver.xml.WOXMLCoder)
Method Detail

ruleName

public java.lang.String ruleName()
Returns the name of this rule.

Returns:
The name of the rule.
See Also:
setRuleName(java.lang.String)

setRuleName

public void setRuleName(java.lang.String newRule)
                 throws java.lang.IllegalArgumentException
Sets the name of this rule.

Throws:
java.lang.IllegalArgumentException
See Also:
ruleName

cName

public java.lang.String cName()
Returns the fully qualified class name of the class in which the method used in this rule is located. :-)

Returns:
The name of the rule.
See Also:
setCName(java.lang.String)

setCName

public void setCName(java.lang.String newClass)
              throws java.lang.IllegalArgumentException
Set the class name for this rule.

Parameters:
newClass - fully qualified name of the class.
Throws:
java.lang.IllegalArgumentException - Thrown should the class name appear to be invalid. Currently the validation logic here always returns true.
See Also:
cName

mName

public java.lang.String mName()
Returns the method name used for this rule.

Returns:
The method name.
See Also:
setMName(java.lang.String)

setMName

public void setMName(java.lang.String newMethod)
              throws java.lang.IllegalArgumentException
Set the method name for this rule.

Parameters:
newMethod - name for the method.
Throws:
java.lang.IllegalArgumentException - Thrown should the method name appear to be invalid. Currently the validation logic here always returns true.
See Also:
mName

errorMessage

public java.lang.String errorMessage()
Returns the error message that should be displayed to the user when this rule fails to be validated.

Returns:
The error message.
See Also:
setErrorMessage(java.lang.String)

setErrorMessage

public void setErrorMessage(java.lang.String newMessage)
Set the error message.

Parameters:
newMessage - the error message
See Also:
errorMessage

documentation

public java.lang.String documentation()
Returns the documentation for this rule.

Returns:
The documentation.
See Also:
setDocumentation(java.lang.String)

setDocumentation

public void setDocumentation(java.lang.String doc)
Set the documentation to the provided String.

Parameters:
doc - the documentation.
See Also:
documentation

parameters

public com.webobjects.foundation.NSMutableDictionary parameters()
Returns a dictionary of key-value pairs used for providing parameters to the validation rule's method. This parameter dictionary is passed to the method defined by mName().

Returns:
The key-values pairs.
See Also:
setParameters(com.webobjects.foundation.NSMutableDictionary)

setParameters

public void setParameters(com.webobjects.foundation.NSMutableDictionary newParameters)
Assigns a key-value pair dictionary to this rule.

Parameters:
newParameters - A dictionary of key-value pairs.
See Also:
parameters

negate

public boolean negate()
Should the outcome of this rule be negated (reversed). This might be useful if you have a method which returns true if you have a String which is empty or null. Your rule might indicate that you want this attribute to be required. If the method returns true if it is, you will want to reverse the outcome. Did that make any sense?

Returns:
Whether the initial return value should be negated (reversed).
See Also:
setNegate(boolean)

setNegate

public void setNegate(boolean z)
Assigns a key-value pair dictionary to this rule.

Parameters:
z - A dictionary of key-value pairs.
See Also:
parameters

failIfNULL

public boolean failIfNULL()

setFailIfNULL

public void setFailIfNULL(boolean z)

continueIfNULL

public boolean continueIfNULL()

setContinueIfNULL

public void setContinueIfNULL(boolean z)

stopIfFails

public boolean stopIfFails()

setStopIfFails

public void setStopIfFails(boolean z)

onSave

public boolean onSave()

setOnSave

public void setOnSave(boolean z)

onUpdate

public boolean onUpdate()

setOnUpdate

public void setOnUpdate(boolean z)

onInsert

public boolean onInsert()

setOnInsert

public void setOnInsert(boolean z)

onDelete

public boolean onDelete()

setOnDelete

public void setOnDelete(boolean z)

encodeWithWOXMLCoder

public void encodeWithWOXMLCoder(com.webobjects.appserver.xml.WOXMLCoder coder)
WOXMLCoding Impl

Specified by:
encodeWithWOXMLCoder in interface com.webobjects.appserver.xml.WOXMLCoding
Parameters:
coder - WOXMLCoder
See Also:
GSVRule(com.webobjects.appserver.xml.WOXMLDecoder)

classForCoder

public java.lang.Class classForCoder()
WOXMLCoding Impl

Specified by:
classForCoder in interface com.webobjects.appserver.xml.WOXMLCoding

Last updated: Tue, Feb 21, 2017 • 05:45 PM CET

Copyright © 2002 – 2007 Project Wonder.