org.apache.struts.taglib.nested
クラス NestedPropertyHelper

java.lang.Object
  拡張org.apache.struts.taglib.nested.NestedPropertyHelper

public class NestedPropertyHelper
extends java.lang.Object

A simple helper class that does everything that needs to be done to get the nested tag extension to work. The tags will pass in their relative properties and this class will leverage the accessibility of the request object to calculate the nested references and manage them from a central place.

The helper method setNestedProperties(javax.servlet.http.HttpServletRequest, org.apache.struts.taglib.nested.NestedPropertySupport) takes a reference to the tag itself so all the simpler tags can have their references managed from a central location. From here, the reference to a provided name is also preserved for use.

With all tags keeping track of themselves, we only have to seek to the next level, or parent tag, were a tag will append a dot and it's own property.

導入されたバージョン:
Struts 1.1
バージョン:
$Revision: 1.1 $ $Date: 2003/10/21 17:47:23 $
作成者:
Arron Bates

フィールドの概要
static java.lang.String NESTED_INCLUDES_KEY
           
 
コンストラクタの概要
NestedPropertyHelper()
           
 
メソッドの概要
private static java.lang.String calculateRelativeProperty(java.lang.String property, java.lang.String parent)
           
static void deleteReference(javax.servlet.http.HttpServletRequest request)
          Deletes the nested reference from the request object.
static java.lang.String getAdjustedProperty(javax.servlet.http.HttpServletRequest request, java.lang.String property)
          Get the adjusted property.
static java.lang.String getCurrentName(javax.servlet.http.HttpServletRequest request, NestedNameSupport nested)
          Returns the bean name from the request object that the properties are nesting against.
static java.lang.String getCurrentProperty(javax.servlet.http.HttpServletRequest request)
          Returns the current nesting property from the request object.
private static NestedReference referenceInstance(javax.servlet.http.HttpServletRequest request)
          Pulls the current nesting reference from the request object, and if there isn't one there, then it will create one and set it.
static void setName(javax.servlet.http.HttpServletRequest request, java.lang.String name)
          Sets the provided name into the request object for reference by the other nested tags.
static void setNestedProperties(javax.servlet.http.HttpServletRequest request, NestedPropertySupport tag)
          Helper method that will set all the relevant nesting properties for the provided tag reference depending on the implementation.
static void setProperty(javax.servlet.http.HttpServletRequest request, java.lang.String property)
          Sets the provided property into the request object for reference by the other nested tags.
 
クラス java.lang.Object から継承したメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

フィールドの詳細

NESTED_INCLUDES_KEY

public static final java.lang.String NESTED_INCLUDES_KEY
関連項目:
定数フィールド値
コンストラクタの詳細

NestedPropertyHelper

public NestedPropertyHelper()
メソッドの詳細

getCurrentProperty

public static final java.lang.String getCurrentProperty(javax.servlet.http.HttpServletRequest request)
Returns the current nesting property from the request object.

パラメータ:
request - object to fetch the property reference from
戻り値:
String of the bean name to nest against

getCurrentName

public static final java.lang.String getCurrentName(javax.servlet.http.HttpServletRequest request,
                                                    NestedNameSupport nested)

Returns the bean name from the request object that the properties are nesting against.

The requirement of the tag itself could be removed in the future, but is required if support for the tag is maintained.

パラメータ:
request - object to fetch the bean reference from
nested - tag from which to start the search from
戻り値:
the string of the bean name to be nesting against

getAdjustedProperty

public static final java.lang.String getAdjustedProperty(javax.servlet.http.HttpServletRequest request,
                                                         java.lang.String property)
Get the adjusted property. Apply the provided property, to the property already stored in the request object.

パラメータ:
request - to pull the reference from
property - to retrieve the evaluated nested property with
戻り値:
String of the final nested property reference.

setProperty

public static final void setProperty(javax.servlet.http.HttpServletRequest request,
                                     java.lang.String property)
Sets the provided property into the request object for reference by the other nested tags.

パラメータ:
request - object to set the new property into
property - String to set the property to

setName

public static final void setName(javax.servlet.http.HttpServletRequest request,
                                 java.lang.String name)
Sets the provided name into the request object for reference by the other nested tags.

パラメータ:
request - object to set the new name into
name - String to set the name to

deleteReference

public static final void deleteReference(javax.servlet.http.HttpServletRequest request)
Deletes the nested reference from the request object.

パラメータ:
request - object to remove the reference from

setNestedProperties

public static void setNestedProperties(javax.servlet.http.HttpServletRequest request,
                                       NestedPropertySupport tag)
Helper method that will set all the relevant nesting properties for the provided tag reference depending on the implementation.

パラメータ:
request - object to pull references from
tag - to set the nesting values into

referenceInstance

private static final NestedReference referenceInstance(javax.servlet.http.HttpServletRequest request)
Pulls the current nesting reference from the request object, and if there isn't one there, then it will create one and set it.

パラメータ:
request - object to manipulate the reference into
戻り値:
current nesting reference as stored in the request object

calculateRelativeProperty

private static java.lang.String calculateRelativeProperty(java.lang.String property,
                                                          java.lang.String parent)


このドキュメントは、Ja-Jakartaにより訳されました。コメントがある場合は、report@jajakarta.orgまでお願いします。
Copyright (C) 2000-2003 - Apache Software Foundation