Class XmlAttribute
- java.lang.Object
-
- com.google.devrel.gmscore.tools.apk.arsc.XmlAttribute
-
- All Implemented Interfaces:
SerializableResource
public class XmlAttribute extends java.lang.Object implements SerializableResource
Represents an XML attribute and value.
-
-
Field Summary
Fields Modifier and Type Field Description static intSIZEThe serialized size in bytes of anXmlAttribute.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static XmlAttributecreate(java.nio.ByteBuffer buffer, XmlNodeChunk parent)Creates a newXmlAttributebased on the bytes at the currentbufferposition.booleanequals(java.lang.Object o)inthashCode()java.lang.Stringname()The attribute name, or the empty string if not present.intnameIndex()A string reference to the attribute name.java.lang.Stringnamespace()The namespace URI, or the empty string if not present.intnamespaceIndex()A string reference to the namespace URI, or -1 if not present.XmlNodeChunkparent()The parent of this XML attribute; used for dereferencing the namespace and name.java.lang.StringrawValue()The raw character value.intrawValueIndex()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.StringtoString()Returns a brief description of this XML attribute.BinaryResourceValuetypedValue()ABinaryResourceValueinstance containing the parsed value.
-
-
-
Field Detail
-
SIZE
public static final int SIZE
The serialized size in bytes of anXmlAttribute.- See Also:
- Constant Field Values
-
-
Method Detail
-
create
public static XmlAttribute create(java.nio.ByteBuffer buffer, XmlNodeChunk parent)
Creates a newXmlAttributebased on the bytes at the currentbufferposition.- Parameters:
buffer- A buffer whose position is at the start of aXmlAttribute.parent- The parent chunk that contains this attribute; used for string lookups.
-
namespaceIndex
public int namespaceIndex()
A string reference to the namespace URI, or -1 if not present.
-
nameIndex
public int nameIndex()
A string reference to the attribute name.
-
rawValueIndex
public int rawValueIndex()
A string reference to a string containing the character value.
-
typedValue
public BinaryResourceValue typedValue()
ABinaryResourceValueinstance containing the parsed value.
-
parent
public XmlNodeChunk parent()
The parent of this XML attribute; used for dereferencing the namespace and name.
-
namespace
public final java.lang.String namespace()
The namespace URI, or the empty string if not present.
-
name
public final java.lang.String name()
The attribute name, or the empty string if not present.
-
rawValue
public final java.lang.String rawValue()
The raw character value.
-
toByteArray
public byte[] toByteArray()
Description copied from interface:SerializableResourceConverts this resource into an array of bytes representation.- Specified by:
toByteArrayin interfaceSerializableResource- Returns:
- An array of bytes representing this resource.
-
toByteArray
public byte[] toByteArray(boolean shrink)
Description copied from interface:SerializableResourceConverts this resource into an array of bytes representation.- Specified by:
toByteArrayin interfaceSerializableResource- Parameters:
shrink- True if, when converting to a byte array, this resource can modify the returned bytes in an effort to reduce the size.- Returns:
- An array of bytes representing this resource.
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
Returns a brief description of this XML attribute. The representation of this information is subject to change, but below is a typical example:"XmlAttribute{namespace=foo, name=bar, value=1234}"- Overrides:
toStringin classjava.lang.Object
-
-