Class XmlAttr

java.lang.Object
org.libxmq.imp.xml.XmlNode
org.libxmq.imp.xml.XmlAttr
All Implemented Interfaces:
XMQAttr, XMQNode

public class XmlAttr extends XmlNode implements XMQAttr
An attribute. Like in libxml2 the value is stored as children, text nodes and entity references, so that entity references in attribute values survive parsing and printing.
  • Constructor Details

    • XmlAttr

      public XmlAttr(String name, String value)
      Create an attribute.
      Parameters:
      name - The local name.
      value - The value, or null for no value.
  • Method Details

    • type

      public XMQNodeType type()
      Description copied from class: XmlNode
      Returns the type of this node.
      Specified by:
      type in interface XMQNode
      Specified by:
      type in class XmlNode
      Returns:
      The node type.
    • ns

      public XmlNs ns()
      Returns the namespace of the attribute.
      Specified by:
      ns in interface XMQAttr
      Returns:
      The namespace or null.
    • setNs

      public void setNs(XMQNS ns)
      Set the namespace of the attribute.
      Specified by:
      setNs in interface XMQAttr
      Parameters:
      ns - The namespace or null.
    • value

      public String value()
      Returns the value of the attribute. Entities are never expanded implicitly: an entity reference contributes nothing, a character reference kept as a node contributes its character.
      Specified by:
      value in interface XMQAttr
      Returns:
      The value, never null.
    • rawValue

      public String rawValue()
      Returns the value of the attribute where entity references are written as &name; ie the raw value as it would be written in xmq.
      Specified by:
      rawValue in interface XMQAttr
      Returns:
      The raw value, never null.
    • setValue

      public void setValue(String value)
      Replace the value of the attribute with a text value.
      Specified by:
      setValue in interface XMQAttr
      Parameters:
      value - The new value.
    • element

      public XmlElement element()
      Returns the element owning this attribute.
      Specified by:
      element in interface XMQAttr
      Returns:
      The element or null.
    • fullName

      public String fullName()
      Description copied from class: XmlNode
      Returns the full name, ie prefix:name if the node has a namespace with a prefix.
      Specified by:
      fullName in interface XMQNode
      Overrides:
      fullName in class XmlNode
      Returns:
      The full name.