com.plumtree.portaluiinfrastructure.tags.metadata
Class ATagAttribute

java.lang.Object
  extended by com.plumtree.portaluiinfrastructure.tags.metadata.ATagAttribute
Direct Known Subclasses:
OptionalTagAttribute, RequiredTagAttribute

public abstract class ATagAttribute
extends java.lang.Object

This base class provides programmatic access to the tag meta data for attributes, including name, description, type, requirement, and default values.

Adding public static final member variables of the various ATagAttribute classes turns on validation that the tag attributes are being used correctly, as well as providing useful documentation information.


Field Summary
protected  java.lang.String m_strDescription
           
protected  java.lang.String m_strName
           
protected  AttributeType m_Type
           
 
Constructor Summary
protected ATagAttribute(java.lang.String _strName, java.lang.String _strDescription, AttributeType _type)
          Creates a new tag attribute.
 
Method Summary
protected  void CheckNameSafety()
          This helper method checks whether or not the attribute name contains any illegal characters, such as whitespace.
abstract  java.lang.String GetDefaultValue()
          The default value for an optional attribute if the attribute is not present or is of the incorrect type.
 java.lang.String GetDescription()
          The description of the attribute and it's behavior.
abstract  boolean GetIsRequired()
          Gets whether or not this attribute is required to be present every time the tag is used.
 java.lang.String GetName()
          The name of the attribute.
 AttributeType GetType()
          The data type of the attribute.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_strName

protected java.lang.String m_strName

m_strDescription

protected java.lang.String m_strDescription

m_Type

protected final AttributeType m_Type
Constructor Detail

ATagAttribute

protected ATagAttribute(java.lang.String _strName,
                        java.lang.String _strDescription,
                        AttributeType _type)
Creates a new tag attribute.

Parameters:
_strName - The attribute name.
_strDescription - The attribute description.
_type - The attribute type.
Throws:
XPFormatException - if the name contains any whitespace.
XPIllegalArgumentException - if the AttributeType is null.
Method Detail

GetIsRequired

public abstract boolean GetIsRequired()
Gets whether or not this attribute is required to be present every time the tag is used. If it is required, the tag will fail if it is not present.

Returns:
boolean True means that this attribute is required

GetDefaultValue

public abstract java.lang.String GetDefaultValue()
The default value for an optional attribute if the attribute is not present or is of the incorrect type. This will return null for required attributes.

Returns:
String The default value for this attribute. Null implies there is no default value.

GetName

public java.lang.String GetName()
The name of the attribute.

Returns:
String The attribute name

GetDescription

public java.lang.String GetDescription()
The description of the attribute and it's behavior.

Returns:
String The attribute description

GetType

public AttributeType GetType()
The data type of the attribute. E.G. int, string, etc...

Specifying the attribute type will force the conversion of the attribute to that type and will cause an error if it cannot be converted.

Required attributes will be converted before the tag is displayed and will cause the tag to fail if they cannot be converted correctly.

Returns:
AttributeType The type of the attribute

CheckNameSafety

protected void CheckNameSafety()
This helper method checks whether or not the attribute name contains any illegal characters, such as whitespace.

Throws:
XPFormatException - if the name contains any whitespace.



Copyright © 2002,2003,2004,2005 Plumtree Software, Inc., All Rights Reserved.