org.xpresso.xml.concurrent
Class ConcurrentElement

java.lang.Object
  extended by org.xpresso.xml.XmlContent
      extended by org.xpresso.xml.Element
          extended by org.xpresso.xml.concurrent.ConcurrentElement
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable

public class ConcurrentElement
extends Element

Thread-safe version of Element. Some methods are synchronized.

This code is under the LGPL v3 licence.

Author:
Alexis Dufrenoy
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.xpresso.xml.XmlContent
content
 
Constructor Summary
ConcurrentElement(java.lang.String label)
           
 
Method Summary
 void addAttribute(java.lang.String key, java.lang.String value)
          Adds an attribute to the Element, using given key and value.
 java.util.Map<java.lang.String,java.lang.String> getAttributes()
          Return the map containing all attributes
 java.lang.String getLabel()
          Returns the label of the Element
 java.lang.String getText()
          Return the Element as an empty element
 
Methods inherited from class org.xpresso.xml.Element
clone, isValid
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConcurrentElement

public ConcurrentElement(java.lang.String label)
                  throws IllegalContentException
Throws:
IllegalContentException
Method Detail

addAttribute

public void addAttribute(java.lang.String key,
                         java.lang.String value)
                  throws IllegalContentException
Description copied from class: Element
Adds an attribute to the Element, using given key and value.

Overrides:
addAttribute in class Element
Parameters:
key - the key part of the attribute
value - the value part of the attribute
Throws:
IllegalContentException - Thrown if label contains invalid characters. Valid characters are uppercase and
lower case letters, numbers, ":", "-", "_" and "."

getAttributes

public java.util.Map<java.lang.String,java.lang.String> getAttributes()
Description copied from class: Element
Return the map containing all attributes

Overrides:
getAttributes in class Element
Returns:
the map

getLabel

public java.lang.String getLabel()
Description copied from class: Element
Returns the label of the Element

Overrides:
getLabel in class Element
Returns:
the label of the attribute

getText

public java.lang.String getText()
Description copied from class: Element
Return the Element as an empty element

Overrides:
getText in class Element
Returns:
text for an empty element