Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.gammastream.validity
Class GSVRule  view GSVRule download GSVRule.java

java.lang.Object
  extended bycom.gammastream.validity.GSVRule

public final class GSVRule
extends java.lang.Object

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.


Field Summary
private  java.lang.String cName
           
private  boolean continueIfNULL
           
private  java.lang.String documentation
           
private  java.lang.String errorMessage
           
private  boolean failIfNULL
           
private  java.lang.String mName
           
private  boolean negate
           
private  boolean onDelete
           
private  boolean onInsert
           
private  boolean onSave
           
private  boolean onUpdate
           
private  NSMutableDictionary parameters
           
private  java.lang.String ruleName
           
private  boolean stopIfFails
           
 
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(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(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()
           
 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(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()
           
private  boolean validateClassName(java.lang.String cName)
          Private Determines whether the provided class name appears to be valid.
private  boolean validateMethodName(java.lang.String mName)
          Private Determines whether the provided method name appears to be valid.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ruleName

private java.lang.String ruleName

cName

private java.lang.String cName

mName

private java.lang.String mName

errorMessage

private java.lang.String errorMessage

documentation

private java.lang.String documentation

negate

private boolean negate

failIfNULL

private boolean failIfNULL

stopIfFails

private boolean stopIfFails

continueIfNULL

private boolean continueIfNULL

onSave

private boolean onSave

onInsert

private boolean onInsert

onDelete

private boolean onDelete

onUpdate

private boolean onUpdate

parameters

private NSMutableDictionary parameters
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.


GSVRule

public GSVRule(WOXMLDecoder decoder)
WOXMLCoding Impl

Method Detail

validateClassName

private boolean validateClassName(java.lang.String cName)
Private Determines whether the provided class name appears to be valid.


validateMethodName

private boolean validateMethodName(java.lang.String mName)
Private Determines whether the provided method name appears to be valid.


ruleName

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


setRuleName

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


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. :-)


setCName

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


mName

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


setMName

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


errorMessage

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


setErrorMessage

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


documentation

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


setDocumentation

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


parameters

public 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().


setParameters

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


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?


setNegate

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


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(WOXMLCoder coder)
WOXMLCoding Impl


classForCoder

public java.lang.Class classForCoder()
WOXMLCoding Impl