本文整理了Java中org.codehaus.stax2.validation.XMLValidator.validateText()
方法的一些代码示例,展示了XMLValidator.validateText()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XMLValidator.validateText()
方法的具体详情如下:
包路径:org.codehaus.stax2.validation.XMLValidator
类名称:XMLValidator
方法名:validateText
[英]Method called to validate textual content.
Note: this method is only guaranteed to be called when #validateElementAndAttributes() for the currently open element returned #CONTENT_ALLOW_VALIDATABLE_TEXT (or, in case of mixed content, #validateElementEnd, for the last enclosed element). Otherwise, validator context may choose not to call the method as an optimization.
[中]方法来验证文本内容。
注意:只有当当前打开的元素的#validateElementAndAttributes()返回#CONTENT _ALLOW _VALIDATABLE _TEXT(或者,在混合内容的情况下,#validateElementEnd,对于最后一个封闭的元素)时,才保证调用此方法。否则,验证器上下文可能会选择不调用该方法作为优化。
代码示例来源:origin: org.codehaus.woodstox/woodstox-core-asl
public final void validateText(String contents, boolean lastTextSegment)
throws XMLStreamException
{
mValidator.validateText(contents, lastTextSegment);
}
代码示例来源:origin: org.codehaus.woodstox/woodstox-core-asl
public void validateText(XMLValidator vld, boolean lastSegment)
throws XMLStreamException
{
// Shared buffer? Let's just pass that
if (mInputStart >= 0) {
vld.validateText(mInputBuffer, mInputStart, mInputStart + mInputLen, lastSegment);
} else {
/* Otherwise, can either create a combine buffer, or construct
* a String. While former could be more efficient, let's do latter
* for now since current validator implementations work better
* with Strings.
*/
vld.validateText(contentsAsString(), lastSegment);
}
}
代码示例来源:origin: org.codehaus.woodstox/woodstox-core-asl
/**
* Validating version of typed write method
*/
public final void writeTypedElement(AsciiValueEncoder enc,
XMLValidator validator, char[] copyBuffer)
throws IOException, XMLStreamException
{
if (mSurrogate != 0) {
throwUnpairedSurrogate();
}
/* Ok, this gets trickier: can't use efficient direct-to-bytes
* encoding since validator won't be able to use it. Instead
* have to use temporary copy buffer.
*/
final int copyBufferLen = copyBuffer.length;
// Copy buffer should never be too small, no need to check up front
do {
int ptr = enc.encodeMore(copyBuffer, 0, copyBufferLen);
// False -> can't be sure it's the whole remaining text
validator.validateText(copyBuffer, 0, ptr, false);
writeRawAscii(copyBuffer, 0, ptr);
} while (!enc.isCompleted());
}
代码示例来源:origin: org.codehaus.woodstox/woodstox-core-asl
public final void writeTypedElement(AsciiValueEncoder enc,
XMLValidator validator, char[] copyBuffer)
throws IOException, XMLStreamException
{
if (mOut == null) {
return;
}
int free = mOutputBufLen - mOutputPtr;
if (enc.bufferNeedsFlush(free)) {
flush();
}
int start = mOutputPtr;
while (true) {
mOutputPtr = enc.encodeMore(mOutputBuffer, mOutputPtr, mOutputBufLen);
// False -> can't be sure it's the whole remaining text
validator.validateText(mOutputBuffer, start, mOutputPtr, false);
if (enc.isCompleted()) {
break;
}
flush();
start = mOutputPtr;
}
}
代码示例来源:origin: Nextdoor/bender
public void validateText(String text, boolean lastTextSegment)
throws XMLStreamException
{
mFirst.validateText(text, lastTextSegment);
mSecond.validateText(text, lastTextSegment);
}
代码示例来源:origin: Nextdoor/bender
public void validateText(char[] cbuf, int textStart, int textEnd,
boolean lastTextSegment)
throws XMLStreamException
{
mFirst.validateText(cbuf, textStart, textEnd, lastTextSegment);
mSecond.validateText(cbuf, textStart, textEnd, lastTextSegment);
}
代码示例来源:origin: woodstox/wstx-asl
public void validateText(char[] cbuf, int textStart, int textEnd,
boolean lastTextSegment)
throws XMLValidationException
{
mFirst.validateText(cbuf, textStart, textEnd, lastTextSegment);
mSecond.validateText(cbuf, textStart, textEnd, lastTextSegment);
}
代码示例来源:origin: woodstox/wstx-asl
public void validateText(String text, boolean lastTextSegment)
throws XMLValidationException
{
mFirst.validateText(text, lastTextSegment);
mSecond.validateText(text, lastTextSegment);
}
代码示例来源:origin: com.fasterxml.woodstox/woodstox-core
public final void validateText(String contents, boolean lastTextSegment)
throws XMLStreamException
{
mValidator.validateText(contents, lastTextSegment);
}
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.woodstox
public void validateText(char[] cbuf, int textStart, int textEnd,
boolean lastTextSegment)
throws XMLValidationException
{
mFirst.validateText(cbuf, textStart, textEnd, lastTextSegment);
mSecond.validateText(cbuf, textStart, textEnd, lastTextSegment);
}
代码示例来源:origin: org.codehaus.woodstox/woodstox-core-lgpl
public final void validateText(String contents, boolean lastTextSegment)
throws XMLStreamException
{
mValidator.validateText(contents, lastTextSegment);
}
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.woodstox
public void validateText(String text, boolean lastTextSegment)
throws XMLValidationException
{
mFirst.validateText(text, lastTextSegment);
mSecond.validateText(text, lastTextSegment);
}
代码示例来源:origin: woodstox/wstx-lgpl
public void validateText(String text, boolean lastTextSegment)
throws XMLValidationException
{
mFirst.validateText(text, lastTextSegment);
mSecond.validateText(text, lastTextSegment);
}
代码示例来源:origin: woodstox/wstx-lgpl
public void validateText(char[] cbuf, int textStart, int textEnd,
boolean lastTextSegment)
throws XMLValidationException
{
mFirst.validateText(cbuf, textStart, textEnd, lastTextSegment);
mSecond.validateText(cbuf, textStart, textEnd, lastTextSegment);
}
代码示例来源:origin: Nextdoor/bender
public final void validateText(String contents, boolean lastTextSegment)
throws XMLStreamException
{
mValidator.validateText(contents, lastTextSegment);
}
代码示例来源:origin: org.codehaus.woodstox/woodstox-core-asl
mValidator.validateText(ch.getData(), false);
代码示例来源:origin: org.codehaus.woodstox/woodstox-core-asl
mValidator.validateText(cbuf, start, len, false);
代码示例来源:origin: org.codehaus.woodstox/woodstox-core-asl
mValidator.validateText(text, false);
代码示例来源:origin: org.codehaus.woodstox/woodstox-core-asl
mValidator.validateText(text, start, len, false);
代码示例来源:origin: org.codehaus.woodstox/woodstox-core-asl
mValidator.validateText(data, false);
内容来源于网络,如有侵权,请联系作者删除!