public abstract class Attribute extends XMLElement
| Constructor and Description |
|---|
Attribute(org.w3c.dom.Document owner)
Creates a new
Attribute instance. |
Attribute(org.w3c.dom.Element element)
Creates a new
Attribute instance from the given Element node. |
Attribute(org.w3c.dom.Element element, java.lang.String systemId)
Creates a new
Attribute instance from the given Element node. |
| Modifier and Type | Method and Description |
|---|---|
protected org.w3c.dom.Element |
addAttributeValue(org.w3c.dom.Node[] content, QName type)
Adds an
AttributeValue element to this Attribute. |
protected org.w3c.dom.Element |
addAttributeValue(org.w3c.dom.Node content, QName type)
Adds an
AttributeValue element to this Attribute. |
void |
addAttributeValue(java.lang.String value)
Adds a new
AttributeValue element to this Attribute. |
void |
addAttributeValues(java.lang.String[] values)
Adds a new
AttributeValue element for each string in the given array. |
abstract java.lang.String |
getAttributeProfileID()
Returns the Profile Identification URI.
|
java.util.List |
getAttributeValues()
Returns the list of this
Attribute's AttributeValues. |
protected java.lang.String[] |
getAttributeValuesAsStrings(QName type)
Returns the contents of this
Attribute's AttributeValues that have the given xsi:type as strings. |
protected java.lang.String[] |
getAttributeValuesAsStrings(QName type, boolean includeNull)
Returns the contents of this
Attribute's AttributeValues that have the given xsi:types as strings. |
java.lang.String[] |
getAttributeValueStrings()
Returns the contents of this
Attribute's AttributeValues that have xsi:type="xs:string". |
java.lang.String |
getFriendlyName()
Get the friendly name of the attribute.
|
java.lang.String |
getName() |
java.lang.String |
getNameFormat()
Get the attribute name format.
|
protected static QName |
getXsiType(org.w3c.dom.Element element)
Returns the XML Schema xsi:type attribute to identify the attribute value type.
|
void |
setFriendlyName(java.lang.String fname)
Set the friendly name of the attribute.
|
void |
setName(java.lang.String name)
Set the attribute name.
|
protected void |
setNameFormat(java.lang.String formatURI)
Set the attribute name format.
|
protected static void |
setXsiType(org.w3c.dom.Element element, QName type)
Set the XML Schema xsi:type attribute to identify the attribute value type.
|
addNSPrefixAttr, addNSPrefixAttr, addNSPrefixAttrDefault, addNSPrefixAttrDefault, getAttribute, getAttributeNode, getAttributeNodeNS, getAttributeNS, getChildElementsByTagName, getChildElementsByTagName, getChildElementsByTagNameNS, getChildElementsByTagNameNS, getDefaultNSPrefix, getElement, getElementsByTagName, getElementsByTagNameNS, getTagName, hasAttribute, hasAttributeNS, removeAttribute, removeAttributeNode, removeAttributeNS, setAttribute, setAttributeNode, setAttributeNodeNS, setAttributeNS, setDefaultNSPrefixappendChild, appendChild, appendTo, cloneNode, getAttributes, getChildNodes, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNode, getNodeName, getNodeType, getNodeValue, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, getSystemId, hasAttributes, hasChildNodes, insertBefore, insertBefore, isSupported, normalize, removeChild, removeChild, replaceChild, replaceChild, setNodeValue, setPrefix, setSystemId, toBytesXML, toStringXML
public Attribute(org.w3c.dom.Element element)
throws org.w3c.dom.DOMException
Attribute instance from the given Element node.element - An Attribute element.org.w3c.dom.DOMException
public Attribute(org.w3c.dom.Element element,
java.lang.String systemId)
throws org.w3c.dom.DOMException
Attribute instance from the given Element node.element - An Attribute element.systemId - The URI string system ID for the Attribute.org.w3c.dom.DOMException
public Attribute(org.w3c.dom.Document owner)
throws org.w3c.dom.DOMException
Attribute instance.owner - The owner document of the new Attribute.org.w3c.dom.DOMException
protected org.w3c.dom.Element addAttributeValue(org.w3c.dom.Node content,
QName type)
AttributeValue element to this Attribute.content - The content of the new AttributeValue element, to be appended as a child node.type - The XML schema type for the AttributeValue, to be set in an xsi:type attribute.AttributeValue element that was created.
protected org.w3c.dom.Element addAttributeValue(org.w3c.dom.Node[] content,
QName type)
AttributeValue element to this Attribute.content - The content of the new AttributeValue element, to be appended as child nodes.type - The XML schema type for the AttributeValue, to be set in an xsi:type attribute.AttributeValue element that was created.protected java.lang.String[] getAttributeValuesAsStrings(QName type)
Attribute's AttributeValues that have the given xsi:type as strings. An individual value will contain only the collected Text child nodes of the AttributeValue, so the given xsi:type should reference simple primitive/built-in types only.type - The xsi:type of the AttributeValue elements to return. If type is null, the string value of all AttributeValues will be returned.Strings, or null if no AttribtueValues of the given xsi:type are present.protected java.lang.String[] getAttributeValuesAsStrings(QName type, boolean includeNull)
Attribute's AttributeValues that have the given xsi:types as strings. An individual value will contain only the collected Text child nodes of the AttributeValue, so the given xsi:type should reference simple primitive/built-in types only.types - The xsi:types of the AttributeValue elements to return. If type is null, the string value of all AttributeValues will be returned.includeNull - If true, the string values of AttributeValue elements with no xsi:type attribute defined will be included in the result.Strings, or null if no AttribtueValues of the given xsi:type are present.
protected static void setXsiType(org.w3c.dom.Element element,
QName type)
element - The attribute value element to use as the context.type - The QName reference.protected static QName getXsiType(org.w3c.dom.Element element)
element - The attribute value element to use as the context.QName value type or null if not specified.public void addAttributeValue(java.lang.String value)
AttributeValue element to this Attribute. The new element will have the attribute xsi:type="xs:string" and, if the given string value is null, it will also have the attribute xsi:nil="true".value - The string content of the new AttributeValue element.public void addAttributeValues(java.lang.String[] values)
AttributeValue element for each string in the given array. Each AttributeValue element will have the attribute xsi:type="xs:string" and, if a given value is null, it will also have the attribute xsi:nil="true".values - The individual contents of the new AttributeValue elements.public java.util.List getAttributeValues()
Attribute's AttributeValues.List of AttributeValue elements, or null if this Attribute has none.public java.lang.String[] getAttributeValueStrings()
Attribute's AttributeValues that have xsi:type="xs:string".Strings, or null if no AttributeValues of xsi:type="xs:string" are present.public void setName(java.lang.String name)
name - The String containing the attribute name.public java.lang.String getName()
protected void setNameFormat(java.lang.String formatURI)
formatURI - A URI reference to the attribute name format.public java.lang.String getNameFormat()
public void setFriendlyName(java.lang.String fname)
fname - The String containing the friendly name.public java.lang.String getFriendlyName()
public abstract java.lang.String getAttributeProfileID()