com.ivata.mask.web.field
Class AttributesWriter

java.lang.Object
  extended bycom.ivata.mask.web.field.AttributesWriter

public class AttributesWriter
extends java.lang.Object

Stores and displays the attributes for an HTML field.

Since:
ivata masks 0.4 (2005-05-14)
Version:
$Revision: 1.7 $
Author:
Colin MacLeod colin.macleod@ivata.com

Constructor Summary
AttributesWriter(com.ivata.mask.field.Field fieldParam)
           Construct an attributes writer for the given field.
AttributesWriter(com.ivata.mask.field.Field fieldParam, java.lang.String propertyNameSuffixParam)
           Construct an attributes writer for the given field.
 
Method Summary
 void appendAttribute(java.lang.String name, java.lang.String value)
           Append an attribute value, such as CSS class.
 java.lang.String getAttribute(java.lang.String name)
           Get an attribute value.
 void remove(java.lang.String name)
           Clear an attribute.
 void setAttribute(java.lang.String name, java.lang.String value)
           Set an attribute value.
 java.lang.String toString()
           Output all the attribute names and values.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AttributesWriter

public AttributesWriter(com.ivata.mask.field.Field fieldParam)

Construct an attributes writer for the given field.

Parameters:
fieldParam - definition of the field being written.

AttributesWriter

public AttributesWriter(com.ivata.mask.field.Field fieldParam,
                        java.lang.String propertyNameSuffixParam)

Construct an attributes writer for the given field.

Parameters:
fieldParam - definition of the field being written.
propertyNameSuffixParam - used to build the property name of the field written, by the combination "valueObject." + fieldParam.getFullId() + propertyNameSuffixParam.
Method Detail

appendAttribute

public final void appendAttribute(java.lang.String name,
                                  java.lang.String value)

Append an attribute value, such as CSS class. It the attribute value is set already, a space is added followed by the new value.

Parameters:
name - name of the attribute to set - usually class.
value - value to add to this attribute.
See Also:
setAttribute(java.lang.String, java.lang.String)

getAttribute

public final java.lang.String getAttribute(java.lang.String name)

Get an attribute value.

Parameters:
name - name of the attribute to set.
Returns:
current value of this attribute.

remove

public final void remove(java.lang.String name)

Clear an attribute.

Parameters:
name - name of the attribute to remove.

setAttribute

public final void setAttribute(java.lang.String name,
                               java.lang.String value)

Set an attribute value.

Parameters:
name - name of the attribute to set.
value - current value of this attribute.

toString

public java.lang.String toString()

Output all the attribute names and values.

Returns:
all the attribute names and values.


Copyright © 2001-2005 ivata limited. All Rights Reserved.