public NsInputElementStack(int initialSize, ReaderConfig cfg) { super(cfg); mSize = 0; if (initialSize < 4) { initialSize = 4; } mElements = new String[initialSize << 2]; mNsCounts = new int[initialSize]; mAttrCollector = new NsAttributeCollector(cfg); }
public int addDefaultAttribute(String localName, String uri, String prefix, String value) { return mAttrCollector.addDefaultAttribute(localName, uri, prefix, value); }
/** * Method called to ensure hash area will be properly set up in * cases where initially no room was needed, but default attribute(s) * is being added. */ private void initHashArea() { /* Let's use small hash area of size 4, and one spill; don't * want too big (need to clear up room), nor too small (only * collisions) */ mAttrHashSize = mAttrSpillEnd = 4; if (mAttrMap == null || mAttrMap.length < mAttrHashSize) { mAttrMap = new int[mAttrHashSize+1]; } mAttrMap[0] = mAttrMap[1] = mAttrMap[2] = mAttrMap[3] = 0; allocBuffers(); } }
/** * Note: caller must check validity of the index prior to calling this * method. */ public QName getQName(int index) { String prefix = getPrefix(index); if (prefix == null) { // QName barfs on null... prefix = ""; } return new QName(getURI(index), getLocalName(index), prefix); }
int nsCount = ac.getNsCount(); if (nsCount > 0) { String [] nsPrefixes = ac.getNsPrefixes(); TextBuilder nsURIs = ac.getNsURIs(); boolean internNsUris = mConfig.willInternNsURIs(); for (int i = 0; i < nsCount; ++i) { int xmlidIx = ac.resolveNamespaces(mReporter, mNamespaces); mIdAttrIndex = xmlidIx; StringVector attrNames = ac.getNameList(); int attrLen = ac.getCount(); if (attrLen > 0) { String[] attrURIs = ac.getAttrURIs(); String[] nameData = attrNames.getInternalArray(); TextBuilder attrBuilder = ac.getAttrBuilder(); char[] attrCB = attrBuilder.getCharBuffer(); for (int i = 0, nr = 0; i < attrLen; i += 2, ++nr) { attrBuilder.getOffset(nr+1)); if (normValue != null) { ac.setNormalizedValue(nr, normValue);
public final int getAttributeCount() { return mAttrCollector.getCount(); }
public final int findAttributeIndex(String nsURI, String localName) { return mAttrCollector.findIndex(nsURI, localName); }
int nsCount = ac.getNsCount(); if (nsCount > 0) { String [] nsPrefixes = ac.getNsPrefixes(); TextBuilder nsURIs = ac.getNsURIs(); boolean internNsUris = mConfig.willInternNsURIs(); for (int i = 0; i < nsCount; ++i) { int xmlidIx = ac.resolveNamespaces(mReporter, mNamespaces); mIdAttrIndex = xmlidIx; StringVector attrNames = ac.getNameList(); int attrLen = ac.getCount(); if (attrLen > 0) { String[] attrURIs = ac.getAttrURIs(); String[] nameData = attrNames.getInternalArray(); TextBuilder attrBuilder = ac.getAttrBuilder(); char[] attrCB = attrBuilder.getCharBuffer(); for (int i = 0, nr = 0; i < attrLen; i += 2, ++nr) { attrBuilder.getOffset(nr+1)); if (normValue != null) { ac.setNormalizedValue(nr, normValue);
/** * Note: caller must check validity of the index prior to calling this * method. */ public QName getQName(int index) { String prefix = getPrefix(index); if (prefix == null) { // QName barfs on null... prefix = ""; } return new QName(getURI(index), getLocalName(index), prefix); }
public final int getAttributeCount() { return mAttrCollector.getCount(); }
public final int findAttributeIndex(String nsURI, String localName) { return mAttrCollector.findIndex(nsURI, localName); }
int nsCount = ac.getNsCount(); if (nsCount > 0) { String [] nsPrefixes = ac.getNsPrefixes(); TextBuilder nsURIs = ac.getNsURIs(); boolean internNsUris = mConfig.willInternNsURIs(); for (int i = 0; i < nsCount; ++i) { int xmlidIx = ac.resolveNamespaces(mReporter, mNamespaces); mIdAttrIndex = xmlidIx; StringVector attrNames = ac.getNameList(); int attrLen = ac.getCount(); if (attrLen > 0) { String[] attrURIs = ac.getAttrURIs(); String[] nameData = attrNames.getInternalArray(); TextBuilder attrBuilder = ac.getAttrBuilder(); char[] attrCB = attrBuilder.getCharBuffer(); for (int i = 0, nr = 0; i < attrLen; i += 2, ++nr) { attrBuilder.getOffset(nr+1)); if (normValue != null) { ac.setNormalizedValue(nr, normValue);
/** * Note: caller must check validity of the index prior to calling this * method. */ public QName getQName(int index) { String prefix = getPrefix(index); if (prefix == null) { // QName barfs on null... prefix = ""; } return QNameCreator.create(getURI(index), getLocalName(index), prefix); }
/** * Method called to ensure hash area will be properly set up in * cases where initially no room was needed, but default attribute(s) * is being added. */ private void initHashArea() { /* Let's use small hash area of size 4, and one spill; don't * want too big (need to clear up room), nor too small (only * collisions) */ mAttrHashSize = mAttrSpillEnd = 4; if (mAttrMap == null || mAttrMap.length < mAttrHashSize) { mAttrMap = new int[mAttrHashSize+1]; } mAttrMap[0] = mAttrMap[1] = mAttrMap[2] = mAttrMap[3] = 0; allocBuffers(); } }
public NsInputElementStack(int initialSize, ReaderConfig cfg) { super(cfg); mSize = 0; if (initialSize < 4) { initialSize = 4; } mElements = new String[initialSize << 2]; mNsCounts = new int[initialSize]; mAttrCollector = new NsAttributeCollector(cfg); }
public int addDefaultAttribute(String localName, String uri, String prefix, String value) { return mAttrCollector.addDefaultAttribute(localName, uri, prefix, value); }
public final int getAttributeCount() { return mAttrCollector.getCount(); }
public final int findAttributeIndex(String nsURI, String localName) { return mAttrCollector.findIndex(nsURI, localName); }
/** * Method called to ensure hash area will be properly set up in * cases where initially no room was needed, but default attribute(s) * is being added. */ private void initHashArea() { /* Let's use small hash area of size 4, and one spill; don't * want too big (need to clear up room), nor too small (only * collisions) */ mAttrHashSize = mAttrSpillEnd = 4; if (mAttrMap == null || mAttrMap.length < mAttrHashSize) { mAttrMap = new int[mAttrHashSize+1]; } mAttrMap[0] = mAttrMap[1] = mAttrMap[2] = mAttrMap[3] = 0; allocBuffers(); } }
public NsInputElementStack(int initialSize, ReaderConfig cfg) { super(cfg); mSize = 0; if (initialSize < 4) { initialSize = 4; } mElements = new String[initialSize << 2]; mNsCounts = new int[initialSize]; mAttrCollector = new NsAttributeCollector(cfg); }