protected char[] getSharedValueBuffer() { return mValueBuilder.getCharBuffer(); }
/** * Method called to decode the attribute value that consists of * zero or more space-separated tokens. * Decoding is done using the decoder provided. * @return Number of tokens decoded */ public final int decodeValues(int index, TypedArrayDecoder tad, InputProblemReporter rep) throws XMLStreamException { if (index < 0 || index >= mAttrCount) { throwIndex(index); } // Char[] faster than String... and no need to trim here: return decodeValues(tad, rep, mValueBuilder.getCharBuffer(), mAttributes[index].mValueStartOffset, getValueStartOffset(index+1)); }
protected void validateAttribute(int index, XMLValidator vld) throws XMLStreamException { Attribute attr = mAttributes[index]; String normValue = vld.validateAttribute (attr.mLocalName, attr.mNamespaceURI, attr.mPrefix, mValueBuilder.getCharBuffer(), getValueStartOffset(index), getValueStartOffset(index+1)); if (normValue != null) { attr.setValue(normValue); } }
/** * Method that can be called to force space normalization (remove * leading/trailing spaces, replace non-spaces white space with * spaces, collapse spaces to one) on specified attribute. * Currently called by {@link InputElementStack} to force * normalization of Xml:id attribute */ public void normalizeSpacesInValue(int index) { // StringUtil has a method, but it works on char arrays... char[] attrCB = mValueBuilder.getCharBuffer(); String normValue = StringUtil.normalizeSpaces (attrCB, getValueStartOffset(index), getValueStartOffset(index+1)); if (normValue != null) { mAttributes[index].setValue(normValue); } }
public final byte[] decodeBinary(int index, Base64Variant v, CharArrayBase64Decoder dec, InputProblemReporter rep) throws XMLStreamException { if (index < 0 || index >= mAttrCount) { throwIndex(index); } /* No point in trying to use String representation, even if one * available, faster to process from char[] */ Attribute attr = mAttributes[index]; char[] cbuf = mValueBuilder.getCharBuffer(); int start = attr.mValueStartOffset; int end = getValueStartOffset(index+1); int len = end-start; dec.init(v, true, cbuf, start, len, null); try { return dec.decodeCompletely(); } catch (IllegalArgumentException iae) { // Need to convert to a checked stream exception String lexical = new String(cbuf, start, len); throw new TypedXMLStreamException(lexical, iae.getMessage(), rep.getLocation(), iae); } }
char[] buf = mValueBuilder.getCharBuffer(); int start = mAttributes[index].mValueStartOffset; int end = getValueStartOffset(index+1);
protected char[] getSharedValueBuffer() { return mValueBuilder.getCharBuffer(); }
protected char[] getSharedValueBuffer() { return mValueBuilder.getCharBuffer(); }
protected char[] getSharedValueBuffer() { return mValueBuilder.getCharBuffer(); }
protected char[] getSharedValueBuffer() { return mValueBuilder.getCharBuffer(); }
throws XMLStreamException char[] outBuf = tb.getCharBuffer(); int outPtr = tb.getCharSize(); int outLen = outBuf.length;
/** * Method called to decode the attribute value that consists of * zero or more space-separated tokens. * Decoding is done using the decoder provided. * @return Number of tokens decoded */ public final int decodeValues(int index, TypedArrayDecoder tad, InputProblemReporter rep) throws XMLStreamException { if (index < 0 || index >= mAttrCount) { throwIndex(index); } // Char[] faster than String... and no need to trim here: return decodeValues(tad, rep, mValueBuilder.getCharBuffer(), mAttributes[index].mValueStartOffset, getValueStartOffset(index+1)); }
protected void validateAttribute(int index, XMLValidator vld) throws XMLStreamException { Attribute attr = mAttributes[index]; String normValue = vld.validateAttribute (attr.mLocalName, attr.mNamespaceURI, attr.mPrefix, mValueBuilder.getCharBuffer(), getValueStartOffset(index), getValueStartOffset(index+1)); if (normValue != null) { attr.setValue(normValue); } }
protected void validateAttribute(int index, XMLValidator vld) throws XMLStreamException { Attribute attr = mAttributes[index]; String normValue = vld.validateAttribute (attr.mLocalName, attr.mNamespaceURI, attr.mPrefix, mValueBuilder.getCharBuffer(), getValueStartOffset(index), getValueStartOffset(index+1)); if (normValue != null) { attr.setValue(normValue); } }
protected void validateAttribute(int index, XMLValidator vld) throws XMLStreamException { Attribute attr = mAttributes[index]; String normValue = vld.validateAttribute (attr.mLocalName, attr.mNamespaceURI, attr.mPrefix, mValueBuilder.getCharBuffer(), getValueStartOffset(index), getValueStartOffset(index+1)); if (normValue != null) { attr.setValue(normValue); } }
protected void validateAttribute(int index, XMLValidator vld) throws XMLStreamException { Attribute attr = mAttributes[index]; String normValue = vld.validateAttribute (attr.mLocalName, attr.mNamespaceURI, attr.mPrefix, mValueBuilder.getCharBuffer(), getValueStartOffset(index), getValueStartOffset(index+1)); if (normValue != null) { attr.setValue(normValue); } }
/** * Method that can be called to force space normalization (remove * leading/trailing spaces, replace non-spaces white space with * spaces, collapse spaces to one) on specified attribute. * Currently called by {@link InputElementStack} to force * normalization of Xml:id attribute */ public void normalizeSpacesInValue(int index) { // StringUtil has a method, but it works on char arrays... char[] attrCB = mValueBuilder.getCharBuffer(); String normValue = StringUtil.normalizeSpaces (attrCB, getValueStartOffset(index), getValueStartOffset(index+1)); if (normValue != null) { mAttributes[index].setValue(normValue); } }
/** * Method that can be called to force space normalization (remove * leading/trailing spaces, replace non-spaces white space with * spaces, collapse spaces to one) on specified attribute. * Currently called by {@link InputElementStack} to force * normalization of Xml:id attribute */ public void normalizeSpacesInValue(int index) { // StringUtil has a method, but it works on char arrays... char[] attrCB = mValueBuilder.getCharBuffer(); String normValue = StringUtil.normalizeSpaces (attrCB, getValueStartOffset(index), getValueStartOffset(index+1)); if (normValue != null) { mAttributes[index].setValue(normValue); } }
/** * Method called to normalize value of an ID attribute, specified * using name xml:id, when support for Xml:id specification enabled. */ protected final void normalizeXmlIdAttr(AttributeCollector ac, int ix) { // StringUtil has a method, but it works on char arrays... TextBuilder attrBuilder = ac.getAttrBuilder(); char[] attrCB = attrBuilder.getCharBuffer(); String normValue = StringUtil.normalizeSpaces (attrCB, attrBuilder.getOffset(ix), attrBuilder.getOffset(ix+1)); if (normValue != null) { ac.setNormalizedValue(ix, normValue); } } }
/** * Method called to normalize value of an ID attribute, specified * using name xml:id, when support for Xml:id specification enabled. */ protected final void normalizeXmlIdAttr(AttributeCollector ac, int ix) { // StringUtil has a method, but it works on char arrays... TextBuilder attrBuilder = ac.getAttrBuilder(); char[] attrCB = attrBuilder.getCharBuffer(); String normValue = StringUtil.normalizeSpaces (attrCB, attrBuilder.getOffset(ix), attrBuilder.getOffset(ix+1)); if (normValue != null) { ac.setNormalizedValue(ix, normValue); } } }