org.xpresso.xml.concurrent
Class ConcurrentElement
java.lang.Object
org.xpresso.xml.XmlContent
org.xpresso.xml.Element
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
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 java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ConcurrentElement
public ConcurrentElement(java.lang.String label)
throws IllegalContentException
- Throws:
IllegalContentException
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 attributevalue
- 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