Project Wonder 2.0

er.extensions
Class ERXPathDirectAction

java.lang.Object
  extended bycom.webobjects.appserver.WOAction
      extended bycom.webobjects.appserver.WODirectAction
          extended byer.extensions.ERXPathDirectAction
All Implemented Interfaces:
NSKeyValueCoding, NSKeyValueCoding.ErrorHandling, NSKeyValueCodingAdditions, NSValidation

public class ERXPathDirectAction
extends WODirectAction

Utility direct action class that provides a bunch of nice utility methods if the direct action is accessed via a path direct action. See for more information.


Nested Class Summary
 
Nested classes inherited from class com.webobjects.foundation.NSKeyValueCoding
NSKeyValueCoding._BooleanFieldBinding, NSKeyValueCoding._BooleanMethodBinding, NSKeyValueCoding._FieldBinding, NSKeyValueCoding._ForwardingBinding, NSKeyValueCoding._KeyBinding, NSKeyValueCoding._KeyBindingCreation, NSKeyValueCoding._MethodBinding, NSKeyValueCoding._NumberFieldBinding, NSKeyValueCoding._NumberMethodBinding, NSKeyValueCoding._ReflectionKeyBindingCreation, NSKeyValueCoding.DefaultImplementation, NSKeyValueCoding.ErrorHandling, NSKeyValueCoding.Null, NSKeyValueCoding.UnknownKeyException, NSKeyValueCoding.Utility, NSKeyValueCoding.ValueAccessor
 
Nested classes inherited from class com.webobjects.foundation.NSKeyValueCodingAdditions
NSKeyValueCodingAdditions.DefaultImplementation, NSKeyValueCodingAdditions.Utility
 
Nested classes inherited from class com.webobjects.foundation.NSValidation
NSValidation._MethodBinding, NSValidation._ValidationBinding, NSValidation.DefaultImplementation, NSValidation.Utility, NSValidation.ValidationException
 
Field Summary
protected static ERXLogger log
          logging support
protected  NSArray pathParts
          caches the path parts
protected  NSDictionary pathPartsByKeys
          caches the path parts by keys
protected  NSDictionary pathPartsByKeysCaseInsensitive
          caches the path parts by case insensitive keys
 
Fields inherited from class com.webobjects.appserver.WODirectAction
actionText
 
Fields inherited from class com.webobjects.appserver.WOAction
_actionClasses, _context
 
Fields inherited from interface com.webobjects.foundation.NSKeyValueCoding
_CLASS, NullValue
 
Fields inherited from interface com.webobjects.foundation.NSKeyValueCoding.ErrorHandling
_CLASS
 
Fields inherited from interface com.webobjects.foundation.NSKeyValueCodingAdditions
_CLASS, _KeyPathSeparatorChar, KeyPathSeparator
 
Fields inherited from interface com.webobjects.foundation.NSValidation
_CLASS
 
Constructor Summary
ERXPathDirectAction(WORequest aRequest)
          Just calls super.
 
Method Summary
 boolean hasPathPartForKey(String key)
          Determines if a path part exists for a given key.
 boolean hasPathPartForKey(String key, boolean caseInsensitive)
          Determines if a path part exists for a given key with the option of performing a case insensitve comparison.
 String pathPartForKey(String key)
          Gets a path part for a given key.
 String pathPartForKeyWithDefault(String key, String defaultValue)
          Gets a path part for a given key, returning the default value if nothing was specified.
 String pathPartForKeyWithDefault(String key, String defaultValue, boolean caseInsensitiveCompare)
          Gets a path part for a given key, returning the default value if nothing was specified.
 NSArray pathParts()
          The path parts of a request correspond to to all of the pieces between the request handler key and the class name.
 NSDictionary pathPartsByKeys()
          Given an array of path parts (foo=food, bar=baz, gee) this will produce a dictionary of the form: { foo=food; bar=baz; }.
 NSDictionary pathPartsByKeysCaseInsensitive()
          Same method as pathPartsByKeys except all of the keys have been down cased, ie for path parts (Foo=food, bAr=baz, gee) this will give a dictionary of the form { foo=food; bar=baz; }.
 
Methods inherited from class com.webobjects.appserver.WODirectAction
_componentAction, defaultAction, getSessionIDForRequest, performActionNamed, takeFormValueArraysForKeyArray, takeFormValuesForKeyArray
 
Methods inherited from class com.webobjects.appserver.WOAction
_isActionOnClass, _methodForAction, _preloadAllActionsOnClass, canAccessFieldsDirectly, context, debugString, existingSession, handleQueryWithUnboundKey, handleTakeValueForUnboundKey, initializeRequestSessionIDInContext, languages, logString, pageWithName, request, session, setLanguages, takeValueForKey, takeValueForKeyPath, toString, unableToSetNullForKey, validateTakeValueForKeyPath, validateValueForKey, valueForKey, valueForKeyPath
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.webobjects.foundation.NSKeyValueCoding
takeValueForKey, valueForKey
 
Methods inherited from interface com.webobjects.foundation.NSKeyValueCoding.ErrorHandling
handleQueryWithUnboundKey, handleTakeValueForUnboundKey, unableToSetNullForKey
 
Methods inherited from interface com.webobjects.foundation.NSKeyValueCodingAdditions
takeValueForKeyPath, valueForKeyPath
 
Methods inherited from interface com.webobjects.foundation.NSValidation
validateTakeValueForKeyPath, validateValueForKey
 

Field Detail

log

protected static final ERXLogger log
logging support


pathParts

protected NSArray pathParts
caches the path parts


pathPartsByKeys

protected NSDictionary pathPartsByKeys
caches the path parts by keys


pathPartsByKeysCaseInsensitive

protected NSDictionary pathPartsByKeysCaseInsensitive
caches the path parts by case insensitive keys

Constructor Detail

ERXPathDirectAction

public ERXPathDirectAction(WORequest aRequest)
Just calls super.

Method Detail

pathParts

public NSArray pathParts()
The path parts of a request correspond to to all of the pieces between the request handler key and the class name. For instance given the direct action path /WebObjects/MyApp.woa/wpa/foo/bar/MyDirectActionClass/action would produce the path parts (foo, bar).

Returns:
array of path parts for the given request

pathPartsByKeys

public NSDictionary pathPartsByKeys()
Given an array of path parts (foo=food, bar=baz, gee) this will produce a dictionary of the form: { foo=food; bar=baz; }. In the current for this method does not handle multiple keys with the same name.

Returns:
path parts broken down by key

pathPartsByKeysCaseInsensitive

public NSDictionary pathPartsByKeysCaseInsensitive()
Same method as pathPartsByKeys except all of the keys have been down cased, ie for path parts (Foo=food, bAr=baz, gee) this will give a dictionary of the form { foo=food; bar=baz; }.

Returns:
path parts by case insensitive key

hasPathPartForKey

public boolean hasPathPartForKey(String key)
Determines if a path part exists for a given key.

Parameters:
key - path part key
Returns:
if a path was specified

hasPathPartForKey

public boolean hasPathPartForKey(String key,
                                 boolean caseInsensitive)
Determines if a path part exists for a given key with the option of performing a case insensitve comparison.

Parameters:
key - path part key
caseInsensitive - key comparison should be case sensitive
Returns:
if a path was specified

pathPartForKey

public String pathPartForKey(String key)
Gets a path part for a given key.

Parameters:
key - path part key
Returns:
path part for the key

pathPartForKeyWithDefault

public String pathPartForKeyWithDefault(String key,
                                        String defaultValue)
Gets a path part for a given key, returning the default value if nothing was specified.

Parameters:
key - path part key
defaultValue - default value
Returns:
path part for the key or the default value

pathPartForKeyWithDefault

public String pathPartForKeyWithDefault(String key,
                                        String defaultValue,
                                        boolean caseInsensitiveCompare)
Gets a path part for a given key, returning the default value if nothing was specified. Adds the option for a case insensitive comparison.

Parameters:
key - path part key
defaultValue - default value
caseInsensitiveCompare - key comparison should ignore case
Returns:
path part for the key or the default value

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

Copyright © 2002 – 2004 Project Wonder.