protected void coalesceText(int initialType) { mTextBuffer.addText(mCurrNode.getNodeValue()); Node n; while ((n = mCurrNode.getNextSibling()) != null) { int type = n.getNodeType(); if (type != Node.TEXT_NODE && type != Node.CDATA_SECTION_NODE) { break; } mCurrNode = n; mTextBuffer.addText(mCurrNode.getNodeValue()); } mCoalescedText = mTextBuffer.getAndClear(); // Either way, type gets always set to be CHARACTERS mCurrEvent = CHARACTERS; }
if (mTextAccumulator.hasText()) { doValidateText(mTextAccumulator);
throwParseError(ErrorConsts.ERR_STATE_NOT_STELEM); TextAccumulator acc = new TextAccumulator(); throwParseError("Expected a text token, got "+tokenTypeDesc(type)+"."); acc.addText(getText()); return acc.getAndClear();
void doValidateText(TextAccumulator textAcc) throws XMLStreamException { if (mCurrAcceptor != null) { String str = textAcc.getAndClear(); DatatypeRef typeRef = null; if (!mCurrAcceptor.onText2(str, this, mErrorRef, typeRef) || mErrorRef.str != null) { reportError(mErrorRef); } } }
public void validateText(char[] cbuf, int textStart, int textEnd, boolean lastTextSegment) throws XMLStreamException { /* If we got here, then it's likely we do need to call onText(). * (not guaranteed, though; in case of multiple parallel validators, * only one of them may actually be interested) */ mTextAccumulator.addText(cbuf, textStart, textEnd); if (lastTextSegment) { doValidateText(mTextAccumulator); } }
protected TextAccumulator mTextBuffer = new TextAccumulator();
throwParseError(ErrorConsts.ERR_STATE_NOT_STELEM); TextAccumulator acc = new TextAccumulator(); throwParseError("Expected a text token, got "+tokenTypeDesc(type)+"."); acc.addText(getText()); return acc.getAndClear();
void doValidateText(TextAccumulator textAcc) throws XMLStreamException { if (mCurrAcceptor != null) { String str = textAcc.getAndClear(); DatatypeRef typeRef = null; if (!mCurrAcceptor.onText2(str, this, mErrorRef, typeRef) || mErrorRef.str != null) { reportError(mErrorRef); } } }
public void validateText(char[] cbuf, int textStart, int textEnd, boolean lastTextSegment) throws XMLValidationException { /* If we got here, then it's likely we do need to call onText(). * (not guaranteed, though; in case of multiple parallel validators, * only one of them may actually be interested) */ mTextAccumulator.addText(cbuf, textStart, textEnd); if (lastTextSegment) { doValidateText(mTextAccumulator); } }
protected TextAccumulator mTextBuffer = new TextAccumulator();
protected void coalesceText(int initialType) { mTextBuffer.addText(mCurrNode.getNodeValue()); Node n; while ((n = mCurrNode.getNextSibling()) != null) { int type = n.getNodeType(); if (type != Node.TEXT_NODE && type != Node.CDATA_SECTION_NODE) { break; } mCurrNode = n; mTextBuffer.addText(mCurrNode.getNodeValue()); } mCoalescedText = mTextBuffer.getAndClear(); // Either way, type gets always set to be CHARACTERS mCurrEvent = CHARACTERS; }
throwParseError(ErrorConsts.ERR_STATE_NOT_STELEM); TextAccumulator acc = new TextAccumulator(); throwParseError("Expected a text token, got "+tokenTypeDesc(type)+"."); acc.addText(getText()); return acc.getAndClear();
if (mTextAccumulator.hasText()) { doValidateText(mTextAccumulator);
private void doValidateText(TextAccumulator textAcc) throws XMLValidationException { if (mCurrAcceptor != null) { String str = textAcc.getAndClear(); DatatypeRef typeRef = null; if (!mCurrAcceptor.onText2(str, mMsvContext, mErrorRef, typeRef) || mErrorRef.str != null) { reportError(mErrorRef); } } }
@Override public void validateText(char[] cbuf, int textStart, int textEnd, boolean lastTextSegment) throws XMLStreamException { /* If we got here, then it's likely we do need to call onText(). * (not guaranteed, though; in case of multiple parallel validators, * only one of them may actually be interested) */ mTextAccumulator.addText(cbuf, textStart, textEnd); if (lastTextSegment) { doValidateText(mTextAccumulator); } }
protected TextAccumulator mTextBuffer = new TextAccumulator();
protected void coalesceText(int initialType) { mTextBuffer.addText(mCurrNode.getNodeValue()); Node n; while ((n = mCurrNode.getNextSibling()) != null) { int type = n.getNodeType(); if (type != Node.TEXT_NODE && type != Node.CDATA_SECTION_NODE) { break; } mCurrNode = n; mTextBuffer.addText(mCurrNode.getNodeValue()); } mCoalescedText = mTextBuffer.getAndClear(); // Either way, type gets always set to be CHARACTERS mCurrEvent = CHARACTERS; }
if (mTextAccumulator.hasText()) { doValidateText(mTextAccumulator);
private void doValidateText(TextAccumulator textAcc) throws XMLValidationException { if (mCurrAcceptor != null) { String str = textAcc.getAndClear(); DatatypeRef typeRef = null; if (!mCurrAcceptor.onText2(str, mMsvContext, mErrorRef, typeRef) || mErrorRef.str != null) { reportError(mErrorRef); } } }
public void validateText(char[] cbuf, int textStart, int textEnd, boolean lastTextSegment) throws XMLValidationException { /* If we got here, then it's likely we do need to call onText(). * (not guaranteed, though; in case of multiple parallel validators, * only one of them may actually be interested) */ mTextAccumulator.addText(cbuf, textStart, textEnd); if (lastTextSegment) { doValidateText(mTextAccumulator); } }