public class XmlAttribute extends java.lang.Object implements SerializableResource
| Modifier and Type | Field and Description |
|---|---|
static int |
SIZE
The serialized size in bytes of an
XmlAttribute. |
| Modifier and Type | Method and Description |
|---|---|
static XmlAttribute |
create(java.nio.ByteBuffer buffer,
XmlNodeChunk parent)
Creates a new
XmlAttribute based on the bytes at the current buffer position. |
boolean |
equals(java.lang.Object o) |
int |
hashCode() |
java.lang.String |
name()
The attribute name, or the empty string if not present.
|
int |
nameIndex()
A string reference to the attribute name.
|
java.lang.String |
namespace()
The namespace URI, or the empty string if not present.
|
int |
namespaceIndex()
A string reference to the namespace URI, or -1 if not present.
|
XmlNodeChunk |
parent()
The parent of this XML attribute; used for dereferencing the namespace and name.
|
java.lang.String |
rawValue()
The raw character value.
|
int |
rawValueIndex()
A string reference to a string containing the character value.
|
byte[] |
toByteArray()
Converts this resource into an array of bytes representation.
|
byte[] |
toByteArray(boolean shrink)
Converts this resource into an array of bytes representation.
|
java.lang.String |
toString()
Returns a brief description of this XML attribute.
|
BinaryResourceValue |
typedValue()
A
BinaryResourceValue instance containing the parsed value. |
public static final int SIZE
XmlAttribute.public static XmlAttribute create(java.nio.ByteBuffer buffer, XmlNodeChunk parent)
XmlAttribute based on the bytes at the current buffer position.buffer - A buffer whose position is at the start of a XmlAttribute.parent - The parent chunk that contains this attribute; used for string lookups.public int namespaceIndex()
public int nameIndex()
public int rawValueIndex()
public BinaryResourceValue typedValue()
BinaryResourceValue instance containing the parsed value.public XmlNodeChunk parent()
public final java.lang.String namespace()
public final java.lang.String name()
public final java.lang.String rawValue()
public byte[] toByteArray()
SerializableResourcetoByteArray in interface SerializableResourcepublic byte[] toByteArray(boolean shrink)
SerializableResourcetoByteArray in interface SerializableResourceshrink - True if, when converting to a byte array, this resource can modify the returned
bytes in an effort to reduce the size.public boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toString()
"XmlAttribute{namespace=foo, name=bar, value=1234}"toString in class java.lang.Object