Class XmlNamespaceChunk
- java.lang.Object
-
- com.google.devrel.gmscore.tools.apk.arsc.Chunk
-
- com.google.devrel.gmscore.tools.apk.arsc.XmlNodeChunk
-
- com.google.devrel.gmscore.tools.apk.arsc.XmlNamespaceChunk
-
- All Implemented Interfaces:
SerializableResource
- Direct Known Subclasses:
XmlNamespaceEndChunk,XmlNamespaceStartChunk
public abstract class XmlNamespaceChunk extends XmlNodeChunk
Represents the start/end of a namespace in an XML document.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.google.devrel.gmscore.tools.apk.arsc.Chunk
Chunk.Type
-
-
Field Summary
-
Fields inherited from class com.google.devrel.gmscore.tools.apk.arsc.Chunk
chunkSize, headerSize, METADATA_SIZE, offset, PAD_BOUNDARY
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedXmlNamespaceChunk(java.nio.ByteBuffer buffer, Chunk parent)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetPrefix()Returns the namespace prefix.java.lang.StringgetUri()Returns the namespace URI.java.lang.StringtoString()Returns a brief description of this namespace chunk.protected voidwritePayload(java.io.DataOutput output, java.nio.ByteBuffer header, boolean shrink)Writes the chunk payload.-
Methods inherited from class com.google.devrel.gmscore.tools.apk.arsc.XmlNodeChunk
getComment, getLineNumber, getString, hasComment, writeHeader
-
Methods inherited from class com.google.devrel.gmscore.tools.apk.arsc.Chunk
getHeaderSize, getOriginalChunkSize, getParent, getType, init, newInstance, newInstance, toByteArray, toByteArray, writeHeader, writePad
-
-
-
-
Constructor Detail
-
XmlNamespaceChunk
protected XmlNamespaceChunk(java.nio.ByteBuffer buffer, @Nullable Chunk parent)
-
-
Method Detail
-
getPrefix
public java.lang.String getPrefix()
Returns the namespace prefix.
-
getUri
public java.lang.String getUri()
Returns the namespace URI.
-
writePayload
protected void writePayload(java.io.DataOutput output, java.nio.ByteBuffer header, boolean shrink) throws java.io.IOExceptionDescription copied from class:ChunkWrites the chunk payload. The payload is data in a chunk which is not in the firstheaderSizebytes of the chunk.- Overrides:
writePayloadin classChunk- Parameters:
output- The stream that the payload will be written to.header- The already-written header. This can be modified to fix payload offsets.shrink- True if this payload should be optimized for size.- Throws:
java.io.IOException- Thrown ifoutputcould not be written to (out of memory).
-
toString
public java.lang.String toString()
Returns a brief description of this namespace chunk. The representation of this information is subject to change, but below is a typical example:"XmlNamespaceChunk{line=1234, comment=My awesome comment., prefix=foo, uri=com.google.foo}"- Overrides:
toStringin classXmlNodeChunk
-
-