Constructors Summary |
---|
public XmlBlock(byte[] data)
mAssets = null;
mNative = nativeCreate(data, 0, data.length);
mStrings = new StringBlock(nativeGetStringBlock(mNative), false);
|
public XmlBlock(byte[] data, int offset, int size)
mAssets = null;
mNative = nativeCreate(data, offset, size);
mStrings = new StringBlock(nativeGetStringBlock(mNative), false);
|
XmlBlock(AssetManager assets, long xmlBlock)Create from an existing xml block native object. This is
-extremely- dangerous -- only use it if you absolutely know what you
are doing! The given native object must exist for the entire lifetime
of this newly creating XmlBlock.
mAssets = assets;
mNative = xmlBlock;
mStrings = new StringBlock(nativeGetStringBlock(xmlBlock), false);
|
Methods Summary |
---|
public void | close()
synchronized (this) {
if (mOpen) {
mOpen = false;
decOpenCountLocked();
}
}
|
private void | decOpenCountLocked()
mOpenCount--;
if (mOpenCount == 0) {
nativeDestroy(mNative);
if (mAssets != null) {
mAssets.xmlBlockGone(hashCode());
}
}
|
protected void | finalize()
close();
|
private static final native long | nativeCreate(byte[] data, int offset, int size)
|
private static final native long | nativeCreateParseState(long obj)
|
private static final native void | nativeDestroy(long obj)
|
private static final native void | nativeDestroyParseState(long state)
|
private static final native int | nativeGetAttributeCount(long state)
|
private static final native int | nativeGetAttributeData(long state, int idx)
|
private static final native int | nativeGetAttributeDataType(long state, int idx)
|
private static final native int | nativeGetAttributeIndex(long state, java.lang.String namespace, java.lang.String name)
|
private static final native int | nativeGetAttributeName(long state, int idx)
|
private static final native int | nativeGetAttributeNamespace(long state, int idx)
|
private static final native int | nativeGetAttributeResource(long state, int idx)
|
private static final native int | nativeGetAttributeStringValue(long state, int idx)
|
private static final native int | nativeGetClassAttribute(long state)
|
private static final native int | nativeGetIdAttribute(long state)
|
private static final native int | nativeGetLineNumber(long state)
|
static final native int | nativeGetName(long state)
|
private static final native int | nativeGetNamespace(long state)
|
private static final native long | nativeGetStringBlock(long obj)
|
private static final native int | nativeGetStyleAttribute(long state)
|
private static final native int | nativeGetText(long state)
|
static final native int | nativeNext(long state)
|
public XmlResourceParser | newParser()
synchronized (this) {
if (mNative != 0) {
return new Parser(nativeCreateParseState(mNative), this);
}
return null;
}
|