com.arsdigita.bebop.util
Class Attributes

java.lang.Object
  extended bycom.arsdigita.bebop.util.Attributes
All Implemented Interfaces:
Cloneable, Lockable

public class Attributes
extends Object
implements Lockable, Cloneable

This class represents a set of key-value pairs, for use in extending the XML attributes of Bebop components.

Version:
$Id: //core-platform/dev/src/com/arsdigita/bebop/util/Attributes.java#9 $

Field Summary
static String versionId
           
 
Constructor Summary
Attributes()
          Creates an Attributes object.
 
Method Summary
 Object clone()
          Clone the attributes.
 void exportAttributes(Element target)
          Copy all attributes into the given DOM Element.
 String getAttribute(String name)
          Return the value of an attribute.
 Collection getAttributeKeys()
          Return a collection of all of the attribute keys represented.
 boolean isLocked()
          Return whether an object is locked and thus immutable, or can still be modified.
 void lock()
          Lock an object.
 void setAttribute(String name, String value)
          Sets an arbitrary attribute for inclusion in the HTML tags that compose element.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

versionId

public static final String versionId
See Also:
Constant Field Values
Constructor Detail

Attributes

public Attributes()
Creates an Attributes object.

Method Detail

clone

public Object clone()
             throws CloneNotSupportedException
Clone the attributes. The clone is not locked and has its own set of attributes and values.

Throws:
CloneNotSupportedException

setAttribute

public void setAttribute(String name,
                         String value)

Sets an arbitrary attribute for inclusion in the HTML tags that compose element. For standard attributes in the HTML 4.0 specification, use of this method has the same effect as the specific mutator method provided for each attribute.

Setting an attribute name to null removes it.

Parameters:
name - The name of the attribute
value - The value to assign the named attribute

getAttribute

public String getAttribute(String name)
Return the value of an attribute.

Parameters:
name - the name of the attribute
Returns:
the value set previously with setAttribute

getAttributeKeys

public Collection getAttributeKeys()
Return a collection of all of the attribute keys represented. This, along with getAttribute(String name) allows you to iterate through all of the attributes. All elements of the Collection are Strings


exportAttributes

public void exportAttributes(Element target)
Copy all attributes into the given DOM Element. This will override any preexisting Element attributes of the same names.


lock

public void lock()
Description copied from interface: Lockable
Lock an object. Locked objects are to be considered immutable. Any attempt to modify them, e.g., through a setXXX method should lead to an exception.

Most lockable Bebop classes throw an IllegalStateException if an attempt is made to modify a locked instance.

Specified by:
lock in interface Lockable

isLocked

public final boolean isLocked()
Description copied from interface: Lockable
Return whether an object is locked and thus immutable, or can still be modified.

Specified by:
isLocked in interface Lockable


Copyright (c) 2004 Red Hat, Inc. Corporation. All Rights Reserved. Generated at July 20 2004:2337 UTC