Package org.exolab.castor.xml.util
Class AttributeSetImpl
java.lang.Object
org.exolab.castor.xml.util.AttributeSetImpl
- All Implemented Interfaces:
AttributeSet
The default implementation of AttributeSet used by the Marshalling Framework.
- Version:
- $Revision: 8690 $ $Date: 2006-04-13 06:47:36 -0600 (Thu, 13 Apr 2006) $
- Author:
- Keith Visco
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new AttributeSetImpl.AttributeSetImpl
(int size) Creates a new AttributeSetImpl. -
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
Removes all Attributes in this AttributeSetImplint
Returns the index of the attribute associated with the given name and namespace.getName
(int index) Returns the name of the attribute located at the given index.getNamespace
(int index) Returns the namespace of the attribute located at the given index.int
getSize()
Returns the number of Attributes within this AttributeSet.getValue
(int index) Returns the value of the attribute located at the given index within this AttributeSet.Returns the value of the attribute associated with the given name.Returns the value of the attribute associated with the given name.void
setAttribute
(String name, String value) Adds or replaces the attribute with the given name.void
setAttribute
(String name, String value, String namespace) Adds or replaces the attribute with the given name.
-
Field Details
-
XMLNS
The XML namespace declaration prefix. It is an error for an attribute name to be equal to this value.- See Also:
-
-
Constructor Details
-
AttributeSetImpl
public AttributeSetImpl()Creates a new AttributeSetImpl. -
AttributeSetImpl
public AttributeSetImpl(int size) Creates a new AttributeSetImpl.- Parameters:
size
- the default size for this AttributeSetImpl
-
-
Method Details
-
clear
public void clear()Removes all Attributes in this AttributeSetImpl -
getIndex
Returns the index of the attribute associated with the given name and namespace.- Specified by:
getIndex
in interfaceAttributeSet
- Parameters:
name
- the name of the attribute whose value should be returned.namespace
- the namespace of the attribute- Returns:
- the index of the attribute, or -1 if not found.
-
getName
Returns the name of the attribute located at the given index.- Specified by:
getName
in interfaceAttributeSet
- Parameters:
index
- the index of the attribute whose name should be returned.- Returns:
- the name of the attribute located at the given index.
-
getNamespace
Returns the namespace of the attribute located at the given index.- Specified by:
getNamespace
in interfaceAttributeSet
- Returns:
- the namespace of the attribute located at the given index.
-
getSize
public int getSize()Returns the number of Attributes within this AttributeSet.- Specified by:
getSize
in interfaceAttributeSet
- Returns:
- the number of Attributes within this AttributeSet.
-
getValue
Returns the value of the attribute located at the given index within this AttributeSet.- Specified by:
getValue
in interfaceAttributeSet
- Parameters:
index
- the index of the attribute whose value should be returned.
-
getValue
Returns the value of the attribute associated with the given name. This method is equivalent to call #getValue(name, null);- Specified by:
getValue
in interfaceAttributeSet
- Parameters:
name
- the name of the attribute whose value should be returned.
-
getValue
Returns the value of the attribute associated with the given name. This method is equivalent to call #getValue(name, null);- Specified by:
getValue
in interfaceAttributeSet
- Parameters:
name
- the name of the attribute whose value should be returned.namespace
- the namespace of the attribute
-
setAttribute
Adds or replaces the attribute with the given name. No namespace is associated with the attribute.- Parameters:
name
- the name of the attributevalue
- the attribute value.
-
setAttribute
Adds or replaces the attribute with the given name. No namespace is associated with the attribute.- Parameters:
name
- the name of the attributevalue
- the attribute value.
-