|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object atg.repository.seo.UrlParameter
public class UrlParameter
Class that represents a parameter in a UrlTemplate
.
This object holds the following details about a parameter:
When the UrlParameter is first created the value will be null. This class provides a method to lookup the value for a given request.
The item name and the property name are obtained by splitting the parameter name up by the first '.'.
If a parameter name is wrapped by curly brackets then the parameter value will be escaped. Otherwise if the parameter name is wrapped by square brackets then the value will not be escaped.
e.g. For "[item.template.url]":
Lookup items are objects of class UrlParameterLookup
. They are created during
initialization of indirect templates from the properties file and also by the ItemLink
droplet from the request parameters.
Field Summary | |
---|---|
static java.lang.String |
CLASS_VERSION
Class version string |
protected boolean |
mIsEscaped
|
protected java.lang.String |
mItemName
|
protected ApplicationLogging |
mLogger
|
protected UrlParameterLookup |
mLookup
|
protected java.lang.String |
mName
|
protected java.lang.String |
mPropertyName
|
protected static java.lang.String |
mSpaceMapping
Class version |
protected java.lang.String |
mValue
|
Constructor Summary | |
---|---|
protected |
UrlParameter(ApplicationLogging pLogger,
java.lang.String pName)
Constructor. |
Method Summary | |
---|---|
java.lang.Object |
clone()
Clones this object for use by a request |
java.lang.String |
getItemName()
Getter method for the item name |
UrlParameterLookup |
getLookup()
Getter method for the lookup object. |
java.lang.String |
getName()
Getter method for the parameter name |
java.lang.String |
getPropertyName()
Getter method for the property name |
static java.lang.String |
getSpaceMapping()
Getter for String to escape space characters. |
java.lang.String |
getValue()
Getter method for the value of this parameter in the current request. |
boolean |
isEscaped()
Getter method to flag whether the value of this parameter will be escaped. |
java.lang.String |
lookupValue(DynamoHttpServletRequest pRequest,
java.lang.Object pElementValue)
This method will set the value of this parameter. |
void |
setEscaped(boolean pIsEscaped)
Setter method to flag whether the value of this parameter will be escaped. |
void |
setItemName(java.lang.String pItemName)
Setter method for the item name |
void |
setLookup(UrlParameterLookup pLookup)
Setter method for the lookup object. |
void |
setName(java.lang.String pName)
Setter mthod for the parameter name. |
void |
setPropertyName(java.lang.String pPropertyName)
Setter method for the property name |
static void |
setSpaceMapping(java.lang.String pSpaceMapping)
Setter for String to escape space characters. |
void |
setValue(java.lang.String pValue)
Setter method for the value of this parameter. |
java.lang.String |
toString()
Override toString() to return the value. |
protected static java.lang.String |
urlEncodeParameter(java.lang.String pText)
URL encodes the given text to UTF-8 encoding so that it can be added to a URL |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static java.lang.String CLASS_VERSION
protected static java.lang.String mSpaceMapping
protected ApplicationLogging mLogger
protected java.lang.String mName
protected java.lang.String mValue
protected UrlParameterLookup mLookup
protected boolean mIsEscaped
protected java.lang.String mItemName
protected java.lang.String mPropertyName
Constructor Detail |
---|
protected UrlParameter(ApplicationLogging pLogger, java.lang.String pName)
pLogger
- ApplicationLogging object to do logging withpName
- String name to set, e.g. "item.template.url"Method Detail |
---|
public java.lang.String getName()
public void setName(java.lang.String pName)
This method also splits up the parameter name to set the item name and the property name.
The property name will be null if there is only an item name.
For example,"item.template.url" will be split into item name "item" and property name "template.url" However, "navCount" will set item name to "navCount" and property name to null.
pName
- String parameter name e.g. "item.template.url"public java.lang.String getItemName()
public java.lang.String getPropertyName()
public void setItemName(java.lang.String pItemName)
pItemName
- String item name for this parameter, e.g. "item"public void setPropertyName(java.lang.String pPropertyName)
pPropertyName
- String property name for this parameter, e.g. "template.url". May be null.public java.lang.String getValue()
This value may have been escaped depending on the mIsEscaped property of this parameter.
public void setValue(java.lang.String pValue)
If this parameter is set to be escaped then the passed in value should already be escaped.
pValue
- String value to setpublic UrlParameterLookup getLookup()
public void setLookup(UrlParameterLookup pLookup)
pLookup
- UrlParameterLookup object. May be null.public boolean isEscaped()
public void setEscaped(boolean pIsEscaped)
pIsEscaped
- true if the value of this parameter should be escaped, otherwise false.public static java.lang.String getSpaceMapping()
public static void setSpaceMapping(java.lang.String pSpaceMapping)
pSpaceMapping
- String to map spacespublic java.lang.String lookupValue(DynamoHttpServletRequest pRequest, java.lang.Object pElementValue) throws atg.repository.seo.ItemLinkException
If this parameter has a lookup object then this is used first to get a value. If there is no lookup object set or the lookup object fails to get a value then the method will check the request to get a value.
If a value is obtained then it is escaped if this parameter is set to escape the value.
pRequest
- DynamoHttpServletRequest objectpElementValue
- Value for the lookup object if available, otherwise null.
atg.repository.seo.ItemLinkException
protected static java.lang.String urlEncodeParameter(java.lang.String pText)
pText
- The String object containing the text to be encoded
public java.lang.String toString()
Used by the MessageFormat object in the UrlPattern class.
toString
in class java.lang.Object
public java.lang.Object clone()
clone
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |