|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.plumtree.portaluiinfrastructure.tags.metadata.ATagAttribute com.plumtree.portaluiinfrastructure.tags.metadata.RequiredTagAttribute
public class RequiredTagAttribute
This class provides programmatic access to the tag meta data for required attributes, including name, description, and type.
Tag classes need to have one public static final RequiredTagAttribute member variable for every attribute that this tag requires.
E.G.
<pt:thistag pt:firstattribute="foo" pt:secondattribute="bar"/>
would need
public static final RequiredTagAttribute = new RequiredTagAttribute(
"firstattribute", "This attribute is used to ...");
public static final RequiredTagAttribute = new RequiredTagAttribute(
"secondattribute", "This attribute is used to ...");
The RequiredTagAttribute objects are used for programmatic access to tag meta data, as well as to pre-process tags for required attributes (presence and correct type). If the attributes are not correct (missing required attribute or bad value), an error will be logged and the tag and its children will be skipped and not displayed. An HTML Comment describing the tag and error will be displayed instead.
OptionalTagAttribute
Field Summary |
---|
Fields inherited from class com.plumtree.portaluiinfrastructure.tags.metadata.ATagAttribute |
---|
m_strDescription, m_strName, m_Type |
Constructor Summary | |
---|---|
RequiredTagAttribute(java.lang.String _strName,
java.lang.String _strDescription)
Creates a new required tag attribute of type String. |
|
RequiredTagAttribute(java.lang.String _strName,
java.lang.String _strDescription,
AttributeType _type)
Creates a new required tag attribute. |
Method Summary | |
---|---|
void |
CheckValue(java.lang.String _strValue)
This method is used to ensure that the input supplied for this attribute is valid. |
java.lang.String |
GetDefaultValue()
The default value for an optional attribute if the attribute is not present or is of the incorrect type. |
boolean |
GetIsRequired()
Gets whether or not this attribute is required to be present every time the tag is used. |
Methods inherited from class com.plumtree.portaluiinfrastructure.tags.metadata.ATagAttribute |
---|
CheckNameSafety, GetDescription, GetName, GetType |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public RequiredTagAttribute(java.lang.String _strName, java.lang.String _strDescription)
If a required attribute is missing from a tag, the tag will fail.
_strName
- The attribute name_strDescription
- The attribute description
XPFormatException
- if the name contains any
whitespace.public RequiredTagAttribute(java.lang.String _strName, java.lang.String _strDescription, AttributeType _type)
If a required attribute is missing from a tag, the tag will fail.
_strName
- The attribute name_strDescription
- The attribute description_type
- The attribute type
XPFormatException
- if the name contains any
whitespace.
XPIllegalArgumentException
- if the AttributeType
is null.Method Detail |
---|
public boolean GetIsRequired()
ATagAttribute
GetIsRequired
in class ATagAttribute
com.plumtree.portaluiinfrastructure.tags.metadat.ATagAttribute#GetIsRequired()
public java.lang.String GetDefaultValue()
ATagAttribute
GetDefaultValue
in class ATagAttribute
com.plumtree.portaluiinfrastructure.tags.metadat.ATagAttribute#GetDefaultValue()
public void CheckValue(java.lang.String _strValue)
String
- _strValue The supplied input value.
XPFormatException
- The input cannot be converted
to the appropriate type.
|
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |