GSVModel Class Reference

Inherits com::webobjects::appserver::xml::WOXMLCoding.

Collaboration diagram for GSVModel:

Collaboration graph
[legend]

List of all members.

Public Member Functions

void addEntity (GSVEntity newEntity) throws IllegalArgumentException
Class classForCoder ()
void encodeWithWOXMLCoder (WOXMLCoder coder)
NSArray entities ()
GSVEntity entityForObject (Object object)
GSVEntity entityNamed (String name)
NSArray entityNames ()
EOModelGroup eomodelGroup ()
String eomodelName ()
String eomodelPath ()
 GSVModel (WOXMLDecoder decoder)
 GSVModel (String path) throws IllegalArgumentException
void init (EOModel eomodel)
void removeEntity (GSVEntity oldEntity)
boolean saveModel ()
void savePath (String s)
void setEomodelPath (String path)
boolean validateEOModelForPath (String path)

Static Public Attributes

static final String MODEL_EXTENSION = "model"
static final String MODEL_NAME = "Validity"

Private Attributes

NSMutableArray _entities = null
EOModelGroup _eomodelGroup = null
String _eomodelName = null
String _eomodelPath = null
boolean inited = false


Detailed Description

GSVModel used for the mapping validation rules to an entities' attributes.
The structure is very similar to Apple's EOModel.

Author:
GammaStream Technologies, Inc.

Constructor & Destructor Documentation

GSVModel ( String  path  )  throws IllegalArgumentException

Creates a new GSVModel using the path to an '.eomodeld' file.

Example of creating a GSVModel for the Movies example which ships with WebObjects.

<blockquote> EOModel eoModel = EOModelGroup.defaultGroup().modelNamed("Moview");
GSVModel model = new GSVModel(eoModel.path());
</blockquote>

Parameters:
path Path to an '.eomodeld' file.
Exceptions:
java.lang.IllegalArgumentException Thrown if valid '.eomodeld' file does not exist at the specified path.

GSVModel ( WOXMLDecoder  decoder  ) 

WOXMLCoding Impl

Parameters:
decoder WOXMLDecoder
See also:
encodeWithWOXMLCoder


Member Function Documentation

void addEntity ( GSVEntity  newEntity  )  throws IllegalArgumentException

Adds a GSVEntity object to this GSVModel. The GSVEntity must not already exsit.
If it does, IllegalArgumentException is thrown.

Parameters:
newEntity GSVEntity object
Exceptions:
java.lang.IllegalArgumentException GSVEnitity already exsits.
See also:
entities

removeEntity

Class classForCoder (  ) 

WOXMLCoding Impl

void encodeWithWOXMLCoder ( WOXMLCoder  coder  ) 

WOXMLCoding Impl

Parameters:
coder WOXMLCoder
See also:
GSVModel

NSArray entities (  ) 

Returns the NSArray of GSVEntity Objects.

Returns:
NSArray of GSVEntity Objects.
See also:
addEntity

removeEntity

GSVEntity entityForObject ( Object  object  ) 

Returns the GSVEntity object associated with the provided EOEnterpriseObject.

Parameters:
object EOEnterpriseObject
Returns:
GSVEntity if the EOEnterpriseObject has an GSVEntity Null if not.
See also:
entityNamed

GSVEntity entityNamed ( String  name  ) 

Returns the GSVEntity object for the provided entity name.

Parameters:
name name of entity
Returns:
GSVEntity if an GSVEntity is named name, null if it could not be found.
See also:
entityForObject

NSArray entityNames (  ) 

Returns an NSArray containing the GSVEntity names.

Returns:
NSArray names of GSVEntities.

EOModelGroup eomodelGroup (  ) 

Returns the EOModelGroup that is being used to query information from the EOModel.

Returns:
EOModelGroup for the EOModel.

String eomodelName (  ) 

Returns the EOModel Name for the associated GSVModel.

Returns:
Name of the EOModel

String eomodelPath (  ) 

Returns the path of the '.eomodeld' file.

Returns:
Path of the EOModel File.
See also:
setEomodelPath

void init ( EOModel  eomodel  ) 

void removeEntity ( GSVEntity  oldEntity  ) 

Removes a GSVEntity object from this GSVModel.

Parameters:
oldEntity GSVEntity object to remove.
See also:
entities

addEntity

boolean saveModel (  ) 

Saves the GSVModel to inside the '.eomodeld' file wrapper.

Returns:
true if save is successful; otherwise, returns false.

void savePath ( String  s  ) 

Internal method for saving paths

void setEomodelPath ( String  path  ) 

Set the path of the EOModel file.

Parameters:
path Path of the EOModel File.
See also:
eomodelPath

boolean validateEOModelForPath ( String  path  ) 

Determines that there is indeed a file located at the given path.

Returns:
true if an '.eomodeld' file is located at the given path; otherwise, we return false.
Parameters:
path Path to the desired '.eomodeld' file.


Member Data Documentation

EOModelGroup _eomodelGroup = null [private]

String _eomodelName = null [private]

String _eomodelPath = null [private]

boolean inited = false [private]

final String MODEL_EXTENSION = "model" [static]

The extension of the GSVModel file included in the '.eomodeld' wrapper.
Currently the full name is: 'Validity.model'

final String MODEL_NAME = "Validity" [static]

The name of the GSVModel file included in the '.eomodeld' wrapper.
Currently the full name is: 'Validity.model'


The documentation for this class was generated from the following file:

Generated on Sat May 26 06:42:30 2012 for Project Wonder by  doxygen 1.5.8