Project Wonder 2.0

com.gammastream.validity
Class GSVAttribute

java.lang.Object
  extended bycom.gammastream.validity.GSVAttribute
All Implemented Interfaces:
WOXMLCoding

public final class GSVAttribute
extends Object
implements WOXMLCoding

This structure maps validation rules to a specific attribute of an entity. For instance, we might wish to map a 'Provided text is > 5 characters' to the 'username' attribute of the 'user' entity.

Author:
GammaStream Technologies, Inc.

Constructor Summary
GSVAttribute(GSVEntity anEntity, String aName)
          Creates a new GSVAttribute with the provided information.
GSVAttribute(WOXMLDecoder decoder)
          WOXMLCoding Impl
 
Method Summary
 void addRule(GSVRule newRule)
          Adds the rule to this attribute.
 Class classForCoder()
          WOXMLCoding Impl
 void encodeWithWOXMLCoder(WOXMLCoder coder)
          WOXMLCoding Impl
 GSVEntity entity()
          Returns the parent entity for this attribute.
 String name()
          Returns the name of this attribute.
 void removeRule(GSVRule oldRule)
          Remove the rule from this attribute.
 GSVRule ruleNamed(String name)
          Returns the rule with the provided name.
 NSArray rules()
          The list of rules assigned to this attribute.
 void setEntity(GSVEntity parentEntity)
          Sets the parent entity for this attribute to the provided entity.
 void setName(String newName)
          Sets the name of the attribute.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GSVAttribute

public GSVAttribute(GSVEntity anEntity,
                    String aName)
             throws IllegalArgumentException
Creates a new GSVAttribute with the provided information.

Parameters:
anEntity - The entity this attribute belongs to.
aName - The name of this attribute.
Throws:
IllegalArgumentException - Thrown if the selected EOModel does not contain an attribute of the specified name in the provided entity.

GSVAttribute

public GSVAttribute(WOXMLDecoder decoder)
WOXMLCoding Impl

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

name

public String name()
Returns the name of this attribute.

Returns:
The name of the attribute.
See Also:
setName(java.lang.String)

setName

public void setName(String newName)
Sets the name of the attribute.

Parameters:
newName - The new name for the attribute.
See Also:
name()

rules

public NSArray rules()
The list of rules assigned to this attribute.

Returns:
An NSArray of rules.
See Also:
removeRule(com.gammastream.validity.GSVRule), addRule(com.gammastream.validity.GSVRule)

addRule

public void addRule(GSVRule newRule)
Adds the rule to this attribute.

Parameters:
newRule - The rule to add.
See Also:
removeRule(com.gammastream.validity.GSVRule), rules()

removeRule

public void removeRule(GSVRule oldRule)
Remove the rule from this attribute.

Parameters:
oldRule - The rule to remove.
See Also:
addRule(com.gammastream.validity.GSVRule), rules()

ruleNamed

public GSVRule ruleNamed(String name)
Returns the rule with the provided name.

Parameters:
name - The name of the rule you wish to fetch.
Returns:
Returns the rule with the provided name or null if one was not found.

entity

public GSVEntity entity()
Returns the parent entity for this attribute.

See Also:
setEntity(com.gammastream.validity.GSVEntity)

setEntity

public void setEntity(GSVEntity parentEntity)
Sets the parent entity for this attribute to the provided entity.

Parameters:
parentEntity - The parent entity for this attribute.
See Also:
entity()

encodeWithWOXMLCoder

public void encodeWithWOXMLCoder(WOXMLCoder coder)
WOXMLCoding Impl

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

classForCoder

public Class classForCoder()
WOXMLCoding Impl

Specified by:
classForCoder in interface WOXMLCoding

Last updated: Do, Dez 9, 2004 • 12:46 PM CET

Copyright © 2002 – 2004 Project Wonder.