|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.plumtree.portaluiinfrastructure.tags.helper.TagHelper
public class TagHelper
This helper class contains the framework code that tags use and helps to keep the ATag class simple.
Field Summary | |
---|---|
static char |
ATTRIBUTE_I18N_MARKER
The marker used for attribute i18n string replacement ($#n.file). |
static char |
ATTRIBUTE_VARIABLE_MARKER
The marker for the beginning of a $var or $data.var attribute value replacement. |
static char |
ATTRIBUTE_VARIABLE_SEPARATOR
The separator between data collection name and value key in $data.var attribute value replacement. |
protected java.lang.Object[][] |
m_attributeObjXML
|
protected boolean |
m_bPTAttributesProcessed
|
protected boolean |
m_bXMLAttributesProcessed
|
protected XPHashtable |
m_processedPTAttributes
|
protected XPHashtable |
m_processedXMLAttributes
|
protected java.lang.String |
m_strUniqueID
|
protected java.lang.String |
m_strXMLAttributeDisplaystring
|
protected ATag |
m_tag
|
protected IDisplayElement |
m_tagBody
|
protected TagVisitor |
m_tagVisitor
|
static java.lang.String |
UNIQUE_ID_COUNTER_KEY
This key is used to store the unique ID counter in the HTTP request data. |
static java.lang.String |
UNIQUE_ID_KEY
This key is used to store the unique ID for each tag in Tag Scope. |
Constructor Summary | |
---|---|
TagHelper(java.lang.Object[][] _attributeObjXML,
IDisplayElement _tagBody,
ATag _Tag)
Constructor for the TagHelper. |
Method Summary | |
---|---|
void |
AddJavascript(HTMLScriptCollection _script)
|
protected void |
CheckAttribute(ATagAttribute _attribute,
AttributeType _type)
Check the type safety of the requested attribute. |
HTMLElement |
DisplayTag()
The Tag Container uses this method to display this tag. |
java.lang.String |
GetAttribute(java.lang.String _strAttribute)
|
boolean |
GetAttributeAsBoolean(ATagAttribute _attribute)
|
char |
GetAttributeAsChar(ATagAttribute _attribute)
|
double |
GetAttributeAsDouble(ATagAttribute _attribute)
|
int |
GetAttributeAsInt(ATagAttribute _attribute)
|
long |
GetAttributeAsLong(ATagAttribute _attribute)
|
java.lang.String |
GetAttributeAsString(ATagAttribute _attribute)
|
IXPEnumerator |
GetAttributeNames()
|
protected java.lang.String |
GetCollectionVariable(java.lang.String _strDataCollection,
java.lang.String _strKey)
Looks up the data collection in memory, accesses the specified key, and converts the value to a string. |
IEnvironment |
GetEnvironment()
|
protected XPHashtable |
GetProcessedPTAttributes()
Helper access method to allow lazy initialization of the processed PT attribute hashtable. |
protected XPHashtable |
GetProcessedXMLAttributes()
Helper access method to allow lazy initialization of the processed XML attribute hashtable. |
TagState |
GetState()
|
java.lang.String |
GetUniqueID()
|
protected java.lang.String |
GetVariable(java.lang.String _strKey)
Looks up the variable in memory and converts the value to a string. |
protected java.lang.Object |
GetVariableObject(java.lang.String _strKey)
Looks up the variable in memory and converts the value to a string. |
java.lang.String |
GetXMLAttribute(java.lang.String _strAttribute)
|
IXPEnumerator |
GetXMLAttributeNames()
|
java.lang.String |
GetXMLTagAttributesAsString()
|
boolean |
HasAttribute(ATagAttribute _attribute)
|
int |
HasChildTag(ITagMetaData _childTag)
Check whether or not a particular Transformer Tag is nested inside the current Tag. |
int |
HasParentTag(ITagMetaData _parentTag)
Check whether or not the current Tag is nested inside a given parent Tag. |
boolean |
HasXMLAttribute(java.lang.String _strAttribute)
|
protected java.lang.String |
InternalGetAttribute(ATagAttribute _attribute)
This helper method gets an attribute as a string. |
protected java.lang.String |
InternalGetAttributeFromName(java.lang.String _strAttribute,
int _nXMLAttributeType)
This helper method gets an attribute from a String object rather than an attribute object. |
protected java.lang.String |
InternalGetAttributeFromName(java.lang.String _strAttribute,
int _nXMLAttributeType,
boolean _bIgnoreProcessingErrors)
This helper method gets an attribute from a String object rather than an attribute object. |
protected boolean |
IsProcessedXMLAttributesEmpty()
Helper method to check if the hashtable is empty. |
protected void |
ProcessAllAttributes()
This helper method process all the PT attributes and stores them in the hashtable. |
protected void |
ProcessAllXMLAttributes()
This helper method process all the XML attributes and stores them in the hashtable. |
protected java.lang.String |
ProcessAttribute(java.lang.String _strAttribute)
Performs attribute value replacement on the attribute. |
protected java.lang.String |
ProcessI18NStringAttribute(java.lang.String _strAttribute)
Performs attribute value replacement on the attribute. |
HTMLElement |
ProcessTagBody()
|
void |
ReleaseTagVisitor()
This method releases the tag visitor to make sure it is not leaked (retained). |
void |
SetTagVisitor(TagVisitor _tagVisitor)
This method sets the tag visitor so we can process the tag. |
java.lang.String |
ValidateContext()
The Tag Container uses this method to check whether or not this tag is being displayed in the correct context. |
java.lang.String |
ValidateRequiredAttributes()
This helper method processes all the required PT attributes, validates them, and stores them in the hashtable. |
java.lang.String |
ValidateRequiredChildTags()
This helper method processes the tag display tree for required child tags. |
java.lang.String |
ValidateRequiredParentTags()
This helper method processes the tag display tree for required parent tags (at least one must be present). |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final char ATTRIBUTE_VARIABLE_MARKER
public static final char ATTRIBUTE_VARIABLE_SEPARATOR
public static final char ATTRIBUTE_I18N_MARKER
public static final java.lang.String UNIQUE_ID_COUNTER_KEY
public static final java.lang.String UNIQUE_ID_KEY
protected TagVisitor m_tagVisitor
protected java.lang.Object[][] m_attributeObjXML
protected boolean m_bPTAttributesProcessed
protected java.lang.String m_strXMLAttributeDisplaystring
protected boolean m_bXMLAttributesProcessed
protected XPHashtable m_processedPTAttributes
protected XPHashtable m_processedXMLAttributes
protected IDisplayElement m_tagBody
protected ATag m_tag
protected java.lang.String m_strUniqueID
Constructor Detail |
---|
public TagHelper(java.lang.Object[][] _attributeObjXML, IDisplayElement _tagBody, ATag _Tag)
_attributeObjXML
- The XML data that
describes this tag and its attributes._tagBody
- The child display element of
this tag in the display tree. May be null._Tag
- The current tag.Method Detail |
---|
public IEnvironment GetEnvironment()
ATag.GetEnvironment()
public TagState GetState()
ATag.GetState()
public HTMLElement ProcessTagBody()
ATag.ProcessTagBody()
public void AddJavascript(HTMLScriptCollection _script)
ATag.AddJavascript(HTMLScriptCollection)
public int HasParentTag(ITagMetaData _parentTag)
ITagMetaData
- _parentTag The Tag Meta Data
of the requested parent tag
public int HasChildTag(ITagMetaData _childTag)
ITagMetaData
- _childTag A Tag Meta
Data objects of the requested child tag
public java.lang.String GetAttributeAsString(ATagAttribute _attribute)
com.plumtree.portaluiinfrastructure.tags.ATag#GetAttributeAsString(ATagAttribute)
public int GetAttributeAsInt(ATagAttribute _attribute)
com.plumtree.portaluiinfrastructure.tags.ATag#GetAttributeAsInt(ATagAttribute)
public boolean GetAttributeAsBoolean(ATagAttribute _attribute)
com.plumtree.portaluiinfrastructure.tags.ATag#GetAttributeAsBoolean(ATagAttribute)
public char GetAttributeAsChar(ATagAttribute _attribute)
com.plumtree.portaluiinfrastructure.tags.ATag#GetAttributeAsChar(ATagAttribute)
public double GetAttributeAsDouble(ATagAttribute _attribute)
com.plumtree.portaluiinfrastructure.tags.ATag#GetAttributeAsDouble(ATagAttribute)
public long GetAttributeAsLong(ATagAttribute _attribute)
com.plumtree.portaluiinfrastructure.tags.ATag#GetAttributeAsLong(ATagAttribute)
public boolean HasAttribute(ATagAttribute _attribute)
com.plumtree.portaluiinfrastructure.tags.ATag#HasAttribute(ATagAttribute)
public java.lang.String GetAttribute(java.lang.String _strAttribute)
ATag.GetTagAttribute(String)
public IXPEnumerator GetAttributeNames()
com.plumtree.portaluiinfrastructure.tags.ATag#GetAttributeNames()
public java.lang.String GetXMLAttribute(java.lang.String _strAttribute)
com.plumtree.portaluiinfrastructure.tags.ATag#GetXMLAttribute(String)
public boolean HasXMLAttribute(java.lang.String _strAttribute)
com.plumtree.portaluiinfrastructure.tags.ATag#HasXMLAttribute(String)
protected java.lang.String InternalGetAttribute(ATagAttribute _attribute)
_attribute
- The requested Attribute.
protected java.lang.String InternalGetAttributeFromName(java.lang.String _strAttribute, int _nXMLAttributeType)
_strAttribute
- The name of the attribute to retrieve._nXMLAttributeType
- The attribute type.
protected java.lang.String InternalGetAttributeFromName(java.lang.String _strAttribute, int _nXMLAttributeType, boolean _bIgnoreProcessingErrors)
_strAttribute
- The name of the attribute to retrieve._nXMLAttributeType
- The attribute type._bIgnoreProcessingErrors
- False implies that exceptions should be generated
when processing attributes for value replacement. This is not the default behavior.
XPIllegalArgumentException
- if the attribute specifies an invalid variable
for variable replacement and _bIgnoreProcessingErrors is false.protected void CheckAttribute(ATagAttribute _attribute, AttributeType _type)
ATagAttribute
- _attribute The requested attribute.AttributeType
- _type The requested data type.
XPIllegalArgumentException
- if the requested data
type does not match the attribute.public IXPEnumerator GetXMLAttributeNames()
com.plumtree.portaluiinfrastructure.tags.ATag#GetXMLAttributeNames()
public java.lang.String GetXMLTagAttributesAsString()
ATag.GetXMLTagAttributesAsString()
protected void ProcessAllAttributes()
protected void ProcessAllXMLAttributes()
protected java.lang.String ProcessAttribute(java.lang.String _strAttribute)
_strAttribute
- The pre-processed attribute.
protected java.lang.String ProcessI18NStringAttribute(java.lang.String _strAttribute)
_strAttribute
- The pre-processed attribute.
protected java.lang.String GetVariable(java.lang.String _strKey)
String
- _strKey The name of the variable.
protected java.lang.String GetCollectionVariable(java.lang.String _strDataCollection, java.lang.String _strKey)
String
- _strDataCollection The name of the data collection.String
- _strKey The key into the data collection.
protected java.lang.Object GetVariableObject(java.lang.String _strKey)
String
- _strKey The name of the variable.
public java.lang.String GetUniqueID()
ATag.GetUniqueID()
public HTMLElement DisplayTag()
public void SetTagVisitor(TagVisitor _tagVisitor)
_tagVisitor
- The tag visitor.public void ReleaseTagVisitor()
public java.lang.String ValidateContext()
public java.lang.String ValidateRequiredParentTags()
public java.lang.String ValidateRequiredChildTags()
public java.lang.String ValidateRequiredAttributes()
_attributes
- The array of required attributes for this tag.
protected XPHashtable GetProcessedPTAttributes()
protected XPHashtable GetProcessedXMLAttributes()
protected boolean IsProcessedXMLAttributesEmpty()
|
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |