public NonNsInputElementStack(int initialSize, ReaderConfig cfg) { super(cfg); mSize = 0; if (initialSize < 4) { initialSize = 4; } mElements = new String[initialSize]; mAttrCollector = new NonNsAttributeCollector(cfg); }
public int addDefaultAttribute(String localName, String uri, String prefix, String value) { // No real namespace info passed... return mAttrCollector.addDefaultAttribute(localName, 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(); } }
int xmlidIx = ac.resolveValues(mReporter); mIdAttrIndex = xmlidIx; int attrLen = ac.getCount(); if (attrLen > 0) { StringVector attrNames = ac.getNameList(); String[] nameData = attrNames.getInternalArray(); TextBuilder attrBuilder = ac.getAttrBuilder(); char[] attrCB = attrBuilder.getCharBuffer(); for (int i = 0; i < attrLen; ++i) { attrBuilder.getOffset(i+1)); if (normValue != null) { ac.setNormalizedValue(i, normValue);
initHashArea(); int currIndex = map[index]-1; // Index of primary collision entry int spillIndex = mAttrSpillEnd; map = spillAttr(localName, map, currIndex, spillIndex, attrIndex, hash, mAttrHashSize); if (map == null) { // dup!
/** * Method that basically serializes the specified (read-in) attribute * using Writers provided */ public void writeAttribute(int index, XmlWriter xw) throws IOException, XMLStreamException { // Note: here we assume index checks have been done by caller String ln = mAttrNames.getString(index); xw.writeAttribute(ln, getValue(index)); }
public final int findAttributeIndex(String nsURI, String localName) { // Should never pass a NS URI... if (nsURI != null && nsURI.length() > 0) { return -1; } return mAttrCollector.findIndex(localName); }
public final int getAttributeCount() { return mAttrCollector.getCount(); }
public QName getQName(int index) { return new QName(getLocalName(index)); }
int xmlidIx = ac.resolveValues(mReporter); mIdAttrIndex = xmlidIx; int attrLen = ac.getCount(); if (attrLen > 0) { StringVector attrNames = ac.getNameList(); String[] nameData = attrNames.getInternalArray(); TextBuilder attrBuilder = ac.getAttrBuilder(); char[] attrCB = attrBuilder.getCharBuffer(); for (int i = 0; i < attrLen; ++i) { attrBuilder.getOffset(i+1)); if (normValue != null) { ac.setNormalizedValue(i, normValue);
initHashArea(); int currIndex = map[index]-1; // Index of primary collision entry int spillIndex = mAttrSpillEnd; map = spillAttr(localName, map, currIndex, spillIndex, attrIndex, hash, mAttrHashSize); if (map == null) { // dup!
/** * Method that basically serializes the specified (read-in) attribute * using Writers provided */ public void writeAttribute(int index, XmlWriter xw) throws IOException, XMLStreamException { // Note: here we assume index checks have been done by caller String ln = mAttrNames.getString(index); xw.writeAttribute(ln, getValue(index)); }
public final int findAttributeIndex(String nsURI, String localName) { // Should never pass a NS URI... if (nsURI != null && nsURI.length() > 0) { return -1; } return mAttrCollector.findIndex(localName); }
public final int getAttributeCount() { return mAttrCollector.getCount(); }
public QName getQName(int index) { return new QName(getLocalName(index)); }
int xmlidIx = ac.resolveValues(mReporter); mIdAttrIndex = xmlidIx; int attrLen = ac.getCount(); if (attrLen > 0) { StringVector attrNames = ac.getNameList(); String[] nameData = attrNames.getInternalArray(); TextBuilder attrBuilder = ac.getAttrBuilder(); char[] attrCB = attrBuilder.getCharBuffer(); for (int i = 0; i < attrLen; ++i) { attrBuilder.getOffset(i+1)); if (normValue != null) { ac.setNormalizedValue(i, normValue);
initHashArea(); int currIndex = map[index]-1; // Index of primary collision entry int spillIndex = mAttrSpillEnd; map = spillAttr(localName, map, currIndex, spillIndex, attrIndex, hash, mAttrHashSize); if (map == null) { // dup!
/** * Method that basically serializes the specified (read-in) attribute * using Writers provided */ public void writeAttribute(int index, XmlWriter xw) throws IOException, XMLStreamException { // Note: here we assume index checks have been done by caller String ln = mAttrNames.getString(index); xw.writeAttribute(ln, getValue(index)); }
/** * 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 NonNsInputElementStack(int initialSize, ReaderConfig cfg) { super(cfg); mSize = 0; if (initialSize < 4) { initialSize = 4; } mElements = new String[initialSize]; mAttrCollector = new NonNsAttributeCollector(cfg); }