ERXRestKey Class Reference

Collaboration diagram for ERXRestKey:

Collaboration graph
[legend]

List of all members.

Public Member Functions

ERXRestContext context ()
EOEntity entity ()
 ERXRestKey (ERXRestContext context, EOEntity entity, String keyAlias, Object value) throws ERXRestException
 ERXRestKey (ERXRestContext context, EOEntity entity, String keyAlias) throws ERXRestException
ERXRestKey extend (String key) throws ERXRestException
ERXRestKey extend (String key, Object value) throws ERXRestException
ERXRestKey firstKey ()
boolean isKeyAll ()
boolean isKeyGID ()
String key ()
String keyAlias ()
ERXRestKey lastKey ()
EOEntity nextEntity () throws ERXRestException
ERXRestKey nextKey ()
String path (boolean skipGID)
ERXRestKey previousKey ()
String toString ()
ERXRestKey trimPrevious () throws ERXRestException, ERXRestSecurityException, ERXRestNotFoundException
Object value () throws ERXRestException, ERXRestSecurityException, ERXRestNotFoundException

Static Public Member Functions

static ERXRestKey parse (ERXRestContext context, String path) throws ERXRestException, ERXRestNotFoundException
static ERXRestKey parse (ERXRestContext context, ERXRestRequestNode node, String path) throws ERXRestException, ERXRestNotFoundException

Protected Member Functions

void _extend (ERXRestKey nextKey, boolean clone) throws ERXRestException
ERXRestKey _extendWithoutClone (String key) throws ERXRestException
Object _value (boolean checkToOnePermissions) throws ERXRestException, ERXRestSecurityException, ERXRestNotFoundException
void appendKey (StringBuffer pathBuffer, boolean skipGID)
ERXRestKey cloneKey (boolean clonePrevious, boolean cloneNext) throws ERXRestException
ERXRestKey cloneKeyWithNewEntity (EOEntity entity, boolean clonePrevious, boolean cloneNext) throws ERXRestException
 ERXRestKey ()

Private Attributes

ERXRestContext _context
EOEntity _entity
String _key
String _keyAlias
EOEntity _nextEntity
ERXRestKey _nextKey
ERXRestKey _previousKey
Object _value
boolean _valueFetched


Detailed Description

ERXRestKey represents the keypath that was embodied in the request URL. This differs from a normal keypath in that it can contain object IDs. An ERXRestKey is basically a doubly-linked list of keypath entries.

Author:
mschrag

Constructor & Destructor Documentation

ERXRestKey (  )  [protected]

ERXRestKey ( ERXRestContext  context,
EOEntity  entity,
String  keyAlias 
) throws ERXRestException

Constructs an ERXRestKey.

Parameters:
context the context
entity the entity that this key is in
keyAlias the alias of the key
Exceptions:
ERXRestException 

ERXRestKey ( ERXRestContext  context,
EOEntity  entity,
String  keyAlias,
Object  value 
) throws ERXRestException

Constructs an ERXRestKey.

Parameters:
context the context
entity the entity that this key is in
keyAlias the alias of the key
value the cached value of the key at this point in the path
Exceptions:
ERXRestException 


Member Function Documentation

void _extend ( ERXRestKey  nextKey,
boolean  clone 
) throws ERXRestException [protected]

Extends this key to the next key (optionally cloning).

Parameters:
nextKey the next key
clone if true, clone ourselves
Exceptions:
ERXRestException if a general failure occurs

ERXRestKey _extendWithoutClone ( String  key  )  throws ERXRestException [protected]

Extends this key "in-place" to the next key in the path.

Parameters:
key the next key
Returns:
an extended key
Exceptions:
ERXRestException if a general failure occurs

Object _value ( boolean  checkToOnePermissions  )  throws ERXRestException, ERXRestSecurityException, ERXRestNotFoundException [protected]

Returns (possibly fetching) the destination value of this key. This can be an expensive call, but it will cache its results.

Parameters:
checkToOnePermissions if false, this will not check permissions on a to-one call (this is necessary under certain circumstances to provide a more appropriate error messaga).
Returns:
the destination value of this key
Exceptions:
ERXRestException if a general error occurs
ERXRestSecurityException if fetching the value triggers a security violation
ERXRestNotFoundException if the referenced value does not exist

void appendKey ( StringBuffer  pathBuffer,
boolean  skipGID 
) [protected]

Appends this key to the given keypath buffer.

Parameters:
pathBuffer the current key path buffer
skipGID if true, global ids will be skipped in the generated path

ERXRestKey cloneKey ( boolean  clonePrevious,
boolean  cloneNext 
) throws ERXRestException [protected]

Returns a clone of this key, optionally also cloning back up the keypath. If you choose not to clone the previous key, it will not have a previous key.

Parameters:
clonePrevious if true, the previous key is also cloned
cloneNext if true, the next key is also cloned
Returns:
the cloned key
Exceptions:
ERXRestException if a general exception occurs

ERXRestKey cloneKeyWithNewEntity ( EOEntity  entity,
boolean  clonePrevious,
boolean  cloneNext 
) throws ERXRestException [protected]

Returns a clone of this key, optionally also cloning back up the keypath. If you choose not to clone the previous key, it will not have a previous key.

Parameters:
entity the new entity to clone with (typically a superentity)
clonePrevious if true, the previous key is also cloned
Returns:
the cloned key
Exceptions:
ERXRestException if a general exception occurs

ERXRestContext context (  ) 

Returns the rest context that was used to create this key.

Returns:
the rest context that was used to create this key

EOEntity entity (  ) 

Returns the entity that contains this key. Note that this is the containing entity NOT the destination entity of the key.

Returns:
the entity

ERXRestKey extend ( String  key  )  throws ERXRestException

Clones and extends this key to the next key in a path.

Parameters:
key the next key
Returns:
a cloned and extended key
Exceptions:
ERXRestException if a general failure occurs

ERXRestKey extend ( String  key,
Object  value 
) throws ERXRestException

Clones and extends this key to the next key in a path with the given cached value.

Parameters:
key the next key
value the current cached value
Returns:
a cloned and extended key
Exceptions:
ERXRestException if a general failure occurs

ERXRestKey firstKey (  ) 

Returns the first key in this path (can be this).

Returns:
the first key in this path (can be this)

boolean isKeyAll (  ) 

Returns whether or not this key requests a query against all the values of an Entity (/Site.xml = all Sites).

Returns:
whether or not this key requests a query against all the values of an Entity

boolean isKeyGID (  ) 

Returns whether or not this key requests a primary key. Right now, only integer primary keys are supported.

Returns:
whether or not this key requests a primary key

String key (  ) 

Returns the actual key property name for this key.

Returns:
the actual key property name for this key

String keyAlias (  ) 

Returns the key alias property name for this key.

Returns:
the key alias property name for this key

ERXRestKey lastKey (  ) 

Returns the last key in this path (can be this).

Returns:
the last key in this path (can be this)

EOEntity nextEntity (  )  throws ERXRestException

Returns the next entity in this key path (i.e. the destination entity). This can be null.

Returns:
the next entity in this key path (i.e. the destination entity). This can be null.
Exceptions:
ERXRestException if a general error occurs

ERXRestKey nextKey (  ) 

Returns the next key in this path (can be null).

Returns:
the next key in this path (can be null)

static ERXRestKey parse ( ERXRestContext  context,
String  path 
) throws ERXRestException, ERXRestNotFoundException [static]

Parse the given URL path and return an ERXRestKey that represents it.

Parameters:
context the rest context
path the path to parse
Returns:
the corresponding ERXRestKey
Exceptions:
ERXRestException if a general exception occurs
ERXRestNotFoundException if an object can not be found in the path

static ERXRestKey parse ( ERXRestContext  context,
ERXRestRequestNode  node,
String  path 
) throws ERXRestException, ERXRestNotFoundException [static]

String path ( boolean  skipGID  ) 

Returns the key path from this key to the end of the path.

Parameters:
skipGID if true, global ids will be skipped in the generated path
Returns:
the key path from this key to the end of the path

ERXRestKey previousKey (  ) 

Returns the previous key in the path (or null if this is the first key).

Returns:
the previous key in the path (or null if this is the first key)

String toString (  ) 

Returns a new ERXRestKey with the previous key path removed, so it appears that this key is the start of the path. This method will have to resolve the value of this key.

Returns:
a key path starting at this key
Exceptions:
ERXRestException if a general exception occurs
ERXRestSecurityException if a security error occurs
ERXRestNotFoundException if an object is not found in the kaypath

Returns (possibly fetching) the destination value of this key. This can be an expensive call, but it will cache its results.

Returns:
the destination value of this key
Exceptions:
ERXRestException if a general error occurs
ERXRestSecurityException if fetching the value triggers a security violation
ERXRestNotFoundException if the referenced value does not exist


Member Data Documentation

EOEntity _entity [private]

String _key [private]

String _keyAlias [private]

EOEntity _nextEntity [private]

ERXRestKey _nextKey [private]

Object _value [private]

boolean _valueFetched [private]


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

Generated on Sat May 26 06:43:28 2012 for Project Wonder by  doxygen 1.5.8