|
|||||||||
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.OptionalTagAttribute
public class OptionalTagAttribute
This class provides programmatic access to the tag meta data for optional attributes, including name, description, type, and default values.
Tag classes need to have one public static final OptionalTagAttribute member variable for every attribute that this tag supports, but does not require.
E.G.
<pt:thistag pt:firstattribute="foo" pt:secondattribute="bar"/>
would need
public static final OptionalTagAttribute = new OptionalTagAttribute(
"firstattribute", "This optional attribute is used to ...",
AttributeType.STRING, "first default value");
public static final OptionalTagAttribute = new OptionalTagAttribute(
"secondattribute", "This optional attribute is used to ...",
AttributeType.STRING, "second default value");
The OptionalTagAttribute objects are used for programmatic access to tag meta data, as well as to pre-process tags for tag attributes (presence, correct type, and default values). If the attribute values are not correct, the default values will be used instead. An error will be logged, but the tag and its children will still be displayed.
RequiredTagAttribute
Field Summary | |
---|---|
protected java.lang.String |
m_strDefaultValue
|
Fields inherited from class com.plumtree.portaluiinfrastructure.tags.metadata.ATagAttribute |
---|
m_strDescription, m_strName, m_Type |
Constructor Summary | |
---|---|
OptionalTagAttribute(java.lang.String _strName,
java.lang.String _strDescription,
AttributeType _type,
java.lang.String _strDefaultValue)
Creates a new optional tag attribute. |
Method Summary | |
---|---|
protected void |
CheckDefaultValue()
This method is used to ensure that default values are of the appropriate type. |
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 |
Field Detail |
---|
protected java.lang.String m_strDefaultValue
Constructor Detail |
---|
public OptionalTagAttribute(java.lang.String _strName, java.lang.String _strDescription, AttributeType _type, java.lang.String _strDefaultValue)
_strName
- The attribute name._strDescription
- The attribute description._type
- The attribute type._strDefaultValue
- The attribute default value.
XPFormatException
- if the name contains any
whitespace or if the default value cannot be
converted to the appropriate type.
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()
protected void CheckDefaultValue()
XPFormatException
- if the default value cannot
be converted to the appropriate type.
|
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |