public abstract class AttributeContainer
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
AttributeContainer_java_copyright |
static java.lang.String |
AttributeContainer_java_sourceCodeID |
Constructor and Description |
---|
AttributeContainer()
Constructs an AttributeContainer object.
|
AttributeContainer(Attribute[] attributes)
Constructs an AttributeContainer using an array of Attribute objects.
|
Modifier and Type | Method and Description |
---|---|
static Attribute[] |
attributesFromXml(org.w3c.dom.Element element)
Adds the Attributes from the Element to this AttributeContainer.
|
void |
clear()
Clears this AttributeContainer.
|
Attribute |
getAttributeByName(java.lang.String attributeName)
Returns an Attribute from this AttributeContainer based on the
AttributeName string provided.
|
Attribute |
getAttributeByNameAndType(java.lang.String name,
java.lang.String type)
Returns an Attribute from this AttributeContainer based on the name
string and type string provided.
|
java.util.Iterator |
getAttributeIterator()
Returns an Iterator over the values in this Attribute container.
|
Attribute[] |
getAttributes()
Returns an Attribute array containing this AttributeContainers Attribute
objects.
|
Attribute[] |
getAttributesByType(java.lang.String attributeType)
Returns an array of attributes from this AttributeContainer based on the
specified attribute type
|
java.lang.String |
getAttributeValueByName(java.lang.String attributeName)
Return the first attribute value as a String based on the attribute name
String provided.
|
java.lang.String |
getAttributeValueByNameAndType(java.lang.String attributeName,
java.lang.String attributeType)
Return the first attribute value as a String based on the attribute name
and type provided.
|
java.lang.String[] |
getAttributeValuesByName(java.lang.String attributeName)
Returns a String array of attribute values based on the attribute name
String provided.
|
java.lang.String[] |
getAttributeValuesByNameAndType(java.lang.String name,
java.lang.String type)
Returns Attribute values as a String array from this AttributeContainer
based on the name string and type string provided.
|
int |
getNumberOfAttributes()
Returns the number of Attributes in this AttributeContainer.
|
boolean |
removeAttribute(Attribute attr)
Removes an Attribute from this AttributeContainer based on the Attribute
provided (Matches on the name and type).
|
java.lang.String[] |
removeAttributeByNameAndType(java.lang.String name,
java.lang.String type)
Removes an Attribute from this AttributeContainer based on the name
string and type string provided.
|
int |
removeAttributes(java.lang.String name,
java.lang.String type)
Return attributes that match name and type.
|
Attribute |
setAttribute(Attribute attr)
Sets an attribute in this AttributeContainer based on the Attribute
provided.
|
org.w3c.dom.Node[] |
setAttribute(java.lang.String name,
java.lang.String type,
org.w3c.dom.Node[] values)
Set attributes in this AttributeContainer based on the name, type and
Node array values provided.
|
java.lang.String[] |
setAttribute(java.lang.String name,
java.lang.String type,
java.lang.String[] values)
Sets an Attribute in this AttributeContainer based on the name, type and
String array of values provided.
|
org.w3c.dom.Node[] |
setAttribute(java.lang.String name,
java.lang.String type,
java.lang.String nickname,
org.w3c.dom.Node[] values)
Set attributes in this AttributeContainer based on the name, type,
nickname and Node array values provided.
|
java.lang.String[] |
setAttribute(java.lang.String name,
java.lang.String type,
java.lang.String nickname,
java.lang.String[] values)
Sets an Attribute in this AttributeContainer based on the name, type and
String array of values provided.
|
void |
setAttribute(java.lang.String name,
java.lang.String type,
java.lang.String nickname,
java.lang.String[] values,
org.w3c.dom.Node[] nodes)
Set attributes in this AttributeContainer based on the name, type and
Node array values provided.
|
void |
setAttributes(Attribute[] attributes)
Sets the attributes in this AttributeContainer using the supplied
Attribute array.
|
org.w3c.dom.Element |
toXml(org.w3c.dom.Document owner)
Converts this AttributeContainer to XML in the form of an
org.w3c.dom.Element object.
|
public static final java.lang.String AttributeContainer_java_sourceCodeID
public static final java.lang.String AttributeContainer_java_copyright
public AttributeContainer()
public AttributeContainer(Attribute[] attributes)
attributes
- an array of Attribute objectspublic Attribute[] getAttributes()
public final void setAttributes(Attribute[] attributes)
attributes
- an Attribute[] of Attributes to be added to this
AttributeContainer.public java.lang.String getAttributeValueByName(java.lang.String attributeName)
attributeName
- the name of an attributepublic java.lang.String getAttributeValueByNameAndType(java.lang.String attributeName, java.lang.String attributeType)
attributeName
- the name of an attributeattributeType
- the type of the attributepublic java.lang.String[] getAttributeValuesByName(java.lang.String attributeName)
attributeName
- the name of an attributepublic Attribute getAttributeByName(java.lang.String attributeName)
attributeName
- the name of an attributepublic Attribute[] getAttributesByType(java.lang.String attributeType)
attributeType
- the type of the attribute(s) to be returnedpublic Attribute getAttributeByNameAndType(java.lang.String name, java.lang.String type)
name
- the name of an Attributetype
- the type of Attributepublic java.lang.String[] getAttributeValuesByNameAndType(java.lang.String name, java.lang.String type)
name
- the name of an Attributetype
- the type of Attributepublic java.lang.String[] removeAttributeByNameAndType(java.lang.String name, java.lang.String type)
name
- the name of an Attributetype
- the type of Attributepublic boolean removeAttribute(Attribute attr)
attr
- the Attribute to remove from this AttributeContainer.public java.lang.String[] setAttribute(java.lang.String name, java.lang.String type, java.lang.String[] values)
name
- the name of the attributetype
- the Attribute typevalues
- a String array of attribute valuespublic java.lang.String[] setAttribute(java.lang.String name, java.lang.String type, java.lang.String nickname, java.lang.String[] values)
name
- the name of the Attribute to be added to this
AttributeContainertype
- the Attribute typenickname
- the nickname of the Attribute to be added to this
AttributeContainervalues
- a String array of attribute valuespublic org.w3c.dom.Node[] setAttribute(java.lang.String name, java.lang.String type, org.w3c.dom.Node[] values)
name
- the Attribute nametype
- the type of Attributevalues
- the values of the Attribute to be added to this
AttributeContainer as an array of Nodes.public void setAttribute(java.lang.String name, java.lang.String type, java.lang.String nickname, java.lang.String[] values, org.w3c.dom.Node[] nodes)
name
- the Attribute name to be set in the AttributeContainertype
- the type of Attribute to be set in the AttributeContainernickname
- the nickname of the Attribute to be set in the
AttributeContainervalues
- the values of the Attribute to be added to this
AttributeContainer as an array of Strings.nodes
- the values of the Attribute to be added to this
AttributeContainer as an array of Nodes.public org.w3c.dom.Node[] setAttribute(java.lang.String name, java.lang.String type, java.lang.String nickname, org.w3c.dom.Node[] values)
name
- the Attribute nametype
- the type of Attributenickname
- the nickname of the Attributevalues
- the values of the Attribute to be added to this
AttributeContainer as an array of Nodes.public Attribute setAttribute(Attribute attr)
attr
- the Attribute to set in this AttributeContainer.public java.util.Iterator getAttributeIterator()
public int getNumberOfAttributes()
public void clear()
public int removeAttributes(java.lang.String name, java.lang.String type)
name
- The name to match or null to match alltype
- The type to match or null to match allpublic static Attribute[] attributesFromXml(org.w3c.dom.Element element)
element
- the element which contains attributes to add to this
AttributeContainer.public org.w3c.dom.Element toXml(org.w3c.dom.Document owner)
owner
- owner XML Document